cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/4] git commit: convert abstract class Filter to IFilter
Date Thu, 01 Nov 2012 16:29:25 GMT
Updated Branches:
  refs/heads/trunk 82087b83c -> dd4fd2c70


convert abstract class Filter to IFilter


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

Branch: refs/heads/trunk
Commit: a15500e742b7c18804ead7ef338d6fa39b9ba984
Parents: 82087b8
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Sat Oct 27 10:16:25 2012 -0700
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Nov 1 11:29:19 2012 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/cql/QueryProcessor.java   |    8 +-
 .../org/apache/cassandra/cql3/QueryProcessor.java  |    2 +-
 .../cassandra/cql3/statements/SelectStatement.java |    6 +-
 .../org/apache/cassandra/db/BatchlogManager.java   |    4 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   14 +-
 src/java/org/apache/cassandra/db/ColumnIndex.java  |    6 +-
 .../apache/cassandra/db/HintedHandOffManager.java  |    2 +-
 .../org/apache/cassandra/db/RangeSliceCommand.java |   22 ++--
 src/java/org/apache/cassandra/db/ReadCommand.java  |    5 +-
 .../org/apache/cassandra/db/RowIndexEntry.java     |   12 +-
 .../cassandra/db/SliceByNamesReadCommand.java      |    2 +-
 .../apache/cassandra/db/SliceFromReadCommand.java  |   14 +-
 .../db/columniterator/SSTableNamesIterator.java    |    4 +-
 .../apache/cassandra/db/filter/ExtendedFilter.java |   32 ++--
 .../cassandra/db/filter/IDiskAtomFilter.java       |  129 +++++++++++++++
 .../org/apache/cassandra/db/filter/IFilter.java    |  129 ---------------
 .../cassandra/db/filter/NamesQueryFilter.java      |    2 +-
 .../apache/cassandra/db/filter/QueryFilter.java    |    8 +-
 .../cassandra/db/filter/SliceQueryFilter.java      |    2 +-
 .../cassandra/db/index/SecondaryIndexManager.java  |    4 +-
 .../cassandra/db/index/SecondaryIndexSearcher.java |    4 +-
 .../db/index/composites/CompositesSearcher.java    |    2 +-
 .../cassandra/db/index/keys/KeysSearcher.java      |    4 +-
 .../apache/cassandra/io/sstable/IndexHelper.java   |    4 +-
 .../apache/cassandra/io/sstable/SSTableReader.java |    8 +-
 .../apache/cassandra/io/sstable/SSTableWriter.java |    2 +-
 .../cassandra/service/RowRepairResolver.java       |    5 +-
 .../apache/cassandra/thrift/CassandraServer.java   |    9 +-
 .../apache/cassandra/thrift/ThriftValidation.java  |    4 +-
 .../org/apache/cassandra/utils/BloomFilter.java    |    4 +-
 .../cassandra/utils/BloomFilterSerializer.java     |    4 +-
 src/java/org/apache/cassandra/utils/Filter.java    |   37 ----
 .../org/apache/cassandra/utils/FilterFactory.java  |   20 +-
 src/java/org/apache/cassandra/utils/IFilter.java   |   30 ++++
 .../apache/cassandra/utils/LegacyBloomFilter.java  |    3 +-
 .../cassandra/utils/LongBloomFilterTest.java       |    6 +-
 test/unit/org/apache/cassandra/db/CleanupTest.java |    4 +-
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |   18 +-
 .../cassandra/streaming/StreamingTransferTest.java |    4 +-
 .../apache/cassandra/utils/BloomFilterTest.java    |   17 +-
 .../apache/cassandra/utils/FilterTestHelper.java   |    2 +-
 .../cassandra/utils/LegacyBloomFilterTest.java     |    2 +-
 .../apache/cassandra/utils/SerializationsTest.java |    2 +-
 43 files changed, 299 insertions(+), 303 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/cql/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java
index cdfe033..628b94d 100644
--- a/src/java/org/apache/cassandra/cql/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java
@@ -50,8 +50,6 @@ import org.apache.cassandra.thrift.CqlPreparedResult;
 import org.apache.cassandra.thrift.IndexExpression;
 import org.apache.cassandra.thrift.IndexOperator;
 import org.apache.cassandra.thrift.IndexType;
-import org.apache.cassandra.thrift.RequestType;
-import org.apache.cassandra.thrift.SchemaDisagreementException;
 import org.apache.cassandra.thrift.ThriftValidation;
 import org.apache.cassandra.thrift.ThriftClientState;
 import org.apache.cassandra.utils.ByteBufferUtil;
@@ -170,7 +168,7 @@ public class QueryProcessor
         }
         AbstractBounds<RowPosition> bounds = new Bounds<RowPosition>(startKey, finishKey);
 
-        IFilter columnFilter = filterFromSelect(select, metadata, variables);
+        IDiskAtomFilter columnFilter = filterFromSelect(select, metadata, variables);
         validateFilter(metadata, columnFilter);
 
         List<Relation> columnRelations = select.getColumnRelations();
@@ -253,7 +251,7 @@ public class QueryProcessor
         StorageProxy.mutate(rowMutations, consistency);
     }
 
-    private static IFilter filterFromSelect(SelectStatement select, CFMetaData metadata, List<ByteBuffer> variables)
+    private static IDiskAtomFilter filterFromSelect(SelectStatement select, CFMetaData metadata, List<ByteBuffer> variables)
     throws InvalidRequestException
     {
         if (select.isColumnRange() || select.getColumnNames().size() == 0)
@@ -366,7 +364,7 @@ public class QueryProcessor
         }
     }
 
-    private static void validateFilter(CFMetaData metadata, IFilter filter)
+    private static void validateFilter(CFMetaData metadata, IDiskAtomFilter filter)
     throws InvalidRequestException
     {
         if (filter instanceof SliceQueryFilter)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index c1737e8..3342a2c 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -99,7 +99,7 @@ public class QueryProcessor
         validateColumnNames(Collections.singletonList(column));
     }
 
