cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [02/10] git commit: revert #5966
Date Wed, 18 Sep 2013 17:45:13 GMT
revert #5966


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

Branch: refs/heads/trunk
Commit: 8d6271ddf22115da4032247f1fabbcea1b9a9d07
Parents: fc9b3a7
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Sep 18 09:39:35 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Sep 18 09:45:37 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 -
 .../db/columniterator/SSTableNamesIterator.java | 37 ++++----------------
 2 files changed, 7 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8d6271dd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fb4f3f4..47ff752 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,7 +3,6 @@
  * (Hadoop) Fix CQLRW for thrift tables (CASSANDRA-6002)
  * Fix possible divide-by-zero in HHOM (CASSANDRA-5990)
  * Allow local batchlog writes for CL.ANY (CASSANDRA-5967)
- * Optimize name query performance in wide rows (CASSANDRA-5966)
  * Upgrade metrics-core to version 2.2.0 (CASSANDRA-5947)
  * Add snitch, schema version, cluster, partitioner to JMX (CASSANDRA-5881)
  * Fix CqlRecordWriter with composite keys (CASSANDRA-5949)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8d6271dd/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java b/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
index 40934d4..df28c46 100644
--- a/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
+++ b/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
@@ -153,7 +153,7 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator
implement
         List<OnDiskAtom> result = new ArrayList<OnDiskAtom>();
         if (indexList.isEmpty())
         {
-            readSimpleColumns(sstable.metadata, file, columns, result);
+            readSimpleColumns(file, columns, result);
         }
         else
         {
@@ -175,37 +175,27 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator
implement
         iter = result.iterator();
     }
 
-    private void readSimpleColumns(CFMetaData metadata,
-                                   FileDataInput file,
-                                   SortedSet<ByteBuffer> columnNames,
-                                   List<OnDiskAtom> result)
-    throws IOException
+    private void readSimpleColumns(FileDataInput file, SortedSet<ByteBuffer> columnNames,
List<OnDiskAtom> result) throws IOException
     {
-        AbstractType<?> comparator = metadata.comparator;
         OnDiskAtom.Serializer atomSerializer = cf.getOnDiskSerializer();
-        ByteBuffer maximalColumnName = columnNames.last();
         int count = file.readInt();
-
+        int n = 0;
         for (int i = 0; i < count; i++)
         {
             OnDiskAtom column = atomSerializer.deserializeFromSSTable(file, sstable.descriptor.version);
-            ByteBuffer columnName = column.name();
-
             if (column instanceof IColumn)
             {
-                if (columnNames.contains(columnName))
+                if (columnNames.contains(column.name()))
                 {
                     result.add(column);
+                    if (++n >= columns.size())
+                        break;
                 }
             }
             else
             {
                 result.add(column);
             }
-
-            // Already consumed all of this block that's going to have columns that apply
to this query.
-            if (comparator.compare(columnName, maximalColumnName) >= 0)
-                break;
         }
     }
 
@@ -241,12 +231,6 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator
implement
         {
             long positionToSeek = basePosition + indexInfo.offset;
 
-            // SortedSet.subSet() is end-exclusive, so we special-case that
-            // if it's one of the columns we're looking for
-            ByteBuffer maximalColumnName = columnNames.contains(indexInfo.lastName)
-                                         ? indexInfo.lastName
-                                         : columnNames.subSet(indexInfo.firstName, indexInfo.lastName).last();
-
             // With new promoted indexes, our first seek in the data file will happen at
that point.
             if (file == null)
                 file = createFileDataInput(positionToSeek);
@@ -254,20 +238,13 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator
implement
             OnDiskAtom.Serializer atomSerializer = cf.getOnDiskSerializer();
             file.seek(positionToSeek);
             FileMark mark = file.mark();
-
             // TODO only completely deserialize columns we are interested in
             while (file.bytesPastMark(mark) < indexInfo.width)
             {
                 OnDiskAtom column = atomSerializer.deserializeFromSSTable(file, sstable.descriptor.version);
-                ByteBuffer columnName = column.name();
-
                 // we check vs the original Set, not the filtered List, for efficiency
-                if (!(column instanceof IColumn) || columnNames.contains(columnName))
+                if (!(column instanceof IColumn) || columnNames.contains(column.name()))
                     result.add(column);
-
-                // Already consumed all of this block that's going to have columns that apply
to this query.
-                if (comparator.compare(columnName, maximalColumnName) >= 0)
-                    break;
             }
         }
     }


Mime
View raw message