Package org.apache.cassandra.schema
Class ColumnMetadata
java.lang.Object
org.apache.cassandra.cql3.ColumnSpecification
org.apache.cassandra.schema.ColumnMetadata
- All Implemented Interfaces:
Comparable<ColumnMetadata>,AssignmentTestable,Selectable
public final class ColumnMetadata
extends ColumnSpecification
implements Selectable, Comparable<ColumnMetadata>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumThe type of CQL3 column this definition represents.Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResultNested classes/interfaces inherited from interface org.apache.cassandra.cql3.selection.Selectable
Selectable.BetweenParenthesesOrWithTuple, Selectable.Raw, Selectable.RawIdentifier, Selectable.WithArrayLiteral, Selectable.WithCast, Selectable.WithElementSelection, Selectable.WithFieldSelection, Selectable.WithFunction, Selectable.WithList, Selectable.WithMapOrUdt, Selectable.WithSet, Selectable.WithSliceSelection, Selectable.WithTerm, Selectable.WithTypeHint, Selectable.WithVector, Selectable.WritetimeOrTTL -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<Object>final ColumnMetadata.Kindstatic final intFields inherited from class org.apache.cassandra.cql3.ColumnSpecification
cfName, ksName, name, type -
Constructor Summary
ConstructorsConstructorDescriptionColumnMetadata(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, ColumnMetadata.Kind kind, ColumnMask mask) ColumnMetadata(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position, ColumnMetadata.Kind kind, ColumnMask mask) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendCqlTo(CqlBuilder builder) voidappendNameAndOrderTo(CqlBuilder builder) Comparator<? super Cell<?>>AbstractType<?>The type of the cell values for cell belonging to this column.static ColumnMetadataclusteringColumn(String keyspace, String table, String name, AbstractType<?> type, int position) static ColumnMetadataclusteringColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position) intcompareTo(ColumnMetadata other) copy()booleanAbstractType<?>getExactTypeIfKnown(String keyspace) The type of theSelectableif it can be infered.getMask()inthashCode()booleanbooleanbooleanCheck if column is counter type.booleanisMasked()booleanbooleanbooleanbooleanisSimple()booleanisStatic()newSelectorFactory(TableMetadata table, AbstractType<?> expectedType, List<ColumnMetadata> defs, VariableSpecifications boundNames) static ColumnMetadatapartitionKeyColumn(String keyspace, String table, String name, AbstractType<?> type, int position) static ColumnMetadatapartitionKeyColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position) intposition()booleanChecks if any processing is performed on the selected columns,falseotherwise.static ColumnMetadataregularColumn(String keyspace, String table, String name, AbstractType<?> type) static ColumnMetadataregularColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type) booleanselectColumns(Predicate<ColumnMetadata> predicate) Checks if thisSelectableselect columns matching the specified predicate.static ColumnMetadatastaticColumn(String keyspace, String table, String name, AbstractType<?> type) static ColumnMetadatastaticColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type) static StringtoCQLString(Iterable<ColumnMetadata> defs) static StringtoCQLString(Iterator<ColumnMetadata> defs) static Collection<ColumnIdentifier>toIdentifiers(Collection<ColumnMetadata> definitions) Converts the specified column definitions into column identifiers.toString()<V> voidvalidateCell(Cell<V> cell) withNewMask(ColumnMask newMask) withNewName(ColumnIdentifier newName) withNewType(AbstractType<?> newType) Methods inherited from class org.apache.cassandra.cql3.ColumnSpecification
allInSameTable, isReversedType, withAliasMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.cql3.selection.Selectable
addAndGetIndex, getCompatibleTypeIfKnown, specForElementOrSlice, testAssignment
-
Field Details
-
asymmetricColumnDataComparator
-
NO_POSITION
public static final int NO_POSITION- See Also:
-
kind
-
-
Constructor Details
-
ColumnMetadata
public ColumnMetadata(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position, ColumnMetadata.Kind kind, @Nullable ColumnMask mask) -
ColumnMetadata
public ColumnMetadata(String ksName, String cfName, ColumnIdentifier name, AbstractType<?> type, int position, ColumnMetadata.Kind kind, @Nullable ColumnMask mask)
-
-
Method Details
-
partitionKeyColumn
public static ColumnMetadata partitionKeyColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position) -
partitionKeyColumn
public static ColumnMetadata partitionKeyColumn(String keyspace, String table, String name, AbstractType<?> type, int position) -
clusteringColumn
public static ColumnMetadata clusteringColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type, int position) -
clusteringColumn
public static ColumnMetadata clusteringColumn(String keyspace, String table, String name, AbstractType<?> type, int position) -
regularColumn
public static ColumnMetadata regularColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type) -
regularColumn
public static ColumnMetadata regularColumn(String keyspace, String table, String name, AbstractType<?> type) -
staticColumn
public static ColumnMetadata staticColumn(TableMetadata table, ByteBuffer name, AbstractType<?> type) -
staticColumn
public static ColumnMetadata staticColumn(String keyspace, String table, String name, AbstractType<?> type) -
copy
-
withNewName
-
withNewType
-
withNewMask
-
isPartitionKey
public boolean isPartitionKey() -
isClusteringColumn
public boolean isClusteringColumn() -
isStatic
public boolean isStatic() -
isMasked
public boolean isMasked() -
isRegular
public boolean isRegular() -
clusteringOrder
-
position
public int position() -
getMask
-
equals
- Overrides:
equalsin classColumnSpecification
-
hashCode
public int hashCode()- Overrides:
hashCodein classColumnSpecification
-
toString
- Overrides:
toStringin classColumnSpecification
-
debugString
-
isPrimaryKeyColumn
public boolean isPrimaryKeyColumn() -
selectColumns
Description copied from interface:SelectableChecks if thisSelectableselect columns matching the specified predicate.- Specified by:
selectColumnsin interfaceSelectable- Returns:
trueif thisSelectableselect columns matching the specified predicate,falseotherwise.
-
processesSelection
public boolean processesSelection()Description copied from interface:SelectableChecks if any processing is performed on the selected columns,falseotherwise.- Specified by:
processesSelectionin interfaceSelectable- Returns:
trueif any processing is performed on the selected columns,falseotherwise.
-
toIdentifiers
Converts the specified column definitions into column identifiers.- Parameters:
definitions- the column definitions to convert.- Returns:
- the column identifiers corresponding to the specified definitions
-
compareTo
- Specified by:
compareToin interfaceComparable<ColumnMetadata>
-
cellPathComparator
-
asymmetricCellPathComparator
-
cellComparator
-
isComplex
public boolean isComplex() -
isSimple
public boolean isSimple() -
cellPathSerializer
-
validateCell
-
appendCqlTo
-
toCQLString
-
toCQLString
-
appendNameAndOrderTo
-
cellValueType
The type of the cell values for cell belonging to this column. This is the same than the column type, except for non-frozen collections where it's the 'valueComparator' of the collection. This method should not be used to get value type of non-frozon UDT. -
isCounterColumn
public boolean isCounterColumn()Check if column is counter type. -
newSelectorFactory
public Selector.Factory newSelectorFactory(TableMetadata table, AbstractType<?> expectedType, List<ColumnMetadata> defs, VariableSpecifications boundNames) throws InvalidRequestException - Specified by:
newSelectorFactoryin interfaceSelectable- Throws:
InvalidRequestException
-
getExactTypeIfKnown
Description copied from interface:SelectableThe type of theSelectableif it can be infered.- Specified by:
getExactTypeIfKnownin interfaceSelectable- Parameters:
keyspace- the keyspace on which the statement for which this is aSelectableis on.- Returns:
- the type of this
Selectableif inferrable, ornullotherwise (for instance, the type isn't inferable for a bind marker. Even for literals, the exact type is not inferrable since they are valid for many different types and so this will returnnulltoo).
-