public final class StatementRestrictions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
CFMetaData |
cfm
The Column Family meta data
|
static java.lang.String |
NO_INDEX_FOUND_MESSAGE |
Constructor and Description |
---|
StatementRestrictions(CFMetaData cfm,
java.util.List<Relation> whereClause,
VariableSpecifications boundNames,
boolean selectsOnlyStaticColumns,
boolean selectACollection,
boolean useFiltering) |
Modifier and Type | Method and Description |
---|---|
boolean |
areRequestedBoundsInclusive(Bound bound)
Checks if the bounds (start or end) of the clustering columns are inclusive.
|
static StatementRestrictions |
empty(CFMetaData cfm)
Creates a new empty
StatementRestrictions . |
java.util.NavigableSet<Clustering> |
getClusteringColumns(QueryOptions options)
Returns the requested clustering columns.
|
java.util.NavigableSet<Slice.Bound> |
getClusteringColumnsBounds(Bound b,
QueryOptions options)
Returns the bounds (start or end) of the clustering columns.
|
java.lang.Iterable<Function> |
getFunctions() |
AbstractBounds<PartitionPosition> |
getPartitionKeyBounds(QueryOptions options)
Returns the partition key bounds.
|
java.util.Collection<java.nio.ByteBuffer> |
getPartitionKeys(QueryOptions options)
Returns the partition keys for which the data is requested.
|
RowFilter |
getRowFilter(SecondaryIndexManager indexManager,
QueryOptions options) |
boolean |
hasClusteringColumnsRestriction()
Checks if the query has some restrictions on the clustering columns.
|
boolean |
hasPartitionKeyRestrictions() |
boolean |
isColumnRange()
Checks if the query returns a range of columns.
|
boolean |
isKeyRange()
Checks if the query request a range of partition keys.
|
boolean |
keyIsInRelation()
Checks if the restrictions on the partition key is an IN restriction.
|
boolean |
needFiltering()
Checks if the query need to use filtering.
|
java.util.Set<ColumnDefinition> |
nonPKRestrictedColumns()
Returns the non-PK column that are restricted.
|
boolean |
usesSecondaryIndexing()
Checks if the secondary index need to be queried.
|
public static final java.lang.String NO_INDEX_FOUND_MESSAGE
public final CFMetaData cfm
public StatementRestrictions(CFMetaData cfm, java.util.List<Relation> whereClause, VariableSpecifications boundNames, boolean selectsOnlyStaticColumns, boolean selectACollection, boolean useFiltering) throws InvalidRequestException
InvalidRequestException
public static StatementRestrictions empty(CFMetaData cfm)
StatementRestrictions
.cfm
- the column family meta dataStatementRestrictions
.public java.lang.Iterable<Function> getFunctions()
public java.util.Set<ColumnDefinition> nonPKRestrictedColumns()
public boolean keyIsInRelation()
true
the restrictions on the partition key is an IN restriction, false
otherwise.public boolean isKeyRange()
true
if the query request a range of partition keys, false
otherwise.public boolean usesSecondaryIndexing()
true
if the secondary index need to be queried, false
otherwise.public boolean hasPartitionKeyRestrictions()
public RowFilter getRowFilter(SecondaryIndexManager indexManager, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public java.util.Collection<java.nio.ByteBuffer> getPartitionKeys(QueryOptions options) throws InvalidRequestException
options
- the query optionsInvalidRequestException
- if the partition keys cannot be retrievedpublic AbstractBounds<PartitionPosition> getPartitionKeyBounds(QueryOptions options) throws InvalidRequestException
options
- the query optionsInvalidRequestException
- if the query is invalidpublic boolean hasClusteringColumnsRestriction()
true
if the query has some restrictions on the clustering columns,
false
otherwise.public java.util.NavigableSet<Clustering> getClusteringColumns(QueryOptions options) throws InvalidRequestException
options
- the query optionsInvalidRequestException
- if the query is not validpublic java.util.NavigableSet<Slice.Bound> getClusteringColumnsBounds(Bound b, QueryOptions options) throws InvalidRequestException
b
- the bound typeoptions
- the query optionsInvalidRequestException
- if the request is not validpublic boolean areRequestedBoundsInclusive(Bound bound)
bound
- the bound typetrue
if the bounds (start or end) of the clustering columns are inclusive,
false
otherwisepublic boolean isColumnRange()
true
if the query returns a range of columns, false
otherwise.public boolean needFiltering()
true
if the query need to use filtering, false
otherwise.Copyright © 2015 The Apache Software Foundation