-    public static void validateFilter(CFMetaData metadata, IFilter filter)
+    public static void validateFilter(CFMetaData metadata, IDiskAtomFilter filter)
     throws InvalidRequestException
     {
         if (filter instanceof SliceQueryFilter)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index e70f90a..365d7cb 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -202,7 +202,7 @@ public class SelectStatement implements CQLStatement
         Collection<ByteBuffer> keys = getKeys(variables);
         List<ReadCommand> commands = new ArrayList<ReadCommand>(keys.size());
 
-        IFilter filter = makeFilter(variables);
+        IDiskAtomFilter filter = makeFilter(variables);
         // ...a range (slice) of column names
         if (isColumnRange())
         {
@@ -229,7 +229,7 @@ public class SelectStatement implements CQLStatement
 
     private RangeSliceCommand getRangeCommand(List<ByteBuffer> variables) throws RequestValidationException
     {
-        IFilter filter = makeFilter(variables);
+        IDiskAtomFilter filter = makeFilter(variables);
         List<IndexExpression> expressions = getIndexExpressions(variables);
         // The LIMIT provided by the user is the number of CQL row he wants returned.
         // For NamesQueryFilter, this is the number of internal rows returned, since a NamesQueryFilter can only select one CQL row in a given internal row.
@@ -291,7 +291,7 @@ public class SelectStatement implements CQLStatement
         return bounds;
     }
 
-    private IFilter makeFilter(List<ByteBuffer> variables)
+    private IDiskAtomFilter makeFilter(List<ByteBuffer> variables)
     throws InvalidRequestException
     {
         if (isColumnRange())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/BatchlogManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java
index e2a9c0d..843cf44 100644
--- a/src/java/org/apache/cassandra/db/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/db/BatchlogManager.java
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.compaction.CompactionManager;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.NamesQueryFilter;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
@@ -256,7 +256,7 @@ public class BatchlogManager implements BatchlogManagerMBean
         return CFMetaData.BatchlogCF.getCfDef().getColumnNameBuilder().add(raw).build();
     }
 
-    private static List<Row> getRangeSlice(IFilter columnFilter)
+    private static List<Row> getRangeSlice(IDiskAtomFilter columnFilter)
     {
         ColumnFamilyStore store = Table.open(Table.SYSTEM_KS).getColumnFamilyStore(SystemTable.BATCHLOG_CF);
         IPartitioner partitioner = StorageService.getPartitioner();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index e981a9c..8740c8d 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -34,6 +34,7 @@ import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.Futures;
 
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.cliffc.high_scale_lib.NonBlockingHashMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,7 +54,6 @@ import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.compaction.LeveledCompactionStrategy;
 import org.apache.cassandra.db.compaction.OperationType;
 import org.apache.cassandra.db.filter.ExtendedFilter;
-import org.apache.cassandra.db.filter.IFilter;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.index.SecondaryIndex;
@@ -1374,7 +1374,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
       * @param range Either a Bounds, which includes start key, or a Range, which does not.
       * @param columnFilter description of the columns we're interested in for each row
      */
-    public AbstractScanIterator getSequentialIterator(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, IFilter columnFilter)
+    public AbstractScanIterator getSequentialIterator(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, IDiskAtomFilter columnFilter)
     {
         assert !(range instanceof Range) || !((Range)range).isWrapAround() || range.right.isMinimum() : range;
 
@@ -1431,23 +1431,23 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         }
     }
 
-    public List<Row> getRangeSlice(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, int maxResults, IFilter columnFilter, List<IndexExpression> rowFilter)
+    public List<Row> getRangeSlice(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter columnFilter, List<IndexExpression> rowFilter)
     {
         return getRangeSlice(superColumn, range, maxResults, columnFilter, rowFilter, false, false);
     }
 
-    public List<Row> getRangeSlice(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, int maxResults, IFilter columnFilter, List<IndexExpression> rowFilter, boolean maxIsColumns, boolean isPaging)
+    public List<Row> getRangeSlice(ByteBuffer superColumn, final AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter columnFilter, List<IndexExpression> rowFilter, boolean maxIsColumns, boolean isPaging)
     {
         logger.debug("Executing seq scan for {}..{}", range.left, range.right);
         return filter(getSequentialIterator(superColumn, range, columnFilter), ExtendedFilter.create(this, columnFilter, rowFilter, maxResults, maxIsColumns, isPaging));
     }
 
-    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter)
+    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter)
     {
         return search(clause, range, maxResults, dataFilter, false);
     }
 
-    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
+    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean maxIsColumns)
     {
         logger.debug("Executing indexed scan for {}..{}", range.left, range.right);
         return indexManager.search(clause, range, maxResults, dataFilter, maxIsColumns);
@@ -1469,7 +1469,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
                 if (rowIterator.needsFiltering())
                 {
                     // roughtly
-                    IFilter extraFilter = filter.getExtraFilter(data);
+                    IDiskAtomFilter extraFilter = filter.getExtraFilter(data);
                     if (extraFilter != null)
                     {
                         QueryPath path = new QueryPath(columnFamily);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/ColumnIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnIndex.java b/src/java/org/apache/cassandra/db/ColumnIndex.java
index 946c4f4..55244f6 100644
--- a/src/java/org/apache/cassandra/db/ColumnIndex.java
+++ b/src/java/org/apache/cassandra/db/ColumnIndex.java
@@ -24,13 +24,13 @@ import java.util.*;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.io.sstable.IndexHelper;
-import org.apache.cassandra.utils.Filter;
+import org.apache.cassandra.utils.IFilter;
 import org.apache.cassandra.utils.FilterFactory;
 
 public class ColumnIndex
 {
     public final List<IndexHelper.IndexInfo> columnsIndex;
-    public final Filter bloomFilter;
+    public final IFilter bloomFilter;
 
     private static final ColumnIndex EMPTY = new ColumnIndex(Collections.<IndexHelper.IndexInfo>emptyList(), FilterFactory.emptyFilter());
 
@@ -39,7 +39,7 @@ public class ColumnIndex
         this(new ArrayList<IndexHelper.IndexInfo>(), FilterFactory.getFilter(estimatedColumnCount, 4, false));
     }
 
-    private ColumnIndex(List<IndexHelper.IndexInfo> columnsIndex, Filter bloomFilter)
+    private ColumnIndex(List<IndexHelper.IndexInfo> columnsIndex, IFilter bloomFilter)
     {
         this.columnsIndex = columnsIndex;
         this.bloomFilter = bloomFilter;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 2d88ecc..2b8b59a 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -399,7 +399,7 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
         IPartitioner p = StorageService.getPartitioner();
         RowPosition minPos = p.getMinimumToken().minKeyBound();
         Range<RowPosition> range = new Range<RowPosition>(minPos, minPos, p);
-        IFilter filter = new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of());
+        IDiskAtomFilter filter = new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of());
         List<Row> rows = hintStore.getRangeSlice(null, range, Integer.MAX_VALUE, filter, null);
         for (Row row : rows)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/RangeSliceCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RangeSliceCommand.java b/src/java/org/apache/cassandra/db/RangeSliceCommand.java
index 5e73f3f..b8fdfd6 100644
--- a/src/java/org/apache/cassandra/db/RangeSliceCommand.java
+++ b/src/java/org/apache/cassandra/db/RangeSliceCommand.java
@@ -45,7 +45,7 @@ import java.util.List;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.NamesQueryFilter;
 import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.db.marshal.AbstractType;
@@ -78,7 +78,7 @@ public class RangeSliceCommand implements IReadCommand
     public final String column_family;
     public final ByteBuffer super_column;
 
-    public final IFilter predicate;
+    public final IDiskAtomFilter predicate;
     public final List<IndexExpression> row_filter;
 
     public final AbstractBounds<RowPosition> range;
@@ -86,22 +86,22 @@ public class RangeSliceCommand implements IReadCommand
     public final boolean maxIsColumns;
     public final boolean isPaging;
 
-    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IFilter predicate, AbstractBounds<RowPosition> range, int maxResults)
+    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IDiskAtomFilter predicate, AbstractBounds<RowPosition> range, int maxResults)
     {
         this(keyspace, column_family, super_column, predicate, range, null, maxResults, false, false);
     }
 
-    public RangeSliceCommand(String keyspace, ColumnParent column_parent, IFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults)
+    public RangeSliceCommand(String keyspace, ColumnParent column_parent, IDiskAtomFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults)
     {
         this(keyspace, column_parent.getColumn_family(), column_parent.super_column, predicate, range, row_filter, maxResults, false, false);
     }
 
-    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults)
+    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IDiskAtomFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults)
     {
         this(keyspace, column_family, super_column, predicate, range, row_filter, maxResults, false, false);
     }
 
