cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject git commit: Fix descriptor versioning for bloom filter changes patch by Vijay; reviewed by jbellis,yuki for CASSANDRA-4203
Date Wed, 02 May 2012 05:12:01 GMT
Updated Branches:
  refs/heads/trunk b51a0d64f -> fb89e2be1


Fix descriptor versioning for bloom filter changes
patch by Vijay; reviewed by jbellis,yuki for CASSANDRA-4203


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

Branch: refs/heads/trunk
Commit: fb89e2be16f45f34c5e355de68003ef20505dd3e
Parents: b51a0d6
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Tue May 1 21:55:15 2012 -0700
Committer: Vijay Parthasarathy <vijay2win@gmail.com>
Committed: Tue May 1 21:55:15 2012 -0700

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/Descriptor.java    |    7 ++++---
 .../org/apache/cassandra/streaming/StreamIn.java   |    2 +-
 .../cassandra/io/sstable/DescriptorTest.java       |    8 ++++----
 3 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb89e2be/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 dff0e98..bac0e5c 100644
--- a/src/java/org/apache/cassandra/io/sstable/Descriptor.java
+++ b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
@@ -56,7 +56,8 @@ public class Descriptor
     // hc (1.0.4): records partitioner in metadata component
     // ia (1.2.0): column indexes are promoted to the index file
     //             records estimated histogram of deletion times in tombstones
-    public static final String CURRENT_VERSION = "ib";
+    //             bloom filter (keys and columns) upgraded to Murmur3
+    public static final String CURRENT_VERSION = "ia";
 
     public final File directory;
     /** version has the following format: <code>[a-z]+</code> */
@@ -110,7 +111,7 @@ public class Descriptor
         isLatestVersion = version.compareTo(CURRENT_VERSION) == 0;
         if (version.compareTo("f") < 0)
             filterType = FilterFactory.Type.SHA;
-        else if (version.compareTo("ia") <= 0)
+        else if (version.compareTo("ia") < 0)
             filterType = FilterFactory.Type.MURMUR2;
         else
             filterType = FilterFactory.Type.MURMUR3;
@@ -235,7 +236,7 @@ public class Descriptor
         // we could add compatibility for earlier versions with the new single-pass streaming
         // (see SSTableWriter.appendFromStream) but versions earlier than 0.7.1 don't have
the
         // MessagingService version awareness anyway so there's no point.
-        return isCompatible() && version.charAt(0) >= 'f';
+        return isCompatible() && version.charAt(0) >= 'i';
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb89e2be/src/java/org/apache/cassandra/streaming/StreamIn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamIn.java b/src/java/org/apache/cassandra/streaming/StreamIn.java
index 6b77714..52d536b 100644
--- a/src/java/org/apache/cassandra/streaming/StreamIn.java
+++ b/src/java/org/apache/cassandra/streaming/StreamIn.java
@@ -81,7 +81,7 @@ public class StreamIn
         // new local sstable
         Table table = Table.open(remotedesc.ksname);
         ColumnFamilyStore cfStore = table.getColumnFamilyStore(remotedesc.cfname);
-        Descriptor localdesc = Descriptor.fromFilename(cfStore.getFlushPath(remote.size,
remote.desc.version));
+        Descriptor localdesc = Descriptor.fromFilename(cfStore.getFlushPath(remote.size,
Descriptor.CURRENT_VERSION));
 
         return new PendingFile(localdesc, remote);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb89e2be/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java b/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
index 6861007..30f298a 100644
--- a/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
@@ -57,12 +57,12 @@ public class DescriptorTest
     @Test
     public void testMurmurBloomFilter()
     {
-        Descriptor desc = Descriptor.fromFilename("Keyspace1-Standard1-ia-1-Data.db");
-        assertEquals("ia", desc.version);
+        Descriptor desc = Descriptor.fromFilename("Keyspace1-Standard1-hz-1-Data.db");
+        assertEquals("hz", desc.version);
         assertEquals(desc.filterType, FilterFactory.Type.MURMUR2);
 
-        desc = Descriptor.fromFilename("Keyspace1-Standard1-ib-1-Data.db");
-        assertEquals("ib", desc.version);
+        desc = Descriptor.fromFilename("Keyspace1-Standard1-ia-1-Data.db");
+        assertEquals("ia", desc.version);
         assertEquals(desc.filterType, FilterFactory.Type.MURMUR3);
     }
 }


Mime
View raw message