public final class StatementRestrictions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
CFMetaData |
cfm
The Column Family meta data
|
Constructor and Description |
---|
StatementRestrictions(CFMetaData cfm,
java.util.List<Relation> whereClause,
VariableSpecifications boundNames,
boolean selectsOnlyStaticColumns,
boolean selectACollection) |
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.List<Composite> |
getClusteringColumnsAsComposites(QueryOptions options)
Returns the requested clustering columns as
Composite s. |
java.util.List<java.nio.ByteBuffer> |
getClusteringColumnsBounds(Bound b,
QueryOptions options)
Returns the bounds (start or end) of the clustering columns.
|
java.util.List<Composite> |
getClusteringColumnsBoundsAsComposites(Bound b,
QueryOptions options)
Returns the bounds (start or end) of the clustering columns as
Composites . |
java.lang.Iterable<Function> |
getFunctions() |
java.util.List<IndexExpression> |
getIndexExpressions(SecondaryIndexManager indexManager,
QueryOptions options) |
AbstractBounds<RowPosition> |
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.
|
boolean |
hasClusteringColumnsRestriction()
Checks if the query has some restrictions on the clustering columns.
|
boolean |
hasNoClusteringColumnsRestriction()
Checks if the query does not contains any restriction 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 |
isNonCompositeSliceWithExclusiveBounds() |
boolean |
keyIsInRelation()
Checks if the restrictions on the partition key is an IN restriction.
|
boolean |
needFiltering()
Checks if the query need to use filtering.
|
void |
reverse() |
boolean |
usesSecondaryIndexing()
Checks if the secondary index need to be queried.
|
public final CFMetaData cfm
public StatementRestrictions(CFMetaData cfm, java.util.List<Relation> whereClause, VariableSpecifications boundNames, boolean selectsOnlyStaticColumns, boolean selectACollection) throws InvalidRequestException
InvalidRequestException
public static StatementRestrictions empty(CFMetaData cfm)
StatementRestrictions
.cfm
- the column family meta dataStatementRestrictions
.public java.lang.Iterable<Function> getFunctions()
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 java.util.List<IndexExpression> getIndexExpressions(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<RowPosition> getPartitionKeyBounds(QueryOptions options) throws InvalidRequestException
options
- the query optionsInvalidRequestException
- if the query is invalidpublic boolean hasNoClusteringColumnsRestriction()
true
if the query does not contains any restriction on the clustering columns,
false
otherwise.public boolean hasClusteringColumnsRestriction()
true
if the query has some restrictions on the clustering columns,
false
otherwise.public boolean isNonCompositeSliceWithExclusiveBounds()
public java.util.List<Composite> getClusteringColumnsAsComposites(QueryOptions options) throws InvalidRequestException
Composite
s.options
- the query optionsComposite
sInvalidRequestException
- if the query is not validpublic java.util.List<Composite> getClusteringColumnsBoundsAsComposites(Bound b, QueryOptions options) throws InvalidRequestException
Composites
.b
- the bound typeoptions
- the query optionsComposites
InvalidRequestException
- if the request is not validpublic java.util.List<java.nio.ByteBuffer> 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.public void reverse()
Copyright © 2015 The Apache Software Foundation