public class ClusteringIndexNamesFilter extends AbstractClusteringIndexFilter
AbstractClusteringIndexFilter.InternalDeserializer, AbstractClusteringIndexFilter.KindClusteringIndexFilter.Serializerreversed| Constructor and Description |
|---|
ClusteringIndexNamesFilter(java.util.NavigableSet<Clustering> clusterings,
boolean reversed) |
| Modifier and Type | Method and Description |
|---|---|
UnfilteredRowIterator |
filter(SliceableUnfilteredRowIterator iter)
Returns an iterator that only returns the rows of the provided sliceable iterator that this filter selects.
|
UnfilteredRowIterator |
filterNotIndexed(ColumnFilter columnFilter,
UnfilteredRowIterator iterator)
Returns an iterator that only returns the rows of the provided iterator that this filter selects.
|
ClusteringIndexNamesFilter |
forPaging(ClusteringComparator comparator,
Clustering lastReturned,
boolean inclusive)
Returns a filter for continuing the paging of this filter given the last returned clustering prefix.
|
UnfilteredRowIterator |
getUnfilteredRowIterator(ColumnFilter columnFilter,
Partition partition)
Given a partition, returns a row iterator for the rows of this partition that are selected by this filter.
|
boolean |
isFullyCoveredBy(CachedPartition partition)
Returns whether we can guarantee that a given cached partition contains all the data selected by this filter.
|
boolean |
isHeadFilter()
Whether this filter selects the head of a partition (i.e.
|
java.util.NavigableSet<Clustering> |
requestedRows()
The set of requested rows.
|
boolean |
selects(Clustering clustering)
Whether a given row is selected by this filter.
|
boolean |
selectsAllPartition()
Whether this filter selects all the row of a partition (it's an "identity" filter).
|
protected long |
serializedSizeInternal(int version) |
protected void |
serializeInternal(DataOutputPlus out,
int version) |
boolean |
shouldInclude(SSTableReader sstable)
Whether the provided sstable may contain data that is selected by this filter (based on the sstable metadata).
|
java.lang.String |
toCQLString(CFMetaData metadata) |
java.lang.String |
toString(CFMetaData metadata) |
appendOrderByToCQLString, isReversedpublic ClusteringIndexNamesFilter(java.util.NavigableSet<Clustering> clusterings, boolean reversed)
public java.util.NavigableSet<Clustering> requestedRows()
public boolean selectsAllPartition()
ClusteringIndexFilterpublic boolean selects(Clustering clustering)
ClusteringIndexFilterclustering - the clustering of the row to test the selection of.clustering is selected by this filter.public ClusteringIndexNamesFilter forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive)
ClusteringIndexFiltercomparator - the comparator for the table this is a filter for.lastReturned - the last clustering that was returned for the query we are paging for. The
resulting filter will be such that results coming after lastReturned are returned
(where coming after means "greater than" if the filter is not reversed, "lesser than" otherwise;
futher, whether the comparison is strict or not depends on inclusive).inclusive - whether or not we want to include the lastReturned in the newly returned
page of results.lastReturned.public boolean isFullyCoveredBy(CachedPartition partition)
ClusteringIndexFilterpartition - the cached partition. This method assumed that the rows of this partition contains all the table columns.partition.public boolean isHeadFilter()
ClusteringIndexFilterpublic UnfilteredRowIterator filterNotIndexed(ColumnFilter columnFilter, UnfilteredRowIterator iterator)
ClusteringIndexFilter
This method is the "dumb" counterpart to ClusteringIndexFilter.filter(SliceableUnfilteredRowIterator) in that it has no way to quickly get
to what is actually selected, so it simply iterate over it all and filters out what shouldn't be returned. This should
be avoided in general, we should make sure to have SliceableUnfilteredRowIterator when we have filtering to do, but this
currently only used in SinglePartitionReadCommand.getThroughCache(org.apache.cassandra.db.ColumnFamilyStore, org.apache.cassandra.utils.concurrent.OpOrder.Group) when we know this won't be a performance problem.
Another difference with ClusteringIndexFilter.filter(SliceableUnfilteredRowIterator) is that this method also filter the queried
columns in the returned result, while the former assumes that the provided iterator has already done it.
columnFilter - the columns to include in the rows of the result iterator.iterator - the iterator for which we should filter rows.iterator that are selected by this filter.public UnfilteredRowIterator filter(SliceableUnfilteredRowIterator iter)
ClusteringIndexFilteriter - the sliceable iterator for which we should filter rows.iterator that are selected by this filter.public UnfilteredRowIterator getUnfilteredRowIterator(ColumnFilter columnFilter, Partition partition)
ClusteringIndexFiltercolumnFilter - the columns to include in the rows of the result iterator.partition - the partition containing the rows to filter.partition that are selected by this filter.public boolean shouldInclude(SSTableReader sstable)
ClusteringIndexFiltersstable - the sstable for which we want to test the need for inclusion.sstable should be included to answer this filter.public java.lang.String toString(CFMetaData metadata)
public java.lang.String toCQLString(CFMetaData metadata)
protected void serializeInternal(DataOutputPlus out, int version) throws java.io.IOException
serializeInternal in class AbstractClusteringIndexFilterjava.io.IOExceptionprotected long serializedSizeInternal(int version)
serializedSizeInternal in class AbstractClusteringIndexFilterCopyright © 2015 The Apache Software Foundation