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 |
REQUIRES_ALLOW_FILTERING_MESSAGE |
| Constructor and Description |
|---|
StatementRestrictions(CFMetaData cfm,
java.util.List<Relation> whereClause,
VariableSpecifications boundNames,
boolean selectsOnlyStaticColumns,
boolean selectACollection,
boolean allowFiltering) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areRequestedBoundsInclusive(Bound bound)
Checks if the bounds (start or end) of the clustering columns are inclusive.
|
boolean |
clusteringRestrictionsNeedFiltering() |
static StatementRestrictions |
empty(CFMetaData cfm)
Creates a new empty
StatementRestrictions. |
java.util.List<Composite> |
getClusteringColumnsAsComposites(QueryOptions options)
Returns the requested clustering columns as
Composites. |
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 |
hasNonPrimaryKeyRestrictions()
Checks if the restrictions contain any non-primary key restrictions
|
boolean |
hasPartitionKeyRestrictions() |
boolean |
hasRegularColumnsRestriction() |
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 |
isNotReturningAnyRows(QueryOptions options)
Checks if the query will never return any rows.
|
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.
|
void |
validateClusteringRestrictions(boolean hasQueriableIndex)
Validates whether or not restrictions are allowed for execution when secondary index is not used.
|
public static final java.lang.String REQUIRES_ALLOW_FILTERING_MESSAGE
public final CFMetaData cfm
public StatementRestrictions(CFMetaData cfm, java.util.List<Relation> whereClause, VariableSpecifications boundNames, boolean selectsOnlyStaticColumns, boolean selectACollection, boolean allowFiltering)
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 hasRegularColumnsRestriction()
public boolean usesSecondaryIndexing()
true if the secondary index need to be queried, false otherwise.public boolean hasPartitionKeyRestrictions()
public boolean hasNonPrimaryKeyRestrictions()
true if the restrictions contain any non-primary key restrictions, false otherwise.public final void validateClusteringRestrictions(boolean hasQueriableIndex)
public final boolean clusteringRestrictionsNeedFiltering()
public java.util.List<IndexExpression> getIndexExpressions(SecondaryIndexManager indexManager, QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic 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
Composites.options - the query optionsCompositesInvalidRequestException - if the query is not validpublic java.util.List<Composite> getClusteringColumnsBoundsAsComposites(Bound b, QueryOptions options) throws InvalidRequestException
Composites.b - the bound typeoptions - the query optionsCompositesInvalidRequestException - 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()
public boolean isNotReturningAnyRows(QueryOptions options)
options - the query optionstrue if the query will never return any rows, otherwiseCopyright © 2018 The Apache Software Foundation