CellNameType (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db.composites

## Interface CellNameType

- All Superinterfaces:
    java.util.Comparator<Composite>, CType
  All Known Implementing Classes:
    AbstractCellNameType, AbstractCompoundCellNameType, AbstractSimpleCellNameType, CompoundDenseCellNameType, CompoundSparseCellNameType, CompoundSparseCellNameType.WithCollection, SimpleDenseCellNameType, SimpleSparseCellNameType

      public interface CellNameType
      extends CType

  The type of CellNames. In the same way that a CellName is a Composite, a CellNameType is a CType, but with a number of method specific to cell names. On top of the dichotomy simple/truly-composite of composites, cell names comes in 2 variants: "dense" and "sparse". The sparse ones are CellName where one of the component (the last or second-to-last for collections) is used to store the CQL3 column name. Dense are those for which it's not the case. In other words, we have 4 types of CellName/CellNameType which correspond to the 4 type of table layout that we need to distinguish: 1. Simple (non-truly-composite) dense: this is the dynamic thrift CFs whose comparator is not composite. 2. Composite dense: this is the dynamic thrift CFs with a CompositeType comparator. 3. Simple (non-truly-composite) sparse: this is the thrift static CFs (that don't have a composite comparator). 4. Composite sparse: this is the CQL3 layout (note that this is the only one that support collections).

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CellNameType.Deserializer`

    - ### Nested classes/interfaces inherited from interface org.apache.cassandra.db.composites.CType

      `CType.Serializer`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCQL3Column(ColumnIdentifier id)`
    `CellNameType` | `addOrUpdateCollection(ColumnIdentifier columnName, CollectionType newCollection)` Return the new type obtained by adding/updating to the new collection type for the provided column name to this type.
    `java.util.Comparator<java.lang.Object>` | `asymmetricColumnComparator(boolean isRightNative)`
    `CellName` | `cellFromByteBuffer(java.nio.ByteBuffer bb)` Deserialize a Composite from a ByteBuffer.
    `ISerializer<CellName>` | `cellSerializer()`
    `int` | `clusteringPrefixSize()` The number of clustering columns for the table this is the type of.
    `ColumnToCollectionType` | `collectionType()` The type of the collections (or null if the type has not collections).
    `java.util.Comparator<Cell>` | `columnComparator(boolean isRightNative)`
    `java.util.Comparator<Cell>` | `columnReverseComparator()`
    `ColumnSerializer` | `columnSerializer()`
    `CQL3Row.Builder` | `CQL3RowBuilder(CFMetaData metadata, long now)` Creates a new CQL3Row builder for this type.
    `CellName` | `create(Composite prefix, ColumnDefinition column)` Creates a new CellName given a clustering prefix and a CQL3 column.
    `CellName` | `create(Composite prefix, ColumnDefinition column, java.nio.ByteBuffer collectionElement)` Creates a new collection CellName given a clustering prefix, a CQL3 column and the collection element.
    `IVersionedSerializer<IDiskAtomFilter>` | `diskAtomFilterSerializer()`
    `boolean` | `hasCollections()` Whether or not there is some collections defined in this type.
    `boolean` | `isDense()` Whether or not the cell names for this type are dense.
    `CellName` | `makeCellName(java.lang.Object... components)` Convenience method to create cell names given its components.
    `IVersionedSerializer<NamesQueryFilter>` | `namesQueryFilterSerializer()`
    `CellNameType.Deserializer` | `newDeserializer(java.io.DataInput in)` Creates a new Deserializer.
    `java.util.Comparator<OnDiskAtom>` | `onDiskAtomComparator()`
    `OnDiskAtom.Serializer` | `onDiskAtomSerializer()`
    `CBuilder` | `prefixBuilder()` A builder for the clustering prefix.
    `void` | `removeCQL3Column(ColumnIdentifier id)`
    `CellName` | `rowMarker(Composite prefix)` Creates a row marker for the CQL3 having the provided clustering prefix.
    `CellNameType` | `setSubtype(int position, AbstractType<?> newType)` Returns a new CellNameType that is equivalent to this one but with one of the subtype replaced by the provided new type.
    `Composite` | `staticPrefix()` The prefix to use for static columns.
    `boolean` | `supportCollections()` Whether or not this type layout support collections.

    - ### Methods inherited from interface org.apache.cassandra.db.composites.CType

      `asAbstractType, builder, compare, deletionInfoSerializer, fromByteBuffer, getString, indexComparator, indexReverseComparator, indexSerializer, isCompatibleWith, isCompound, make, rangeTombstoneSerializer, reverseComparator, rowIndexEntrySerializer, serializer, size, sliceQueryFilterSerializer, sliceSerializer, subtype, validate`

    - ### Methods inherited from interface java.util.Comparator

      `equals`

