public abstract class TokenRestriction
extends java.lang.Object
Restriction using the token function.| Modifier and Type | Class and Description |
|---|---|
static class |
TokenRestriction.EQRestriction |
static class |
TokenRestriction.SliceRestriction |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<ColumnDefinition> |
columnDefs
The definition of the columns to which apply the token restriction.
|
protected CFMetaData |
metadata |
| Constructor and Description |
|---|
TokenRestriction(CFMetaData metadata,
java.util.List<ColumnDefinition> columnDefs)
Creates a new
TokenRestriction that apply to the specified columns. |
| Modifier and Type | Method and Description |
|---|---|
void |
addRowFilterTo(RowFilter filter,
SecondaryIndexManager indexManager,
QueryOptions options)
Adds to the specified row filter the expressions corresponding to this
Restriction. |
java.util.List<java.nio.ByteBuffer> |
bounds(Bound b,
QueryOptions options) |
protected abstract org.apache.cassandra.cql3.restrictions.PartitionKeyRestrictions |
doMergeWith(TokenRestriction otherRestriction)
Merges this restriction with the specified
TokenRestriction. |
java.util.List<ColumnDefinition> |
getColumnDefs()
Returns the column definitions in position order.
|
protected java.lang.String |
getColumnNamesAsString()
Returns the column names as a comma separated
String. |
ColumnDefinition |
getFirstColumn()
Returns the definition of the first column.
|
ColumnDefinition |
getLastColumn()
Returns the definition of the last column.
|
java.util.Set<Restriction> |
getRestrictions(ColumnDefinition columnDef)
Returns the restrictions applied to the specified column.
|
boolean |
hasBound(Bound b)
Checks if the specified bound is set or not.
|
boolean |
hasIN()
Checks if any of the underlying restriction is an IN.
|
boolean |
hasOnlyEqualityRestrictions()
Checks if all of the underlying restrictions are EQ or IN restrictions.
|
boolean |
hasSlice()
Checks if any of the underlying restrictions is a slice.
|
boolean |
hasSupportingIndex(SecondaryIndexManager secondaryIndexManager)
Check if the restriction is on indexed columns.
|
boolean |
hasUnrestrictedPartitionKeyComponents(CFMetaData cfm)
Checks if the partition key has unrestricted components.
|
boolean |
isEmpty()
Checks if this
Restrictions is empty or not. |
boolean |
isInclusive(Bound b)
Checks if the specified bound is inclusive or not.
|
boolean |
isOnToken() |
org.apache.cassandra.cql3.restrictions.PartitionKeyRestrictions |
mergeWith(Restriction otherRestriction) |
boolean |
needFiltering(CFMetaData cfm)
checks if specified restrictions require filtering
|
int |
size()
Returns the number of columns that have a restriction.
|
java.util.List<java.nio.ByteBuffer> |
values(QueryOptions options) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasContainsaddFunctionsToprotected final java.util.List<ColumnDefinition> columnDefs
protected final CFMetaData metadata
public TokenRestriction(CFMetaData metadata, java.util.List<ColumnDefinition> columnDefs)
TokenRestriction that apply to the specified columns.columnDefs - the definition of the columns to which apply the token restrictionpublic boolean hasIN()
Restrictionstrue if any of the underlying restriction is an IN, false otherwisepublic boolean hasOnlyEqualityRestrictions()
Restrictionstrue if all of the underlying restrictions are EQ or IN restrictions,
false otherwisepublic java.util.Set<Restriction> getRestrictions(ColumnDefinition columnDef)
RestrictionscolumnDef - the column definitionpublic final boolean isOnToken()
public boolean needFiltering(CFMetaData cfm)
cfm - column family metadatatrue if filtering is required, false otherwisepublic boolean hasSlice()
Restrictionstrue if any of the underlying restrictions is a slice, false otherwisepublic boolean hasUnrestrictedPartitionKeyComponents(CFMetaData cfm)
cfm - column family metadatatrue if the partition key has unrestricted components, false otherwise.public java.util.List<ColumnDefinition> getColumnDefs()
Restrictionpublic ColumnDefinition getFirstColumn()
Restrictionpublic ColumnDefinition getLastColumn()
Restrictionpublic boolean hasSupportingIndex(SecondaryIndexManager secondaryIndexManager)
RestrictionsecondaryIndexManager - the index managertrue if the restriction is on indexed columns, falsepublic void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options)
RestrictionRestriction.filter - the row filter to add expressions toindexManager - the secondary index manageroptions - the query optionspublic final boolean isEmpty()
RestrictionsRestrictions is empty or not.true if this Restrictions is empty, false otherwise.public final int size()
Restrictionsprotected final java.lang.String getColumnNamesAsString()
String.String.public final org.apache.cassandra.cql3.restrictions.PartitionKeyRestrictions mergeWith(Restriction otherRestriction) throws InvalidRequestException
InvalidRequestExceptionprotected abstract org.apache.cassandra.cql3.restrictions.PartitionKeyRestrictions doMergeWith(TokenRestriction otherRestriction) throws InvalidRequestException
TokenRestriction.otherRestriction - the TokenRestriction to merge with.InvalidRequestExceptionpublic java.util.List<java.nio.ByteBuffer> values(QueryOptions options)
public java.util.List<java.nio.ByteBuffer> bounds(Bound b, QueryOptions options)
public boolean hasBound(Bound b)
b - the bound typetrue if the specified bound is set, false otherwisepublic boolean isInclusive(Bound b)
b - the bound typetrue if the specified bound is inclusive, false otherwiseCopyright © 2018 The Apache Software Foundation