-    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults, boolean maxIsColumns, boolean isPaging)
+    public RangeSliceCommand(String keyspace, String column_family, ByteBuffer super_column, IDiskAtomFilter predicate, AbstractBounds<RowPosition> range, List<IndexExpression> row_filter, int maxResults, boolean maxIsColumns, boolean isPaging)
     {
         this.keyspace = keyspace;
         this.column_family = column_family;
@@ -179,7 +179,7 @@ public class RangeSliceCommand implements IReadCommand
 class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceCommand>
 {
     // For compatibility with pre-1.2 sake. We should remove at some point.
-    public static SlicePredicate asSlicePredicate(IFilter predicate)
+    public static SlicePredicate asSlicePredicate(IDiskAtomFilter predicate)
     {
         SlicePredicate sp = new SlicePredicate();
         if (predicate instanceof NamesQueryFilter)
@@ -209,7 +209,7 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
         }
         else
         {
-            IFilter.Serializer.instance.serialize(sliceCommand.predicate, dos, version);
+            IDiskAtomFilter.Serializer.instance.serialize(sliceCommand.predicate, dos, version);
         }
 
         if (version >= MessagingService.VERSION_11)
@@ -259,7 +259,7 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
             superColumn = ByteBuffer.wrap(buf);
         }
 
-        IFilter predicate;
+        IDiskAtomFilter predicate;
         AbstractType<?> comparator = ColumnFamily.getComparatorFor(keyspace, columnFamily, superColumn);
         if (version < MessagingService.VERSION_12)
         {
@@ -269,7 +269,7 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
         }
         else
         {
-            predicate = IFilter.Serializer.instance.deserialize(dis, version, comparator);
+            predicate = IDiskAtomFilter.Serializer.instance.deserialize(dis, version, comparator);
         }
 
         List<IndexExpression> rowFilter = null;
@@ -340,7 +340,7 @@ class RangeSliceCommandSerializer implements IVersionedSerializer<RangeSliceComm
         }
         else
         {
-            size += IFilter.Serializer.instance.serializedSize(rsc.predicate, version);
+            size += IDiskAtomFilter.Serializer.instance.serializedSize(rsc.predicate, version);
         }
 
         if (version >= MessagingService.VERSION_11)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/ReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java
index 0a73909..f3494e5 100644
--- a/src/java/org/apache/cassandra/db/ReadCommand.java
+++ b/src/java/org/apache/cassandra/db/ReadCommand.java
@@ -25,7 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.io.IVersionedSerializer;
@@ -33,6 +33,7 @@ import org.apache.cassandra.net.MessageOut;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.service.IReadCommand;
 import org.apache.cassandra.service.RepairCallback;
+import org.apache.cassandra.utils.IFilter;
 
 
 public abstract class ReadCommand implements IReadCommand
@@ -80,7 +81,7 @@ public abstract class ReadCommand implements IReadCommand
 
     public abstract Row getRow(Table table) throws IOException;
 
-    public abstract IFilter filter();
+    public abstract IDiskAtomFilter filter();
 
     protected AbstractType<?> getComparator()
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/RowIndexEntry.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowIndexEntry.java b/src/java/org/apache/cassandra/db/RowIndexEntry.java
index a3701f8..e9f08b2 100644
--- a/src/java/org/apache/cassandra/db/RowIndexEntry.java
+++ b/src/java/org/apache/cassandra/db/RowIndexEntry.java
@@ -27,7 +27,7 @@ import java.util.List;
 import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.io.sstable.IndexHelper;
 import org.apache.cassandra.io.util.FileUtils;
-import org.apache.cassandra.utils.Filter;
+import org.apache.cassandra.utils.IFilter;
 import org.apache.cassandra.utils.FilterFactory;
 
 public class RowIndexEntry
@@ -69,7 +69,7 @@ public class RowIndexEntry
         return Collections.<IndexHelper.IndexInfo>emptyList();
     }
 
-    public Filter bloomFilter()
+    public IFilter bloomFilter()
     {
         throw new UnsupportedOperationException();
     }
@@ -119,7 +119,7 @@ public class RowIndexEntry
                     List<IndexHelper.IndexInfo> columnsIndex = new ArrayList<IndexHelper.IndexInfo>(entries);
                     for (int i = 0; i < entries; i++)
                         columnsIndex.add(IndexHelper.IndexInfo.deserialize(dis));
-                    Filter bf = FilterFactory.deserialize(dis, version.filterType, false);
+                    IFilter bf = FilterFactory.deserialize(dis, version.filterType, false);
                     return new IndexedEntry(position, delInfo, columnsIndex, bf);
                 }
                 else