- - ### Method Detail

    - #### isDense

          boolean isDense()

      Whether or not the cell names for this type are dense.

    - #### clusteringPrefixSize

          int clusteringPrefixSize()

      The number of clustering columns for the table this is the type of.

    - #### prefixBuilder

          CBuilder prefixBuilder()

      A builder for the clustering prefix.

    - #### staticPrefix

          Composite staticPrefix()

      The prefix to use for static columns. Note that create() methods below for creating CellName automatically handle static columns already for convenience, and so there is not need to pass this prefix for them. There is few other cases where we need the prefix directly however.

    - #### hasCollections

          boolean hasCollections()

      Whether or not there is some collections defined in this type.

    - #### supportCollections

          boolean supportCollections()

      Whether or not this type layout support collections.

    - #### collectionType

          ColumnToCollectionType collectionType()

      The type of the collections (or null if the type has not collections).

    - #### addOrUpdateCollection

          CellNameType addOrUpdateCollection(ColumnIdentifier columnName,
                                           CollectionType newCollection)

      Return the new type obtained by adding/updating to the new collection type for the provided column name to this type.

    - #### setSubtype

          CellNameType setSubtype(int position,
                                AbstractType<?> newType)

      Returns a new CellNameType that is equivalent to this one but with one of the subtype replaced by the provided new type.
      Specified by:
        `setSubtype` in interface `CType`

    - #### rowMarker

          CellName rowMarker(Composite prefix)

      Creates a row marker for the CQL3 having the provided clustering prefix. Note that this is only valid for CQL3 tables (isCompound() and !isDense()) and should only be called for them.

    - #### create

          CellName create(Composite prefix,
                        ColumnDefinition column)

      Creates a new CellName given a clustering prefix and a CQL3 column. Note that for dense types, the column can be null as a shortcut for designing the only COMPACT_VALUE column of the table.

    - #### create

          CellName create(Composite prefix,
                        ColumnDefinition column,
                        java.nio.ByteBuffer collectionElement)

      Creates a new collection CellName given a clustering prefix, a CQL3 column and the collection element.

    - #### makeCellName

          CellName makeCellName(java.lang.Object... components)

      Convenience method to create cell names given its components. This is equivalent to CType#make() but return a full cell name (and thus require all the components of the name).

    - #### cellFromByteBuffer

          CellName cellFromByteBuffer(java.nio.ByteBuffer bb)

      Deserialize a Composite from a ByteBuffer. This is equilvalent to CType#fromByteBuffer but assumes the buffer is a full cell name. This is meant for thrift/cql2 to convert the fully serialized buffer we get from the clients.

    - #### CQL3RowBuilder

          CQL3Row.Builder CQL3RowBuilder(CFMetaData metadata,
                                       long now)

      Creates a new CQL3Row builder for this type. See CQL3Row for details.

    - #### addCQL3Column

          void addCQL3Column(ColumnIdentifier id)

    - #### removeCQL3Column

          void removeCQL3Column(ColumnIdentifier id)

    - #### newDeserializer

          CellNameType.Deserializer newDeserializer(java.io.DataInput in)

      Creates a new Deserializer. This is used by AtomDeserializer to do incremental and on-demand deserialization of the on disk atoms. See AtomDeserializer for details.

    - #### cellSerializer

          ISerializer<CellName> cellSerializer()

    - #### columnComparator

          java.util.Comparator<Cell> columnComparator(boolean isRightNative)

    - #### asymmetricColumnComparator

          java.util.Comparator<java.lang.Object> asymmetricColumnComparator(boolean isRightNative)

    - #### columnReverseComparator

          java.util.Comparator<Cell> columnReverseComparator()

    - #### onDiskAtomComparator

          java.util.Comparator<OnDiskAtom> onDiskAtomComparator()

    - #### columnSerializer

          ColumnSerializer columnSerializer()

    - #### onDiskAtomSerializer

          OnDiskAtom.Serializer onDiskAtomSerializer()

    - #### namesQueryFilterSerializer

          IVersionedSerializer<NamesQueryFilter> namesQueryFilterSerializer()

    - #### diskAtomFilterSerializer

          IVersionedSerializer<IDiskAtomFilter> diskAtomFilterSerializer()

Copyright © 2014 The Apache Software Foundation