public final class StatementRestrictions
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
REQUIRES_ALLOW_FILTERING_MESSAGE |
TableMetadata |
table
The Column Family meta data
|
| Constructor and Description |
|---|
StatementRestrictions(StatementType type,
TableMetadata table,
WhereClause whereClause,
VariableSpecifications boundNames,
boolean selectsOnlyStaticColumns,
boolean allowFiltering,
boolean forView) |
StatementRestrictions(StatementType type,
TableMetadata table,
WhereClause whereClause,
VariableSpecifications boundNames,
boolean selectsOnlyStaticColumns,
boolean allowUseOfSecondaryIndices,
boolean allowFiltering,
boolean forView) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFunctionsTo(java.util.List<Function> functions) |
boolean |
clusteringKeyRestrictionsHasIN()
Checks if restrictions on the clustering key have IN restrictions.
|
static StatementRestrictions |
empty(StatementType type,
TableMetadata table)
Creates a new empty
StatementRestrictions. |
java.util.NavigableSet<Clustering<?>> |
getClusteringColumns(QueryOptions options)
Returns the requested clustering columns.
|
java.util.NavigableSet<ClusteringBound<?>> |
getClusteringColumnsBounds(Bound b,
QueryOptions options)
Returns the bounds (start or end) of the clustering columns.
|
IndexRestrictions |
getIndexRestrictions() |
AbstractBounds<PartitionPosition> |
getPartitionKeyBounds(QueryOptions options)
Returns the partition key bounds.
|
java.util.List<java.nio.ByteBuffer> |
getPartitionKeys(QueryOptions options)
Returns the partition keys for which the data is requested.
|
RowFilter |
getRowFilter(IndexRegistry indexRegistry,
QueryOptions options) |
boolean |
hasAllPKColumnsRestrictedByEqualities()
Checks that all the primary key columns (partition key and clustering columns) are restricted by an equality
relation ('=' or 'IN').
|
boolean |
hasClusteringColumnsRestrictions()
Checks if the query has some restrictions on the clustering columns.
|
boolean |
hasNonPrimaryKeyRestrictions()
Checks if the restrictions contain any non-primary key restrictions
|
boolean |
hasPartitionKeyRestrictions() |
boolean |
hasRegularColumnsRestrictions()
Checks if one of the restrictions applies to a regular column.
|
boolean |
isColumnRange()
Checks if the query returns a range of columns.
|
boolean |
isColumnRestrictedByEq(ColumnMetadata columnDef)
Checks if the specified column is restricted by an EQ restriction.
|
boolean |
isKeyRange()
Checks if the query request a range of partition keys.
|
boolean |
isPartitionKeyRestrictionsOnToken()
Checks if the restrictions on the partition key are token restrictions.
|
boolean |
isRestricted(ColumnMetadata column) |
boolean |
keyIsInRelation()
Checks if the restrictions on the partition key has IN restrictions.
|
boolean |
needFiltering()
Checks if the query need to use filtering.
|
java.util.Set<ColumnMetadata> |
nonPKRestrictedColumns(boolean includeNotNullRestrictions)
Returns the non-PK column that are restricted.
|
java.util.Set<ColumnMetadata> |
notNullColumns() |
boolean |
returnStaticContentOnPartitionWithNoRows()
Determines if the query should return the static content when a partition without rows is returned (as a
result set row with null for all other regular columns.)
|
java.lang.String |
toString() |
boolean |
usesSecondaryIndexing()
Checks if the secondary index need to be queried.
|
public static final java.lang.String REQUIRES_ALLOW_FILTERING_MESSAGE
public final TableMetadata table
public StatementRestrictions(StatementType type, TableMetadata table, WhereClause whereClause, VariableSpecifications boundNames, boolean selectsOnlyStaticColumns, boolean allowFiltering, boolean forView)
public StatementRestrictions(StatementType type, TableMetadata table, WhereClause whereClause, VariableSpecifications boundNames, boolean selectsOnlyStaticColumns, boolean allowUseOfSecondaryIndices, boolean allowFiltering, boolean forView)
public static StatementRestrictions empty(StatementType type, TableMetadata table)
StatementRestrictions.type - the type of statementtable - the column family meta dataStatementRestrictions.public void addFunctionsTo(java.util.List<Function> functions)
public IndexRestrictions getIndexRestrictions()
public java.util.Set<ColumnMetadata> nonPKRestrictedColumns(boolean includeNotNullRestrictions)
public java.util.Set<ColumnMetadata> notNullColumns()
public boolean isRestricted(ColumnMetadata column)
public boolean keyIsInRelation()
true the restrictions on the partition key has an IN restriction, false
otherwise.public boolean isKeyRange()
true if the query request a range of partition keys, false otherwise.public boolean isColumnRestrictedByEq(ColumnMetadata columnDef)
columnDef - the column definitiontrue if the specified column is restricted by an EQ restiction, false
otherwise.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 boolean isPartitionKeyRestrictionsOnToken()
true if the restrictions on the partition key are token restrictions,
false otherwise.public boolean clusteringKeyRestrictionsHasIN()
true if the restrictions on the clustering key have IN restrictions,
false otherwise.public RowFilter getRowFilter(IndexRegistry indexRegistry, QueryOptions options)
public java.util.List<java.nio.ByteBuffer> getPartitionKeys(QueryOptions options)
options - the query optionspublic AbstractBounds<PartitionPosition> getPartitionKeyBounds(QueryOptions options)
options - the query optionspublic boolean hasClusteringColumnsRestrictions()
true if the query has some restrictions on the clustering columns,
false otherwise.public java.util.NavigableSet<Clustering<?>> getClusteringColumns(QueryOptions options)
options - the query optionspublic java.util.NavigableSet<ClusteringBound<?>> getClusteringColumnsBounds(Bound b, QueryOptions options)
b - the bound typeoptions - the query optionspublic 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 boolean hasAllPKColumnsRestrictedByEqualities()
true if all the primary key columns are restricted by an equality relation.public boolean hasRegularColumnsRestrictions()
true if one of the restrictions applies to a regular column, false otherwise.public boolean returnStaticContentOnPartitionWithNoRows()
true if the query should return the static content when a partition without rows is returned,
false otherwise.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009-2022 The Apache Software Foundation