@@ -157,9 +157,9 @@ public class RowIndexEntry
     {
         private final DeletionInfo deletionInfo;
         private final List<IndexHelper.IndexInfo> columnsIndex;
-        private final Filter bloomFilter;
+        private final IFilter bloomFilter;
 
-        private IndexedEntry(long position, DeletionInfo deletionInfo, List<IndexHelper.IndexInfo> columnsIndex, Filter bloomFilter)
+        private IndexedEntry(long position, DeletionInfo deletionInfo, List<IndexHelper.IndexInfo> columnsIndex, IFilter bloomFilter)
         {
             super(position);
             assert deletionInfo != null;
@@ -182,7 +182,7 @@ public class RowIndexEntry
         }
 
         @Override
-        public Filter bloomFilter()
+        public IFilter bloomFilter()
         {
             return bloomFilter;
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java b/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
index ba149b7..2b3b0b1 100644
--- a/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
@@ -75,7 +75,7 @@ public class SliceByNamesReadCommand extends ReadCommand
                ')';
     }
 
-    public IFilter filter()
+    public IDiskAtomFilter filter()
     {
         return filter;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SliceFromReadCommand.java b/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
index 3fa0b51..d52826b 100644
--- a/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
@@ -17,16 +17,18 @@
  */
 package org.apache.cassandra.db;
 
-import java.io.*;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.db.filter.*;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
+import org.apache.cassandra.db.filter.QueryFilter;
+import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.io.IVersionedSerializer;
 import org.apache.cassandra.service.RepairCallback;
 import org.apache.cassandra.service.StorageService;
@@ -104,7 +106,7 @@ public class SliceFromReadCommand extends ReadCommand
         filter.trim(row.cf, getOriginalRequestedCount());
     }
 
-    public IFilter filter()
+    public IDiskAtomFilter filter()
     {
         return filter;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/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 3ba5143..766c282 100644
--- a/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
+++ b/src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java
@@ -37,7 +37,7 @@ import org.apache.cassandra.io.util.FileDataInput;
 import org.apache.cassandra.io.util.FileMark;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.Filter;
+import org.apache.cassandra.utils.IFilter;
 
 public class SSTableNamesIterator extends SimpleAbstractColumnIterator implements ISSTableColumnIterator
 {
@@ -107,7 +107,7 @@ public class SSTableNamesIterator extends SimpleAbstractColumnIterator implement
     private void read(SSTableReader sstable, FileDataInput file, RowIndexEntry indexEntry)
     throws IOException
     {
-        Filter bf;
+        IFilter bf;
         List<IndexHelper.IndexInfo> indexList;
 
         // If the entry is not indexed or the index is not promoted, read from the row start

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
index 9e49237..89479c9 100644
--- a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
@@ -42,12 +42,12 @@ public abstract class ExtendedFilter
     private static final Logger logger = LoggerFactory.getLogger(ExtendedFilter.class);
 
     public final ColumnFamilyStore cfs;
-    protected final IFilter originalFilter;
+    protected final IDiskAtomFilter originalFilter;
     private final int maxResults;
     private final boolean maxIsColumns;
     private final boolean isPaging;
 
-    public static ExtendedFilter create(ColumnFamilyStore cfs, IFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns, boolean isPaging)
+    public static ExtendedFilter create(ColumnFamilyStore cfs, IDiskAtomFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns, boolean isPaging)
     {
         if (clause == null || clause.isEmpty())
         {
@@ -63,7 +63,7 @@ public abstract class ExtendedFilter
         }
     }
 
-    protected ExtendedFilter(ColumnFamilyStore cfs, IFilter filter, int maxResults, boolean maxIsColumns, boolean isPaging)
+    protected ExtendedFilter(ColumnFamilyStore cfs, IDiskAtomFilter filter, int maxResults, boolean maxIsColumns, boolean isPaging)
     {
         assert cfs != null;
         assert filter != null;
@@ -114,9 +114,9 @@ public abstract class ExtendedFilter
     }
 
     /** The initial filter we'll do our first slice with (either the original or a superset of it) */
-    public abstract IFilter initialFilter();
+    public abstract IDiskAtomFilter initialFilter();
 
-    public IFilter originalFilter()
+    public IDiskAtomFilter originalFilter()
     {
         return originalFilter;
     }
@@ -128,7 +128,7 @@ public abstract class ExtendedFilter
      * @param data the data retrieve by the initial filter
      * @return a filter or null if there can't be any columns we missed with our initial filter (typically if it was a names query, or a slice of the entire row)
      */
-    public abstract IFilter getExtraFilter(ColumnFamily data);
+    public abstract IDiskAtomFilter getExtraFilter(ColumnFamily data);
 
     /**
      * @return data pruned down to the columns originally asked for
@@ -163,9 +163,9 @@ public abstract class ExtendedFilter
     private static class FilterWithClauses extends ExtendedFilter
     {
         protected final List<IndexExpression> clause;
-        protected final IFilter initialFilter;
+        protected final IDiskAtomFilter initialFilter;
 
-        public FilterWithClauses(ColumnFamilyStore cfs, IFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns)
+        public FilterWithClauses(ColumnFamilyStore cfs, IDiskAtomFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns)
         {
             super(cfs, filter, maxResults, maxIsColumns, false);
             assert clause != null;
@@ -174,7 +174,7 @@ public abstract class ExtendedFilter
         }
 
         /** Sets up the initial filter. */
-        protected IFilter computeInitialFilter()
+        protected IDiskAtomFilter computeInitialFilter()
         {
             if (originalFilter instanceof SliceQueryFilter)
             {
@@ -207,7 +207,7 @@ public abstract class ExtendedFilter
             return originalFilter;
         }
 
-        public IFilter initialFilter()
+        public IDiskAtomFilter initialFilter()
         {
             return initialFilter;
         }
@@ -246,7 +246,7 @@ public abstract class ExtendedFilter
             return false;
         }
 
-        public IFilter getExtraFilter(ColumnFamily data)
+        public IDiskAtomFilter getExtraFilter(ColumnFamily data)
         {
             if (!needsExtraQuery(data))
                 return null;
@@ -294,7 +294,7 @@ public abstract class ExtendedFilter
 
     private static class FilterWithCompositeClauses extends FilterWithClauses
     {
-        public FilterWithCompositeClauses(ColumnFamilyStore cfs, IFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns)
+        public FilterWithCompositeClauses(ColumnFamilyStore cfs, IDiskAtomFilter filter, List<IndexExpression> clause, int maxResults, boolean maxIsColumns)
         {
             super(cfs, filter, clause, maxResults, maxIsColumns);
         }
@@ -307,7 +307,7 @@ public abstract class ExtendedFilter
          * expect to know the limit set by the user, so create a fake filter
          * with only the count information.
          */
-        protected IFilter computeInitialFilter()
+        protected IDiskAtomFilter computeInitialFilter()
         {
             int limit = originalFilter instanceof SliceQueryFilter
                       ? ((SliceQueryFilter)originalFilter).count
@@ -318,12 +318,12 @@ public abstract class ExtendedFilter
 
     private static class EmptyClauseFilter extends ExtendedFilter
     {
-        public EmptyClauseFilter(ColumnFamilyStore cfs, IFilter filter, int maxResults, boolean maxIsColumns, boolean isPaging)
+        public EmptyClauseFilter(ColumnFamilyStore cfs, IDiskAtomFilter filter, int maxResults, boolean maxIsColumns, boolean isPaging)
         {
             super(cfs, filter, maxResults, maxIsColumns, isPaging);
         }
 
-        public IFilter initialFilter()
+        public IDiskAtomFilter initialFilter()
         {
             return originalFilter;
         }
@@ -333,7 +333,7 @@ public abstract class ExtendedFilter
             throw new UnsupportedOperationException();
         }
 
-        public IFilter getExtraFilter(ColumnFamily data)
+        public IDiskAtomFilter getExtraFilter(ColumnFamily data)
         {
             return null;
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/IDiskAtomFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/IDiskAtomFilter.java b/src/java/org/apache/cassandra/db/filter/IDiskAtomFilter.java
new file mode 100644
index 0000000..9805659
--- /dev/null
+++ b/src/java/org/apache/cassandra/db/filter/IDiskAtomFilter.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.db.filter;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.Iterator;
+
+import org.apache.cassandra.db.*;
+import org.apache.cassandra.db.columniterator.ISSTableColumnIterator;
+import org.apache.cassandra.db.columniterator.OnDiskAtomIterator;
+import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.io.IVersionedSerializer;
+import org.apache.cassandra.io.sstable.SSTableReader;
+import org.apache.cassandra.io.util.FileDataInput;
+
+/**
+ * Given an implementation-specific description of what columns to look for, provides methods
+ * to extract the desired columns from a Memtable, SSTable, or SuperColumn.  Either the get*ColumnIterator
+ * methods will be called, or filterSuperColumn, but not both on the same object.  QueryFilter
+ * takes care of putting the two together if subcolumn filtering needs to be done, based on the
+ * querypath that it knows (but that IFilter implementations are oblivious to).
+ */
+public interface IDiskAtomFilter
+{
+    /**
+     * returns an iterator that returns columns from the given memtable
+     * matching the Filter criteria in sorted order.
+     */
+    public abstract OnDiskAtomIterator getMemtableColumnIterator(ColumnFamily cf, DecoratedKey key);
+
+    /**
+     * Get an iterator that returns columns from the given SSTable using the opened file
+     * matching the Filter criteria in sorted order.
+     * @param sstable
+     * @param file Already opened file data input, saves us opening another one
+     * @param key The key of the row we are about to iterate over
+     */
+    public abstract ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry);
+
+    /**
+     * returns an iterator that returns columns from the given SSTable
+     * matching the Filter criteria in sorted order.
+     */
+    public abstract ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable, DecoratedKey key);
+
+    /**
+     * collects columns from reducedColumns into returnCF.  Termination is determined
+     * by the filter code, which should have some limit on the number of columns
+     * to avoid running out of memory on large rows.
+     */
+    public abstract void collectReducedColumns(IColumnContainer container, Iterator<IColumn> reducedColumns, int gcBefore);
+
+    /**
+     * subcolumns of a supercolumn are unindexed, so to pick out parts of those we operate in-memory.
+     * @param superColumn may be modified by filtering op.
+     */
+    public abstract SuperColumn filterSuperColumn(SuperColumn superColumn, int gcBefore);
+
+    public Comparator<IColumn> getColumnComparator(AbstractType<?> comparator);
+
+    public boolean isReversed();
+    public void updateColumnsLimit(int newLimit);
+
+    public static class Serializer implements IVersionedSerializer<IDiskAtomFilter>
+    {
+        public static Serializer instance = new Serializer();
+
+        public void serialize(IDiskAtomFilter filter, DataOutput dos, int version) throws IOException
+        {
+            if (filter instanceof SliceQueryFilter)
+            {
+                dos.writeByte(0);
+                SliceQueryFilter.serializer.serialize((SliceQueryFilter)filter, dos, version);
+            }
+            else
+            {
+                dos.writeByte(1);
+                NamesQueryFilter.serializer.serialize((NamesQueryFilter)filter, dos, version);
+            }
+        }
+
+        public IDiskAtomFilter deserialize(DataInput dis, int version) throws IOException
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public IDiskAtomFilter deserialize(DataInput dis, int version, AbstractType<?> comparator) throws IOException
+        {
+            int type = dis.readByte();
+            if (type == 0)
+            {
+                return SliceQueryFilter.serializer.deserialize(dis, version);
+            }
+            else
+            {
+                assert type == 1;
+                return NamesQueryFilter.serializer.deserialize(dis, version, comparator);
+            }
+        }
+
+        public long serializedSize(IDiskAtomFilter filter, int version)
+        {
+            int size = 1;
+            if (filter instanceof SliceQueryFilter)
+                size += SliceQueryFilter.serializer.serializedSize((SliceQueryFilter)filter, version);
+            else
+                size += NamesQueryFilter.serializer.serializedSize((NamesQueryFilter)filter, version);
+            return size;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/IFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/IFilter.java b/src/java/org/apache/cassandra/db/filter/IFilter.java
deleted file mode 100644
index 309461f..0000000
--- a/src/java/org/apache/cassandra/db/filter/IFilter.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.db.filter;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Comparator;
-import java.util.Iterator;
-
-import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.columniterator.ISSTableColumnIterator;
-import org.apache.cassandra.db.columniterator.OnDiskAtomIterator;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.io.IVersionedSerializer;
-import org.apache.cassandra.io.sstable.SSTableReader;
-import org.apache.cassandra.io.util.FileDataInput;
-
-/**
- * Given an implementation-specific description of what columns to look for, provides methods
- * to extract the desired columns from a Memtable, SSTable, or SuperColumn.  Either the get*ColumnIterator
- * methods will be called, or filterSuperColumn, but not both on the same object.  QueryFilter
- * takes care of putting the two together if subcolumn filtering needs to be done, based on the
- * querypath that it knows (but that IFilter implementations are oblivious to).
- */
-public interface IFilter
-{
-    /**
-     * returns an iterator that returns columns from the given memtable
-     * matching the Filter criteria in sorted order.
-     */
-    public abstract OnDiskAtomIterator getMemtableColumnIterator(ColumnFamily cf, DecoratedKey key);
-
-    /**
-     * Get an iterator that returns columns from the given SSTable using the opened file
-     * matching the Filter criteria in sorted order.
-     * @param sstable
-     * @param file Already opened file data input, saves us opening another one
-     * @param key The key of the row we are about to iterate over
-     */
-    public abstract ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry);
-
-    /**
-     * returns an iterator that returns columns from the given SSTable
-     * matching the Filter criteria in sorted order.
-     */
-    public abstract ISSTableColumnIterator getSSTableColumnIterator(SSTableReader sstable, DecoratedKey key);
-
-    /**
-     * collects columns from reducedColumns into returnCF.  Termination is determined
-     * by the filter code, which should have some limit on the number of columns
-     * to avoid running out of memory on large rows.
-     */
-    public abstract void collectReducedColumns(IColumnContainer container, Iterator<IColumn> reducedColumns, int gcBefore);
-
-    /**
-     * subcolumns of a supercolumn are unindexed, so to pick out parts of those we operate in-memory.
-     * @param superColumn may be modified by filtering op.
-     */
-    public abstract SuperColumn filterSuperColumn(SuperColumn superColumn, int gcBefore);
-
-    public Comparator<IColumn> getColumnComparator(AbstractType<?> comparator);
-
-    public boolean isReversed();
-    public void updateColumnsLimit(int newLimit);
-
-    public static class Serializer implements IVersionedSerializer<IFilter>
-    {
-        public static Serializer instance = new Serializer();
-
-        public void serialize(IFilter filter, DataOutput dos, int version) throws IOException
-        {
-            if (filter instanceof SliceQueryFilter)
-            {
-                dos.writeByte(0);
-                SliceQueryFilter.serializer.serialize((SliceQueryFilter)filter, dos, version);
-            }
-            else
-            {
-                dos.writeByte(1);
-                NamesQueryFilter.serializer.serialize((NamesQueryFilter)filter, dos, version);
-            }
-        }
-
-        public IFilter deserialize(DataInput dis, int version) throws IOException
-        {
-            throw new UnsupportedOperationException();
-        }
-
-        public IFilter deserialize(DataInput dis, int version, AbstractType<?> comparator) throws IOException
-        {
-            int type = dis.readByte();
-            if (type == 0)
-            {
-                return SliceQueryFilter.serializer.deserialize(dis, version);
-            }
-            else
-            {
-                assert type == 1;
-                return NamesQueryFilter.serializer.deserialize(dis, version, comparator);
-            }
-        }
-
-        public long serializedSize(IFilter filter, int version)
-        {
-            int size = 1;
-            if (filter instanceof SliceQueryFilter)
-                size += SliceQueryFilter.serializer.serializedSize((SliceQueryFilter)filter, version);
-            else
-                size += NamesQueryFilter.serializer.serializedSize((NamesQueryFilter)filter, version);
-            return size;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
index fb8c3aa..a347926 100644
--- a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
@@ -39,7 +39,7 @@ import org.apache.cassandra.io.util.FileDataInput;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
-public class NamesQueryFilter implements IFilter
+public class NamesQueryFilter implements IDiskAtomFilter
 {
     public static final Serializer serializer = new Serializer();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/QueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/QueryFilter.java b/src/java/org/apache/cassandra/db/filter/QueryFilter.java
index 6d073c1..31b9db7 100644
--- a/src/java/org/apache/cassandra/db/filter/QueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/QueryFilter.java
@@ -34,10 +34,10 @@ public class QueryFilter
 {
     public final DecoratedKey key;
     public final QueryPath path;
-    public final IFilter filter;
-    private final IFilter superFilter;
+    public final IDiskAtomFilter filter;
+    private final IDiskAtomFilter superFilter;
 
-    public QueryFilter(DecoratedKey key, QueryPath path, IFilter filter)
+    public QueryFilter(DecoratedKey key, QueryPath path, IDiskAtomFilter filter)
     {
         this.key = key;
         this.path = path;
@@ -87,7 +87,7 @@ public class QueryFilter
     // TODO move gcBefore into a field
     public void collateColumns(final ColumnFamily returnCF, List<? extends CloseableIterator<IColumn>> toCollate, final int gcBefore)
     {
-        IFilter topLevelFilter = (superFilter == null ? filter : superFilter);
+        IDiskAtomFilter topLevelFilter = (superFilter == null ? filter : superFilter);
 
         Comparator<IColumn> fcomp = topLevelFilter.getColumnComparator(returnCF.getComparator());
         // define a 'reduced' iterator that merges columns w/ the same name, which

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
index acc7855..75b881b 100644
--- a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
@@ -37,7 +37,7 @@ import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.util.FileDataInput;
 import org.apache.cassandra.net.MessagingService;
 
-public class SliceQueryFilter implements IFilter
+public class SliceQueryFilter implements IDiskAtomFilter
 {
     private static final Logger logger = LoggerFactory.getLogger(SliceQueryFilter.class);
     public static final Serializer serializer = new Serializer();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
index f7d1c92..5a3da59 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
@@ -29,10 +29,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.ColumnDefinition;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.compaction.CompactionManager;
-import org.apache.cassandra.db.filter.IFilter;
 import org.apache.cassandra.dht.AbstractBounds;
 import org.apache.cassandra.io.sstable.ReducingKeyIterator;
 import org.apache.cassandra.io.sstable.SSTableReader;
@@ -534,7 +534,7 @@ public class SecondaryIndexManager
      * @param dataFilter the column range to restrict to
      * @return found indexed rows
      */
-    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
+    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean maxIsColumns)
     {
         List<SecondaryIndexSearcher> indexSearchers = getIndexSearchersForQuery(clause);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
index 6140a01..d49169c 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
@@ -21,7 +21,7 @@ import java.nio.ByteBuffer;
 import java.util.*;
 
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.dht.AbstractBounds;
 import org.apache.cassandra.thrift.IndexExpression;
 
@@ -38,7 +38,7 @@ public abstract class SecondaryIndexSearcher
         this.baseCfs = indexManager.baseCfs;
     }
 
-    public abstract List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns);
+    public abstract List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean maxIsColumns);
 
     /**
      * @return true this index is able to handle given clauses.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index 9b37ae3..8327154 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -77,7 +77,7 @@ public class CompositesSearcher extends SecondaryIndexSearcher
     }
 
     @Override
-    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
+    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean maxIsColumns)
     {
         assert clause != null && !clause.isEmpty();
         ExtendedFilter filter = ExtendedFilter.create(baseCfs, dataFilter, clause, maxResults, maxIsColumns, false);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
index 4bd2b39..5d7adfe 100644
--- a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
@@ -83,7 +83,7 @@ public class KeysSearcher extends SecondaryIndexSearcher
     }
 
     @Override
-    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
+    public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IDiskAtomFilter dataFilter, boolean maxIsColumns)
     {
         assert clause != null && !clause.isEmpty();
         ExtendedFilter filter = ExtendedFilter.create(baseCfs, dataFilter, clause, maxResults, maxIsColumns, false);
@@ -201,7 +201,7 @@ public class KeysSearcher extends SecondaryIndexSearcher
 
                         // as in CFS.filter - extend the filter to ensure we include the columns 
                         // from the index expressions, just in case they weren't included in the initialFilter
-                        IFilter extraFilter = filter.getExtraFilter(data);
+                        IDiskAtomFilter extraFilter = filter.getExtraFilter(data);
                         if (extraFilter != null)
                         {
                             ColumnFamily cf = baseCfs.getColumnFamily(new QueryFilter(dk, path, extraFilter));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/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 a87ecf7..d01c45d 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexHelper.java
@@ -105,7 +105,7 @@ public class IndexHelper
         return indexList;
     }
 
-    public static Filter defreezeBloomFilter(FileDataInput file, FilterFactory.Type type) throws IOException
+    public static IFilter defreezeBloomFilter(FileDataInput file, FilterFactory.Type type) throws IOException
     {
         return defreezeBloomFilter(file, Integer.MAX_VALUE, type);
     }
@@ -122,7 +122,7 @@ public class IndexHelper
      * Guarantees that file's current position will be just after the bloom filter, even if
      * the filter cannot be deserialized, UNLESS EOFException is thrown.
      */
-    public static Filter defreezeBloomFilter(FileDataInput file, long maxSize, FilterFactory.Type type) throws IOException
+    public static IFilter defreezeBloomFilter(FileDataInput file, long maxSize, FilterFactory.Type type) throws IOException
     {
         int size = file.readInt();
         if (size > maxSize || size <= 0)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 812a475..da0e457 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@ -82,7 +82,7 @@ public class SSTableReader extends SSTable
     private SegmentedFile dfile;
 
     private IndexSummary indexSummary;
-    private Filter bf;
+    private IFilter bf;
 
     private InstrumentingCache<KeyCacheKey, RowIndexEntry> keyCache;
 
@@ -271,7 +271,7 @@ public class SSTableReader extends SSTable
                                       SegmentedFile ifile,
                                       SegmentedFile dfile,
                                       IndexSummary isummary,
-                                      Filter bf,
+                                      IFilter bf,
                                       long maxDataAge,
                                       SSTableMetadata sstableMetadata)
     {
@@ -294,7 +294,7 @@ public class SSTableReader extends SSTable
                           SegmentedFile ifile,
                           SegmentedFile dfile,
                           IndexSummary indexSummary,
-                          Filter bloomFilter,
+                          IFilter bloomFilter,
                           long maxDataAge,
                           SSTableMetadata sstableMetadata)
     {
@@ -514,7 +514,7 @@ public class SSTableReader extends SSTable
         bf = LegacyBloomFilter.alwaysMatchingBloomFilter();
     }
 
-    public Filter getBloomFilter()
+    public IFilter getBloomFilter()
     {
       return bf;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
index 2627a77..ad0421a 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
@@ -428,7 +428,7 @@ public class SSTableWriter extends SSTable
         private final SequentialWriter indexFile;
         public final SegmentedFile.Builder builder;
         public final IndexSummary summary;
-        public final Filter bf;
+        public final IFilter bf;
         private FileMark mark;
 
         IndexWriter(long keyCount)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/service/RowRepairResolver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/RowRepairResolver.java b/src/java/org/apache/cassandra/service/RowRepairResolver.java
index 2c6fe1e..975b204 100644
--- a/src/java/org/apache/cassandra/service/RowRepairResolver.java
+++ b/src/java/org/apache/cassandra/service/RowRepairResolver.java
@@ -28,7 +28,7 @@ import com.google.common.collect.Iterables;
 
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.filter.SliceQueryFilter;
@@ -38,6 +38,7 @@ import org.apache.cassandra.net.MessageOut;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.utils.CloseableIterator;
 import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.IFilter;
 
 public class RowRepairResolver extends AbstractRowResolver
 {
@@ -45,7 +46,7 @@ public class RowRepairResolver extends AbstractRowResolver
     public List<IAsyncResult> repairResults = Collections.emptyList();
     private final SliceQueryFilter filter; // can be null if names query
 
-    public RowRepairResolver(String table, ByteBuffer key, IFilter qFilter)
+    public RowRepairResolver(String table, ByteBuffer key, IDiskAtomFilter qFilter)
     {
         super(key, table);
         this.filter = qFilter instanceof SliceQueryFilter ? (SliceQueryFilter)qFilter : null;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index ea26d46..980b740 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -30,6 +30,8 @@ import com.google.common.base.Joiner;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.utils.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,7 +45,6 @@ import org.apache.cassandra.cql.CQLStatement;
 import org.apache.cassandra.cql.QueryProcessor;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.context.CounterContext;
-import org.apache.cassandra.db.filter.IFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.MarshalException;
 import org.apache.cassandra.db.marshal.TimeUUIDType;
@@ -953,7 +954,7 @@ public class CassandraServer implements Cassandra.Iface
             schedule(DatabaseDescriptor.getRangeRpcTimeout());
             try
             {
-                IFilter filter = ThriftValidation.asIFilter(predicate,
+                IDiskAtomFilter filter = ThriftValidation.asIFilter(predicate,
                         metadata.getComparatorFor(column_parent.super_column));
                 rows = StorageProxy.getRangeSlice(new RangeSliceCommand(keyspace, column_parent, filter, bounds,
                         range.row_filter, range.count), consistencyLevel);
@@ -1044,7 +1045,7 @@ public class CassandraServer implements Cassandra.Iface
             schedule(DatabaseDescriptor.getRangeRpcTimeout());
             try
             {
-                IFilter filter = ThriftValidation.asIFilter(predicate, metadata.comparator);
+                IDiskAtomFilter filter = ThriftValidation.asIFilter(predicate, metadata.comparator);
                 rows = StorageProxy.getRangeSlice(new RangeSliceCommand(keyspace, column_family, null, filter,
                         bounds, range.row_filter, range.count, true, true), consistencyLevel);
             }
@@ -1125,7 +1126,7 @@ public class CassandraServer implements Cassandra.Iface
             AbstractBounds<RowPosition> bounds = new Bounds<RowPosition>(RowPosition.forKey(index_clause.start_key, p),
                     p.getMinimumToken().minKeyBound());
 
-            IFilter filter = ThriftValidation.asIFilter(column_predicate,
+            IDiskAtomFilter filter = ThriftValidation.asIFilter(column_predicate,
                     metadata.getComparatorFor(column_parent.super_column));
             RangeSliceCommand command = new RangeSliceCommand(keyspace,
                     column_parent.column_family,

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/thrift/ThriftValidation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftValidation.java b/src/java/org/apache/cassandra/thrift/ThriftValidation.java
index f40dee1..3912e82 100644
--- a/src/java/org/apache/cassandra/thrift/ThriftValidation.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftValidation.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.*;
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.NamesQueryFilter;
 import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.db.index.SecondaryIndexManager;
@@ -577,7 +577,7 @@ public class ThriftValidation
             throw new org.apache.cassandra.exceptions.InvalidRequestException("system keyspace is not user-modifiable");
     }
 
-    public static IFilter asIFilter(SlicePredicate sp, AbstractType<?> comparator)
+    public static IDiskAtomFilter asIFilter(SlicePredicate sp, AbstractType<?> comparator)
     {
         SliceRange sr = sp.slice_range;
         if (sr == null)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/BloomFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/BloomFilter.java b/src/java/org/apache/cassandra/utils/BloomFilter.java
index 469763a..b134b3c 100644
--- a/src/java/org/apache/cassandra/utils/BloomFilter.java
+++ b/src/java/org/apache/cassandra/utils/BloomFilter.java
@@ -22,9 +22,10 @@ import java.nio.ByteBuffer;
 
 import org.apache.cassandra.utils.obs.IBitSet;
 
-public abstract class BloomFilter extends Filter
+public abstract class BloomFilter implements IFilter
 {
     public final IBitSet bitset;
+    public final int hashCount;
 
     BloomFilter(int hashes, IBitSet bitset)
     {
@@ -80,7 +81,6 @@ public abstract class BloomFilter extends Filter
         bitset.clear();
     }
 
-    @Override
     public void close() throws IOException
     {
         bitset.close();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java b/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
index 6b8b355..b966c4d 100644
--- a/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
+++ b/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
@@ -31,7 +31,7 @@ abstract class BloomFilterSerializer implements ISerializer<BloomFilter>
 {
     public void serialize(BloomFilter bf, DataOutput dos) throws IOException
     {
-        dos.writeInt(bf.getHashCount());
+        dos.writeInt(bf.hashCount);
         bf.bitset.serialize(dos);
     }
 
@@ -59,7 +59,7 @@ abstract class BloomFilterSerializer implements ISerializer<BloomFilter>
      */
     public long serializedSize(BloomFilter bf, TypeSizes typeSizes)
     {
-        int size = typeSizes.sizeof(bf.getHashCount()); // hash count
+        int size = typeSizes.sizeof(bf.hashCount); // hash count
         size += bf.bitset.serializedSize(typeSizes);
         return size;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/Filter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/Filter.java b/src/java/org/apache/cassandra/utils/Filter.java
deleted file mode 100644
index ea98401..0000000
--- a/src/java/org/apache/cassandra/utils/Filter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.utils;
-
-import java.io.Closeable;
-import java.nio.ByteBuffer;
-
-public abstract class Filter implements Closeable
-{
-    int hashCount;
-
-    int getHashCount()
-    {
-        return hashCount;
-    }
-
-    public abstract void add(ByteBuffer key);
-
-    public abstract boolean isPresent(ByteBuffer key);
-
-    public abstract void clear();
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/FilterFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FilterFactory.java b/src/java/org/apache/cassandra/utils/FilterFactory.java
index 3eae519..a947a2f 100644
--- a/src/java/org/apache/cassandra/utils/FilterFactory.java
+++ b/src/java/org/apache/cassandra/utils/FilterFactory.java
@@ -40,12 +40,12 @@ public class FilterFactory
         SHA, MURMUR2, MURMUR3
     }
 
-    public static void serialize(Filter bf, DataOutput output) throws IOException
+    public static void serialize(IFilter bf, DataOutput output) throws IOException
     {
         serialize(bf, output, Type.MURMUR3);
     }
 
-    public static void serialize(Filter bf, DataOutput output, Type type) throws IOException
+    public static void serialize(IFilter bf, DataOutput output, Type type) throws IOException
     {
         switch (type)
         {
@@ -61,7 +61,7 @@ public class FilterFactory
         }
     }
 
-    public static Filter deserialize(DataInput input, Type type, boolean offheap) throws IOException
+    public static IFilter deserialize(DataInput input, Type type, boolean offheap) throws IOException
     {
         switch (type)
         {
@@ -74,12 +74,12 @@ public class FilterFactory
         }
     }
 
-    public static long serializedSize(Filter bf)
+    public static long serializedSize(IFilter bf)
     {
         return serializedSize(bf, Type.MURMUR3);
     }
 
-    public static long serializedSize(Filter bf, Type type)
+    public static long serializedSize(IFilter bf, Type type)
     {
         switch (type)
         {
@@ -96,13 +96,13 @@ public class FilterFactory
      * @return A BloomFilter with the lowest practical false positive
      *         probability for the given number of elements.
      */
-    public static Filter getFilter(long numElements, int targetBucketsPerElem, boolean offheap)
+    public static IFilter getFilter(long numElements, int targetBucketsPerElem, boolean offheap)
     {
         return getFilter(numElements, targetBucketsPerElem, Type.MURMUR3, offheap);
     }
 
     // helper method for test.
-    static Filter getFilter(long numElements, int targetBucketsPerElem, Type type, boolean offheap)
+    static IFilter getFilter(long numElements, int targetBucketsPerElem, Type type, boolean offheap)
     {
         int maxBucketsPerElement = Math.max(1, BloomCalculations.maxBucketsPerElement(numElements));
         int bucketsPerElement = Math.min(targetBucketsPerElem, maxBucketsPerElement);
@@ -121,13 +121,13 @@ public class FilterFactory
      *         Asserts that the given probability can be satisfied using this
      *         filter.
      */
-    public static Filter getFilter(long numElements, double maxFalsePosProbability, boolean offheap)
+    public static IFilter getFilter(long numElements, double maxFalsePosProbability, boolean offheap)
     {
         return getFilter(numElements, maxFalsePosProbability, Type.MURMUR3, offheap);
     }
 
     // helper method for test.
-    static Filter getFilter(long numElements, double maxFalsePosProbability, Type type, boolean offheap)
+    static IFilter getFilter(long numElements, double maxFalsePosProbability, Type type, boolean offheap)
     {
         assert maxFalsePosProbability <= 1.0 : "Invalid probability";
         int bucketsPerElement = BloomCalculations.maxBucketsPerElement(numElements);
@@ -135,7 +135,7 @@ public class FilterFactory
         return createFilter(spec.K, numElements, spec.bucketsPerElement, type, offheap);
     }
 
-    private static Filter createFilter(int hash, long numElements, int bucketsPer, Type type, boolean offheap)
+    private static IFilter createFilter(int hash, long numElements, int bucketsPer, Type type, boolean offheap)
     {
         long numBits = (numElements * bucketsPer) + BITSET_EXCESS;
         IBitSet bitset = offheap ? new OffHeapBitSet(numBits) : new OpenBitSet(numBits);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/IFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/IFilter.java b/src/java/org/apache/cassandra/utils/IFilter.java
new file mode 100644
index 0000000..5e88155
--- /dev/null
+++ b/src/java/org/apache/cassandra/utils/IFilter.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.utils;
+
+import java.io.Closeable;
+import java.nio.ByteBuffer;
+
+public interface IFilter extends Closeable
+{
+    public abstract void add(ByteBuffer key);
+
+    public abstract boolean isPresent(ByteBuffer key);
+
+    public abstract void clear();
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java b/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
index a50e2c8..f664f66 100644
--- a/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
+++ b/src/java/org/apache/cassandra/utils/LegacyBloomFilter.java
@@ -24,13 +24,14 @@ import java.util.BitSet;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class LegacyBloomFilter extends Filter
+public class LegacyBloomFilter implements IFilter
 {
     private static final int EXCESS = 20;
     private static final Logger logger = LoggerFactory.getLogger(LegacyBloomFilter.class);
     public static final LegacyBloomFilterSerializer serializer = new LegacyBloomFilterSerializer();
 
     private BitSet filter;
+    private final int hashCount;
 
     LegacyBloomFilter(int hashes, BitSet filter)
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
----------------------------------------------------------------------
diff --git a/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java b/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
index 06ad642..94caa97 100644
--- a/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
+++ b/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
@@ -34,7 +34,7 @@ public class LongBloomFilterTest
     public void testBigInt(FilterFactory.Type type)
     {
         int size = 10 * 1000 * 1000;
-        Filter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
+        IFilter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
         double fp = FilterTestHelper.testFalsePositives(bf, new KeyGenerator.IntGenerator(size),
                                                             new KeyGenerator.IntGenerator(size, size * 2));
         logger.info("Bloom filter false positive: {}", fp);
@@ -43,7 +43,7 @@ public class LongBloomFilterTest
     public void testBigRandom(FilterFactory.Type type)
     {
         int size = 10 * 1000 * 1000;
-        Filter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
+        IFilter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
         double fp = FilterTestHelper.testFalsePositives(bf, new KeyGenerator.RandomStringGenerator(new Random().nextInt(), size),
                                                             new KeyGenerator.RandomStringGenerator(new Random().nextInt(), size));
         logger.info("Bloom filter false positive: {}", fp);
@@ -52,7 +52,7 @@ public class LongBloomFilterTest
     public void timeit(FilterFactory.Type type)
     {
         int size = 300 * FilterTestHelper.ELEMENTS;
-        Filter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
+        IFilter bf = FilterFactory.getFilter(size, FilterTestHelper.spec.bucketsPerElement, type, false);
         double sumfp = 0;
         for (int i = 0; i < 10; i++)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/db/CleanupTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/CleanupTest.java b/test/unit/org/apache/cassandra/db/CleanupTest.java
index ef598bb..5872407 100644
--- a/test/unit/org/apache/cassandra/db/CleanupTest.java
+++ b/test/unit/org/apache/cassandra/db/CleanupTest.java
@@ -29,10 +29,10 @@ import java.util.concurrent.ExecutionException;
 
 import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.Util;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
 import org.apache.cassandra.db.compaction.CompactionManager;
-import org.apache.cassandra.db.filter.IFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.index.SecondaryIndex;
 import org.apache.cassandra.dht.BytesToken;
@@ -112,7 +112,7 @@ public class CleanupTest extends SchemaLoader
         // verify we get it back w/ index query too
         IndexExpression expr = new IndexExpression(COLUMN, IndexOperator.EQ, VALUE);
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         rows = table.getColumnFamilyStore(CF1).search(clause, range, Integer.MAX_VALUE, filter);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
index f8dafc4..625d25f 100644
--- a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
+++ b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
@@ -209,7 +209,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         // basic single-expression query
         IndexExpression expr = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = Table.open("Keyspace1").getColumnFamilyStore("Indexed1").search(clause, range, 100, filter);
@@ -278,7 +278,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         IndexExpression expr = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(34L));
         IndexExpression expr2 = new IndexExpression(ByteBufferUtil.bytes("notbirthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(expr, expr2);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = Table.open("Keyspace1").getColumnFamilyStore("Indexed1").search(clause, range, 100, filter);
@@ -304,7 +304,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
 
         IndexExpression expr = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = cfs.search(clause, range, 100, filter);
@@ -403,7 +403,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
 
         IndexExpression expr = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = table.getColumnFamilyStore("Indexed1").search(clause, range, 100, filter);
@@ -448,7 +448,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         rm.apply();
         IndexExpression expr = new IndexExpression(colName, IndexOperator.EQ, val1);
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = table.getColumnFamilyStore(cfName).search(clause, range, 100, filter);
         assertEquals(1, rows.size());
@@ -520,7 +520,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         // test that the index query fetches this version
         IndexExpression expr = new IndexExpression(colName, IndexOperator.EQ, val1);
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = table.getColumnFamilyStore(cfName).search(clause, range, 100, filter);
         assertEquals(1, rows.size());
@@ -593,7 +593,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         IndexExpression expr1 = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         IndexExpression expr2 = new IndexExpression(ByteBufferUtil.bytes("notbirthdate"), IndexOperator.GT, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(new IndexExpression[]{ expr1, expr2 });
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         Range<RowPosition> range = Util.range("", "");
         List<Row> rows = Table.open("Keyspace1").getColumnFamilyStore("Indexed1").search(clause, range, 1, filter);
@@ -638,7 +638,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
     {
         IndexExpression expr = new IndexExpression(ByteBufferUtil.bytes("birthdate"), IndexOperator.EQ, ByteBufferUtil.bytes(1L));
         List<IndexExpression> clause = Arrays.asList(expr);
-        IFilter filter = new IdentityQueryFilter();
+        IDiskAtomFilter filter = new IdentityQueryFilter();
         IPartitioner p = StorageService.getPartitioner();
         List<Row> rows = table.getColumnFamilyStore("Indexed2").search(clause, Util.range("", ""), 100, filter);
         assert rows.size() == 1 : StringUtils.join(rows, ",");
@@ -1100,7 +1100,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         sp.getSlice_range().setCount(1);
         sp.getSlice_range().setStart(ArrayUtils.EMPTY_BYTE_ARRAY);
         sp.getSlice_range().setFinish(ArrayUtils.EMPTY_BYTE_ARRAY);
-        IFilter qf = ThriftValidation.asIFilter(sp, cfs.getComparator());
+        IDiskAtomFilter qf = ThriftValidation.asIFilter(sp, cfs.getComparator());
 
         List<Row> rows;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a15500e7/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java b/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
index 00fc262..54d32569 100644
--- a/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
+++ b/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
@@ -31,7 +31,7 @@ import org.apache.cassandra.SchemaLoader;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
 import org.apache.cassandra.db.context.CounterContext;
-import org.apache.cassandra.db.filter.IFilter;
+import org.apache.cassandra.db.filter.IDiskAtomFilter;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.dht.IPartitioner;
@@ -153,7 +153,7 @@ public class StreamingTransferTest extends SchemaLoader
                                                        IndexOperator.EQ,
                                                        ByteBufferUtil.bytes(val));
             List<IndexExpression> clause = Arrays.asList(expr);
-            IFilter filter = new IdentityQueryFilter();
+            IDiskAtomFilter filter = new IdentityQueryFilter();
             Range<RowPosition> range = Util.range("", "");
             List<Row> rows = cfs.search(clause, range, 100, filter);
             assertEquals(1, rows.size());


Mime
View raw message