cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Clean up TreeMapBackedSortedColumns.addColumn()
Date Wed, 12 Jun 2013 03:44:12 GMT
Updated Branches:
  refs/heads/trunk 84d1aaaea -> 9c4be2928


Clean up TreeMapBackedSortedColumns.addColumn()


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

Branch: refs/heads/trunk
Commit: 9c4be2928a80ab503aab54afc1805894bcef4fc8
Parents: 84d1aaa
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed Jun 12 06:43:35 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Jun 12 06:43:35 2013 +0300

----------------------------------------------------------------------
 .../db/TreeMapBackedSortedColumns.java          | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c4be292/src/java/org/apache/cassandra/db/TreeMapBackedSortedColumns.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/TreeMapBackedSortedColumns.java b/src/java/org/apache/cassandra/db/TreeMapBackedSortedColumns.java
index a9b7c57..2b4cc66 100644
--- a/src/java/org/apache/cassandra/db/TreeMapBackedSortedColumns.java
+++ b/src/java/org/apache/cassandra/db/TreeMapBackedSortedColumns.java
@@ -28,7 +28,6 @@ import com.google.common.base.Function;
 
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.db.filter.ColumnSlice;
-import org.apache.cassandra.db.index.SecondaryIndexManager;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.utils.Allocator;
 
@@ -77,16 +76,11 @@ public class TreeMapBackedSortedColumns extends AbstractThreadUnsafeSortedColumn
         return false;
     }
 
-    public void addColumn(Column column, Allocator allocator)
-    {
-        addColumn(column, allocator, SecondaryIndexManager.nullUpdater);
-    }
-
     /*
      * If we find an old column that has the same name
      * the ask it to resolve itself else add the new column
     */
-    public long addColumn(Column column, Allocator allocator, SecondaryIndexManager.Updater
indexer)
+    public void addColumn(Column column, Allocator allocator)
     {
         ByteBuffer name = column.name();
         // this is a slightly unusual way to structure this; a more natural way is shown
in ThreadSafeSortedColumns,
@@ -95,18 +89,10 @@ public class TreeMapBackedSortedColumns extends AbstractThreadUnsafeSortedColumn
         // in exchange for a re-put in the SuperColumn case.
         Column oldColumn = map.put(name, column);
         if (oldColumn == null)
-            return column.dataSize();
+            return;
 
         // calculate reconciled col from old (existing) col and new col
-        Column reconciledColumn = column.reconcile(oldColumn, allocator);
-        map.put(name, reconciledColumn);
-        // for memtable updates we only care about oldcolumn, reconciledcolumn, but when
compacting
-        // we need to make sure we update indexes no matter the order we merge
-        if (reconciledColumn == column)
-            indexer.update(oldColumn, reconciledColumn);
-        else
-            indexer.update(column, reconciledColumn);
-        return reconciledColumn.dataSize() - oldColumn.dataSize();
+        map.put(name, column.reconcile(oldColumn, allocator));
     }
 
     /**


Mime
View raw message