cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/7] git commit: IndexHelper.skipBloomFilters won't skip non-SHA filters (backport of patch2 to cassandra-1.2) path by Carl Yekisian; reviewed by jasobrown for CASSANDRA-5385
Date Thu, 04 Apr 2013 17:12:40 GMT
Updated Branches:
  refs/heads/cassandra-1.2 cf84ea718 -> 05a39610d
  refs/heads/trunk a950b9257 -> 2922dbe4b


IndexHelper.skipBloomFilters won't skip non-SHA filters (backport of patch2 to cassandra-1.2)
path by Carl Yekisian; reviewed by jasobrown for CASSANDRA-5385


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

Branch: refs/heads/trunk
Commit: 213063399cee1433ed73b563ba38f91e9374aacf
Parents: 6a03b11
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Wed Apr 3 16:12:54 2013 -0700
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Wed Apr 3 16:14:41 2013 -0700

----------------------------------------------------------------------
 .../db/columniterator/IndexedSliceReader.java      |    2 +-
 .../db/columniterator/SimpleSliceReader.java       |    2 +-
 .../apache/cassandra/io/sstable/Descriptor.java    |    2 ++
 .../apache/cassandra/io/sstable/IndexHelper.java   |   12 ++++++++++++
 .../io/sstable/SSTableIdentityIterator.java        |    4 ++--
 5 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/21306339/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
index 9b34a6a..7289ab0 100644
--- a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
+++ b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
@@ -96,7 +96,7 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements
OnDiskA
             else
             {
                 setToRowStart(sstable, indexEntry, input);
-                IndexHelper.skipBloomFilter(file, version.filterType);
+                IndexHelper.skipSSTableBloomFilter(file, version);
                 this.indexes = IndexHelper.deserializeIndex(file);
                 this.emptyColumnFamily = ColumnFamily.create(sstable.metadata);
                 emptyColumnFamily.delete(DeletionInfo.serializer().deserializeFromSSTable(file,
version));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/21306339/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java b/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
index 132f9cb..b30d360 100644
--- a/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
+++ b/src/java/org/apache/cassandra/db/columniterator/SimpleSliceReader.java
@@ -75,7 +75,7 @@ class SimpleSliceReader extends AbstractIterator<OnDiskAtom> implements
OnDiskAt
             Descriptor.Version version = sstable.descriptor.version;
             if (!version.hasPromotedIndexes)
             {
-                IndexHelper.skipBloomFilter(file, version.filterType);
+                IndexHelper.skipSSTableBloomFilter(file, version);
                 IndexHelper.skipIndex(file);
             }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/21306339/src/java/org/apache/cassandra/io/sstable/Descriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/Descriptor.java b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
index f0709d8..0338044 100644
--- a/src/java/org/apache/cassandra/io/sstable/Descriptor.java
+++ b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
@@ -85,6 +85,7 @@ public class Descriptor
         public final boolean hasPromotedIndexes;
         public final FilterFactory.Type filterType;
         public final boolean hasAncestors;
+        public final boolean hasBloomFilterSizeInHeader;
 
         public Version(String version)
         {
@@ -108,6 +109,7 @@ public class Descriptor
                 filterType = FilterFactory.Type.MURMUR2;
             else
                 filterType = FilterFactory.Type.MURMUR3;
+            hasBloomFilterSizeInHeader = version.compareTo("ia") < 0;
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/21306339/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexHelper.java b/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
index 14b2cda..b81f7b8 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
@@ -36,6 +36,18 @@ import org.apache.cassandra.utils.*;
  */
 public class IndexHelper
 {
+    public static void skipSSTableBloomFilter(DataInput in, Descriptor.Version version) throws
IOException
+    {
+        if (version.hasBloomFilterSizeInHeader)
+        {
+            int size = in.readInt();
+            FileUtils.skipBytesFully(in, size);
+        }
+        else
+        {
+            skipBloomFilter(in, version.filterType);
+        }
+    }
 
     /**
      * Skip the bloom filter

http://git-wip-us.apache.org/repos/asf/cassandra/blob/21306339/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java b/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
index 157ccf8..7583cd6 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
@@ -127,7 +127,7 @@ public class SSTableIdentityIterator implements Comparable<SSTableIdentityIterat
                 {
                     try
                     {
-                        IndexHelper.defreezeBloomFilter(file, dataSize, dataVersion.filterType);
+                        IndexHelper.skipSSTableBloomFilter(file, sstable.descriptor.version);
                     }
                     catch (Exception e)
                     {
@@ -153,7 +153,7 @@ public class SSTableIdentityIterator implements Comparable<SSTableIdentityIterat
 
             if (sstable != null && !dataVersion.hasPromotedIndexes)
             {
-                IndexHelper.skipBloomFilter(inputWithTracker, dataVersion.filterType);
+                IndexHelper.skipSSTableBloomFilter(inputWithTracker, dataVersion);
                 IndexHelper.skipIndex(inputWithTracker);
             }
             columnFamily = ColumnFamily.create(metadata);


Mime
View raw message