Class MultiColumnRestriction
- java.lang.Object
-
- org.apache.cassandra.cql3.restrictions.MultiColumnRestriction
-
- All Implemented Interfaces:
Restriction,SingleRestriction
- Direct Known Subclasses:
MultiColumnRestriction.EQRestriction,MultiColumnRestriction.INRestriction,MultiColumnRestriction.NotNullRestriction,MultiColumnRestriction.SliceRestriction
public abstract class MultiColumnRestriction extends java.lang.Object implements SingleRestriction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiColumnRestriction.EQRestrictionstatic classMultiColumnRestriction.INRestrictionstatic classMultiColumnRestriction.InRestrictionWithMarkerAn IN restriction that uses a single marker for a set of IN values that are tuples.static classMultiColumnRestriction.InRestrictionWithValuesAn IN restriction that has a set of terms for in values.static classMultiColumnRestriction.NotNullRestrictionstatic classMultiColumnRestriction.SliceRestriction
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ColumnMetadata>columnDefsThe columns to which the restriction apply.
-
Constructor Summary
Constructors Constructor Description MultiColumnRestriction(java.util.List<ColumnMetadata> columnDefs)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract SingleRestrictiondoMergeWith(SingleRestriction otherRestriction)java.util.List<ColumnMetadata>getColumnDefs()Returns the column definitions in position order.protected java.lang.StringgetColumnsInCommons(Restriction otherRestriction)Returns the names of the columns that are specified within thisRestrictionsand the other one as a comma separatedString.ColumnMetadatagetFirstColumn()Returns the definition of the first column.ColumnMetadatagetLastColumn()Returns the definition of the last column.booleanhasSupportingIndex(IndexRegistry indexRegistry)Check if the restriction is on indexed columns.booleanisMultiColumn()protected abstract booleanisSupportedBy(Index index)Check if this type of restriction is supported for by the specified index.SingleRestrictionmergeWith(SingleRestriction otherRestriction)Merges this restriction with the specified one.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction
addFunctionsTo, addRowFilterTo, isOnToken
-
Methods inherited from interface org.apache.cassandra.cql3.restrictions.SingleRestriction
appendBoundTo, appendTo, hasBound, isContains, isEQ, isIN, isInclusive, isLIKE, isNotNull, isSlice
-
-
-
-
Field Detail
-
columnDefs
protected final java.util.List<ColumnMetadata> columnDefs
The columns to which the restriction apply.
-
-
Constructor Detail
-
MultiColumnRestriction
public MultiColumnRestriction(java.util.List<ColumnMetadata> columnDefs)
-
-
Method Detail
-
isMultiColumn
public boolean isMultiColumn()
- Specified by:
isMultiColumnin interfaceSingleRestriction
-
getFirstColumn
public ColumnMetadata getFirstColumn()
Description copied from interface:RestrictionReturns the definition of the first column.- Specified by:
getFirstColumnin interfaceRestriction- Returns:
- the definition of the first column.
-
getLastColumn
public ColumnMetadata getLastColumn()
Description copied from interface:RestrictionReturns the definition of the last column.- Specified by:
getLastColumnin interfaceRestriction- Returns:
- the definition of the last column.
-
getColumnDefs
public java.util.List<ColumnMetadata> getColumnDefs()
Description copied from interface:RestrictionReturns the column definitions in position order.- Specified by:
getColumnDefsin interfaceRestriction- Returns:
- the column definitions in position order.
-
mergeWith
public final SingleRestriction mergeWith(SingleRestriction otherRestriction)
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
protected abstract SingleRestriction doMergeWith(SingleRestriction otherRestriction)
-
getColumnsInCommons
protected final java.lang.String getColumnsInCommons(Restriction otherRestriction)
Returns the names of the columns that are specified within thisRestrictionsand the other one as a comma separatedString.- Parameters:
otherRestriction- the other restrictions- Returns:
- the names of the columns that are specified within this
Restrictionsand the other one as a comma separatedString.
-
hasSupportingIndex
public final boolean hasSupportingIndex(IndexRegistry indexRegistry)
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
-
isSupportedBy
protected abstract boolean isSupportedBy(Index index)
Check if this type of restriction is supported for by the specified index.- Parameters:
index- the secondary index- Returns:
truethis type of restriction is supported by the specified index,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-