cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/4] convert abstract class Filter to IFilter
Date Thu, 01 Nov 2012 16:29:25 GMT
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/BloomFilterTest.java b/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
index 292bca6..bb0865f 100644
--- a/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
+++ b/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
@@ -18,37 +18,36 @@
 */
 package org.apache.cassandra.utils;
 
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-
-import org.apache.cassandra.io.util.DataOutputBuffer;
-import org.apache.cassandra.utils.KeyGenerator.WordGenerator;
 
 import org.junit.Before;
 import org.junit.Test;
 
+import org.apache.cassandra.io.util.DataOutputBuffer;
+
 public class BloomFilterTest
 {
-    public Filter bf;
+    public IFilter bf;
 
     public BloomFilterTest()
     {
         bf = FilterFactory.getFilter(10000L, FilterTestHelper.MAX_FAILURE_RATE, true);
     }
 
-    public static Filter testSerialize(Filter f) throws IOException
+    public static IFilter testSerialize(IFilter f) throws IOException
     {
         f.add(ByteBufferUtil.bytes("a"));
         DataOutputBuffer out = new DataOutputBuffer();
         FilterFactory.serialize(f, out, FilterFactory.Type.MURMUR3);
 
         ByteArrayInputStream in = new ByteArrayInputStream(out.getData(), 0, out.getLength());
-        Filter f2 = FilterFactory.deserialize(new DataInputStream(in), FilterFactory.Type.MURMUR3,
true);
+        IFilter f2 = FilterFactory.deserialize(new DataInputStream(in), FilterFactory.Type.MURMUR3,
true);
 
         assert f2.isPresent(ByteBufferUtil.bytes("a"));
         assert !f2.isPresent(ByteBufferUtil.bytes("b"));
@@ -102,7 +101,7 @@ public class BloomFilterTest
         {
             return;
         }
-        Filter bf2 = FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE,
true);
+        IFilter bf2 = FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE,
true);
         int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
         FilterTestHelper.testFalsePositives(bf2,
                                             new KeyGenerator.WordGenerator(skipEven, 2),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/utils/FilterTestHelper.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/FilterTestHelper.java b/test/unit/org/apache/cassandra/utils/FilterTestHelper.java
index fd6f873..cab7195 100644
--- a/test/unit/org/apache/cassandra/utils/FilterTestHelper.java
+++ b/test/unit/org/apache/cassandra/utils/FilterTestHelper.java
@@ -43,7 +43,7 @@ public class FilterTestHelper
         return new KeyGenerator.RandomStringGenerator(271828, ELEMENTS);
     }
 
-    public static double testFalsePositives(Filter f, ResetableIterator<ByteBuffer>
keys, ResetableIterator<ByteBuffer> otherkeys)
+    public static double testFalsePositives(IFilter f, ResetableIterator<ByteBuffer>
keys, ResetableIterator<ByteBuffer> otherkeys)
     {
         assert keys.size() == otherkeys.size();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java b/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
index d92315b..e7319db 100644
--- a/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
+++ b/test/unit/org/apache/cassandra/utils/LegacyBloomFilterTest.java
@@ -39,7 +39,7 @@ public class LegacyBloomFilterTest
         bf = LegacyBloomFilter.getFilter(FilterTestHelper.ELEMENTS, FilterTestHelper.MAX_FAILURE_RATE);
     }
 
-    public static Filter testSerialize(LegacyBloomFilter f) throws IOException
+    public static IFilter testSerialize(LegacyBloomFilter f) throws IOException
     {
         f.add(ByteBufferUtil.bytes("a"));
         DataOutputBuffer out = new DataOutputBuffer();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/utils/SerializationsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/SerializationsTest.java b/test/unit/org/apache/cassandra/utils/SerializationsTest.java
index 8d5e88a..1a1e9fb 100644
--- a/test/unit/org/apache/cassandra/utils/SerializationsTest.java
+++ b/test/unit/org/apache/cassandra/utils/SerializationsTest.java
@@ -33,7 +33,7 @@ public class SerializationsTest extends AbstractSerializationsTester
 
     private void testBloomFilterWrite(Type murmur, boolean offheap) throws IOException
     {
-        Filter bf = FilterFactory.getFilter(1000000, 0.0001, murmur, offheap);
+        IFilter bf = FilterFactory.getFilter(1000000, 0.0001, murmur, offheap);
         for (int i = 0; i < 100; i++)
             bf.add(StorageService.getPartitioner().getTokenFactory().toByteArray(StorageService.getPartitioner().getRandomToken()));
         DataOutputStream out = getOutput("utils.BloomFilter.bin");


Mime
View raw message