public abstract class SingleColumnRestriction
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SingleColumnRestriction.Contains |
static class |
SingleColumnRestriction.EQ |
static class |
SingleColumnRestriction.IN |
static class |
SingleColumnRestriction.InWithMarker |
static class |
SingleColumnRestriction.InWithValues |
static class |
SingleColumnRestriction.Slice |
| Modifier and Type | Field and Description |
|---|---|
protected ColumnDefinition |
columnDef
The definition of the column to which apply the restriction.
|
| Constructor and Description |
|---|
SingleColumnRestriction(ColumnDefinition columnDef) |
| Modifier and Type | Method and Description |
|---|---|
CompositesBuilder |
appendBoundTo(CFMetaData cfm,
CompositesBuilder builder,
Bound bound,
QueryOptions options)
Appends the values of the
Restriction for the specified bound to the specified builder. |
protected abstract Restriction |
doMergeWith(Restriction otherRestriction) |
java.util.List<ColumnDefinition> |
getColumnDefs()
Returns the column definitions in position order.
|
ColumnDefinition |
getFirstColumn()
Returns the definition of the first column.
|
ColumnDefinition |
getLastColumn()
Returns the definition of the last column.
|
boolean |
hasBound(Bound b)
Checks if the specified bound is set or not.
|
boolean |
hasSupportingIndex(SecondaryIndexManager indexManager)
Check if the restriction is on indexed columns.
|
boolean |
isContains() |
boolean |
isEQ() |
boolean |
isIN() |
boolean |
isInclusive(Bound b)
Checks if the specified bound is inclusive or not.
|
boolean |
isMultiColumn() |
boolean |
isNotReturningAnyRows(CFMetaData cfm,
QueryOptions options)
Checks if this restriction will prevent the query to return any rows.
|
boolean |
isOnToken() |
boolean |
isSlice() |
protected abstract boolean |
isSupportedBy(SecondaryIndex index)
Check if this type of restriction is supported by the specified index.
|
Restriction |
mergeWith(Restriction otherRestriction)
Merges this restriction with the specified one.
|
protected static Bound |
reverseBoundIfNeeded(ColumnDefinition columnDefinition,
Bound bound)
Reverses the specified bound if the column type is a reversed one.
|
protected static java.nio.ByteBuffer |
validateIndexedValue(ColumnSpecification columnSpec,
java.nio.ByteBuffer value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddIndexExpressionTo, appendTo, getFunctionsprotected final ColumnDefinition columnDef
public SingleColumnRestriction(ColumnDefinition columnDef)
public java.util.List<ColumnDefinition> getColumnDefs()
Restrictionpublic ColumnDefinition getFirstColumn()
Restrictionpublic ColumnDefinition getLastColumn()
Restrictionpublic boolean hasSupportingIndex(SecondaryIndexManager indexManager)
RestrictionindexManager - the index managertrue if the restriction is on indexed columns, falsepublic final Restriction mergeWith(Restriction otherRestriction) throws InvalidRequestException
RestrictionRestriction 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.
otherRestriction - the restriction to merge into this oneInvalidRequestException - if the restrictions cannot be mergedprotected abstract Restriction doMergeWith(Restriction otherRestriction) throws InvalidRequestException
InvalidRequestExceptionprotected abstract boolean isSupportedBy(SecondaryIndex index)
index - the Secondary indextrue this type of restriction is supported by the specified index,
false otherwise.public boolean isOnToken()
isOnToken in interface Restrictionpublic boolean isMultiColumn()
isMultiColumn in interface Restrictionpublic boolean isSlice()
isSlice in interface Restrictionpublic boolean isEQ()
isEQ in interface Restrictionpublic boolean isIN()
isIN in interface Restrictionpublic boolean isContains()
isContains in interface Restrictionpublic boolean hasBound(Bound b)
RestrictionhasBound in interface Restrictionb - the bound typetrue if the specified bound is set, false otherwisepublic CompositesBuilder appendBoundTo(CFMetaData cfm, CompositesBuilder builder, Bound bound, QueryOptions options)
RestrictionRestriction for the specified bound to the specified builder.appendBoundTo in interface Restrictioncfm - the table metadatabuilder - the CompositesBuilder to append to.bound - the boundoptions - the query optionsCompositesBuilderpublic boolean isInclusive(Bound b)
RestrictionisInclusive in interface Restrictionb - the bound typetrue if the specified bound is inclusive, false otherwisepublic boolean isNotReturningAnyRows(CFMetaData cfm, QueryOptions options)
RestrictionisNotReturningAnyRows in interface Restrictioncfm - the table metadataoptions - the query optionstrue if this restriction will prevent the query to return any rows, otherwiseprotected static java.nio.ByteBuffer validateIndexedValue(ColumnSpecification columnSpec, java.nio.ByteBuffer value) throws InvalidRequestException
InvalidRequestExceptionprotected static Bound reverseBoundIfNeeded(ColumnDefinition columnDefinition, Bound bound)
columnDefinition - the column definitionbound - the boundCopyright © 2018 The Apache Software Foundation