cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [3/3] git commit: remove special RM method for schema mutations deserialization in addition to CASSANDRA-4880
Date Thu, 22 Nov 2012 00:01:50 GMT
remove special RM method for schema mutations deserialization in addition to CASSANDRA-4880


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e128ab00
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e128ab00
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e128ab00

Branch: refs/heads/cassandra-1.2
Commit: e128ab0022d591923a9b5576ab4ef7c000a191a5
Parents: 7cfdb14
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Nov 20 14:29:15 2012 -0800
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Wed Nov 21 15:45:15 2012 -0800

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/RowMutation.java  |   50 ---------------
 .../apache/cassandra/service/MigrationManager.java |    2 +-
 2 files changed, 1 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e128ab00/src/java/org/apache/cassandra/db/RowMutation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowMutation.java b/src/java/org/apache/cassandra/db/RowMutation.java
index 16fa4be..a48e027 100644
--- a/src/java/org/apache/cassandra/db/RowMutation.java
+++ b/src/java/org/apache/cassandra/db/RowMutation.java
@@ -442,56 +442,6 @@ public class RowMutation implements IMutation, MessageProducer
             return new RowMutation(table, key, modifications);
         }
 
-        /**
-         * Used only by o.a.c.service.MigrationManager to fix possibly broken System.nanoTime()
timestamps
-         * of the schema migrations from remote nodes
-         *
-         * @param dis The source of the data
-         * @param version The version of remote node
-         *
-         * @return row mutation with fixed internal timestamps
-         *
-         * @throws IOException If data could not be read
-         */
-        public RowMutation deserializeFixingTimestamps(DataInput dis, int version) throws
IOException
-        {
-            RowMutation mutation = deserialize(dis, version);
-
-            long now = FBUtilities.timestampMicros();
-            Map<Integer, ColumnFamily> fixedModifications = new HashMap<Integer,
ColumnFamily>();
-
-            for (Map.Entry<Integer, ColumnFamily> modification : mutation.modifications_.entrySet())
-            {
-                ColumnFamily cfOld = modification.getValue();
-                ColumnFamily cf = ColumnFamily.create(cfOld.metadata());
-
-                if (cfOld.isMarkedForDelete())
-                    cf.delete(cfOld.getLocalDeletionTime(), cfOld.getMarkedForDeleteAt()
> now ? now : cfOld.getMarkedForDeleteAt());
-
-                for (IColumn column : cfOld.columns)
-                {
-                    // don't clone if column already has a correct timestamp
-                    if (column.timestamp() <= now)
-                    {
-                        cf.addColumn(column);
-                        continue;
-                    }
-
-                    if (column.isMarkedForDelete())
-                        cf.addColumn(new DeletedColumn(column.name(), column.value(), now));
-                    else
-                        cf.addColumn(new Column(column.name(), column.value(), now));
-                }
-
-                if (cf.isMarkedForDelete() && cf.isEmpty())
-                    continue;
-
-                fixedModifications.put(modification.getKey(), cf);
-            }
-
-            return new RowMutation(mutation.getTable(), mutation.key(), fixedModifications);
-        }
-
         public RowMutation deserialize(DataInput dis, int version) throws IOException
         {
             return deserialize(dis, version, IColumnSerializer.Flag.FROM_REMOTE);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e128ab00/src/java/org/apache/cassandra/service/MigrationManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java b/src/java/org/apache/cassandra/service/MigrationManager.java
index 973b190..53c3035 100644
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@ -304,7 +304,7 @@ public class MigrationManager implements IEndpointStateChangeSubscriber
         int count = in.readInt();
 
         for (int i = 0; i < count; i++)
-            schema.add(RowMutation.serializer().deserializeFixingTimestamps(in, version));
+            schema.add(RowMutation.serializer().deserialize(in, version));
 
         return schema;
     }


Mime
View raw message