Class SingleColumnRestriction
java.lang.Object
org.apache.cassandra.cql3.restrictions.SingleColumnRestriction
- All Implemented Interfaces:
Restriction,SingleRestriction
- Direct Known Subclasses:
SingleColumnRestriction.AnnRestriction,SingleColumnRestriction.ContainsRestriction,SingleColumnRestriction.EQRestriction,SingleColumnRestriction.INRestriction,SingleColumnRestriction.IsNotNullRestriction,SingleColumnRestriction.LikeRestriction,SingleColumnRestriction.SliceRestriction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final classstatic classstatic classstatic classstatic final classstatic final classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColumnMetadataThe definition of the column to which apply the restriction. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SingleRestrictiondoMergeWith(SingleRestriction otherRestriction) findSupportingIndex(IndexRegistry indexRegistry) Find first supporting index for current restrictionfindSupportingIndexFromQueryPlan(Index.QueryPlan indexQueryPlan) Find the first supporting index for the current restriction from anIndex.QueryPlan.Returns the column definitions in position order.Returns the definition of the first column.Returns the definition of the last column.booleanhasSupportingIndex(IndexRegistry indexRegistry) Check if the restriction is on indexed columns.protected abstract booleanisSupportedBy(Index index) Check if this type of restriction is supported by the specified index.final SingleRestrictionmergeWith(SingleRestriction otherRestriction) Merges this restriction with the specified one.booleanneedsFiltering(Index.Group indexGroup) Returns whether this restriction would need filtering if the specified index group were used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction
addFunctionsTo, addToRowFilter, isOnTokenMethods inherited from interface org.apache.cassandra.cql3.restrictions.SingleRestriction
appendBoundTo, appendTo, hasBound, isANN, isContains, isEQ, isEqualityBased, isIN, isInclusive, isLIKE, isMultiColumn, isNotNull, isSlice
-
Field Details
-
columnDef
The definition of the column to which apply the restriction.
-
-
Constructor Details
-
SingleColumnRestriction
-
-
Method Details
-
getColumnDefs
Description copied from interface:RestrictionReturns the column definitions in position order.- Specified by:
getColumnDefsin interfaceRestriction- Returns:
- the column definitions in position order.
-
getFirstColumn
Description copied from interface:RestrictionReturns the definition of the first column.- Specified by:
getFirstColumnin interfaceRestriction- Returns:
- the definition of the first column.
-
getLastColumn
Description copied from interface:RestrictionReturns the definition of the last column.- Specified by:
getLastColumnin interfaceRestriction- Returns:
- the definition of the last column.
-
hasSupportingIndex
Description copied from interface:RestrictionCheck if the restriction is on indexed columns.- Specified by:
hasSupportingIndexin interfaceRestriction- Parameters:
indexRegistry- the index registry- Returns:
trueif the restriction is on indexed columns,false
-
findSupportingIndex
Description copied from interface:RestrictionFind first supporting index for current restriction- Specified by:
findSupportingIndexin interfaceRestriction- Parameters:
indexRegistry- the index registry- Returns:
indexif the restriction is on indexed columns,null
-
findSupportingIndexFromQueryPlan
Description copied from interface:RestrictionFind the first supporting index for the current restriction from anIndex.QueryPlan.- Specified by:
findSupportingIndexFromQueryPlanin interfaceRestriction- Parameters:
indexQueryPlan- the index query plan- Returns:
indexif the restriction is on indexed columns,null
-
needsFiltering
Description copied from interface:RestrictionReturns whether this restriction would need filtering if the specified index group were used.- Specified by:
needsFilteringin interfaceRestriction- Parameters:
indexGroup- an index group- Returns:
trueif this would need filtering ifindexGroupwere used,falseotherwise
-
mergeWith
Description copied from interface:SingleRestrictionMerges this restriction with the specified one.Restriction are immutable. Therefore merging two restrictions result in a new one. The reason behind this choice is that it allow a great flexibility in the way the merging can done while preventing any side effect.
- Specified by:
mergeWithin interfaceSingleRestriction- Parameters:
otherRestriction- the restriction to merge into this one- Returns:
- the restriction resulting of the merge
-
doMergeWith
-
isSupportedBy
Check if this type of restriction is supported by the specified index.- Parameters:
index- the secondary index- Returns:
truethis type of restriction is supported by the specified index,falseotherwise.
-