org.apache.cassandra.db

## Class Column

- java.lang.Object
- - org.apache.cassandra.db.Column

- All Implemented Interfaces:
    IColumn, OnDiskAtom
  Direct Known Subclasses:
    CounterColumn, CounterUpdateColumn, DeletedColumn, ExpiringColumn

      public class Column
      extends java.lang.Object
      implements IColumn

  Column is immutable, which prevents all kinds of confusion in a multithreaded environment. (TODO: look at making SuperColumn immutable too. This is trickier but is probably doable with something like PCollections -- http://code.google.com

- - ### Nested Class Summary

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

      `OnDiskAtom.Serializer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.nio.ByteBuffer` | `name`
    `protected long` | `timestamp`
    `protected java.nio.ByteBuffer` | `value`

    - ### Fields inherited from interface org.apache.cassandra.db.IColumn

      `MAX_NAME_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Column(java.nio.ByteBuffer name, java.nio.ByteBuffer value)`
    `Column(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addColumn(IColumn column)`
    `void` | `addColumn(IColumn column, Allocator allocator)`
    `static Column` | `create(boolean value, long timestamp, java.lang.String... names)`
    `static Column` | `create(java.nio.ByteBuffer value, long timestamp, java.lang.String... names)`
    `static Column` | `create(double value, long timestamp, java.lang.String... names)`
    `static Column` | `create(java.net.InetAddress value, long timestamp, java.lang.String... names)`
    `static Column` | `create(int value, long timestamp, java.lang.String... names)`
    `static Column` | `create(java.lang.String value, long timestamp, java.lang.String... names)`
    `int` | `dataSize()` the size of user-provided data, not including internal overhead
    `IColumn` | `diff(IColumn column)`
    `boolean` | `equals(java.lang.Object o)`
    `int` | `getLocalDeletionTime()`
    `long` | `getMarkedForDeleteAt()`
    `java.lang.String` | `getString(AbstractType<?> comparator)`
    `Column` | `getSubColumn(java.nio.ByteBuffer columnName)`
    `java.util.Collection<IColumn>` | `getSubColumns()`
    `int` | `hashCode()`
    `boolean` | `hasIrrelevantData(int gcBefore)`
    `boolean` | `isLive()` For a simple column, live == !isMarkedForDelete.
    `boolean` | `isMarkedForDelete()`
    `IColumn` | `localCopy(ColumnFamilyStore cfs)` clones the column for the row cache, interning column names and making copies of other underlying byte buffers
    `IColumn` | `localCopy(ColumnFamilyStore cfs, Allocator allocator)` clones the column for the memtable, interning column names and making copies of other underlying byte buffers.
    `long` | `maxTimestamp()` For a standard column, this is the same as timestamp().
    `long` | `minTimestamp()` For a standard column, this is the same as timestamp().
    `long` | `mostRecentLiveChangeAt()`
    `long` | `mostRecentNonGCableChangeAt(int gcbefore)`
    `java.nio.ByteBuffer` | `name()`
    `static OnDiskAtom.Serializer` | `onDiskSerializer()`
    `IColumn` | `reconcile(IColumn column)`
    `IColumn` | `reconcile(IColumn column, Allocator allocator)`
    `int` | `serializationFlags()`
    `int` | `serializedSize(TypeSizes typeSizes)`
    `long` | `serializedSizeForSSTable()`
    `static ColumnSerializer` | `serializer()`
    `long` | `timestamp()`
    `void` | `updateDigest(java.security.MessageDigest digest)`
    `void` | `validateFields(CFMetaData metadata)`
    `protected void` | `validateName(CFMetaData metadata)`
    `java.nio.ByteBuffer` | `value()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### name

          protected final java.nio.ByteBuffer name

    - #### value

          protected final java.nio.ByteBuffer value

    - #### timestamp

          protected final long timestamp

  - ### Constructor Detail

    - #### Column

          public Column(java.nio.ByteBuffer name,
                java.nio.ByteBuffer value)

    - #### Column

          public Column(java.nio.ByteBuffer name,
                java.nio.ByteBuffer value,
                long timestamp)

  - ### Method Detail

    - #### serializer

          public static ColumnSerializer serializer()

    - #### onDiskSerializer

          public static OnDiskAtom.Serializer onDiskSerializer()

    - #### name

          public java.nio.ByteBuffer name()

      Specified by:
        `name` in interface `OnDiskAtom`

    - #### getSubColumn

          public Column getSubColumn(java.nio.ByteBuffer columnName)

      Specified by:
        `getSubColumn` in interface `IColumn`

    - #### value

          public java.nio.ByteBuffer value()

      Specified by:
        `value` in interface `IColumn`

    - #### getSubColumns

          public java.util.Collection<IColumn> getSubColumns()

      Specified by:
        `getSubColumns` in interface `IColumn`

    - #### timestamp

          public long timestamp()

      Specified by:
        `timestamp` in interface `IColumn`

    - #### minTimestamp

          public long minTimestamp()

      Description copied from interface: `OnDiskAtom`
      For a standard column, this is the same as timestamp(). For a super column, this is the min/max column timestamp of the sub columns.
      Specified by:
        `minTimestamp` in interface `OnDiskAtom`

    - #### maxTimestamp

          public long maxTimestamp()

      Description copied from interface: `IColumn`
      For a standard column, this is the same as timestamp(). For a super column, this is the max column timestamp of the sub columns.
      Specified by:
        `maxTimestamp` in interface `IColumn`
      Specified by:
        `maxTimestamp` in interface `OnDiskAtom`

    - #### isMarkedForDelete

          public boolean isMarkedForDelete()

      Specified by:
        `isMarkedForDelete` in interface `IColumn`
      Returns:
        true if the column has been deleted (is a tombstone). This depends on comparing the server clock with getLocalDeletionTime, so it can change during a single request if you're not careful.

    - #### getMarkedForDeleteAt

          public long getMarkedForDeleteAt()

      Specified by:
        `getMarkedForDeleteAt` in interface `IColumn`

    - #### mostRecentLiveChangeAt

          public long mostRecentLiveChangeAt()

      Specified by:
        `mostRecentLiveChangeAt` in interface `IColumn`

    - #### mostRecentNonGCableChangeAt

          public long mostRecentNonGCableChangeAt(int gcbefore)

      Specified by:
        `mostRecentNonGCableChangeAt` in interface `IColumn`

    - #### dataSize

          public int dataSize()

      Description copied from interface: `IColumn`
      the size of user-provided data, not including internal overhead
      Specified by:
        `dataSize` in interface `IColumn`

    - #### serializedSize

          public int serializedSize(TypeSizes typeSizes)

      Specified by:
        `serializedSize` in interface `OnDiskAtom`

    - #### serializedSizeForSSTable

          public long serializedSizeForSSTable()

      Specified by:
        `serializedSizeForSSTable` in interface `OnDiskAtom`

    - #### serializationFlags

          public int serializationFlags()

      Specified by:
        `serializationFlags` in interface `IColumn`

    - #### addColumn

          public void addColumn(IColumn column)

      Specified by:
        `addColumn` in interface `IColumn`

    - #### addColumn

          public void addColumn(IColumn column,
                       Allocator allocator)

      Specified by:
        `addColumn` in interface `IColumn`

    - #### diff

          public IColumn diff(IColumn column)

      Specified by:
        `diff` in interface `IColumn`

    - #### updateDigest

          public void updateDigest(java.security.MessageDigest digest)

      Specified by:
        `updateDigest` in interface `OnDiskAtom`

    - #### getLocalDeletionTime

          public int getLocalDeletionTime()

      Specified by:
        `getLocalDeletionTime` in interface `OnDiskAtom`

    - #### reconcile

          public IColumn reconcile(IColumn column)

      Specified by:
        `reconcile` in interface `IColumn`

    - #### reconcile

          public IColumn reconcile(IColumn column,
                          Allocator allocator)

      Specified by:
        `reconcile` in interface `IColumn`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### localCopy

          public IColumn localCopy(ColumnFamilyStore cfs)

      Description copied from interface: `IColumn`
      clones the column for the row cache, interning column names and making copies of other underlying byte buffers
      Specified by:
        `localCopy` in interface `IColumn`

    - #### localCopy

          public IColumn localCopy(ColumnFamilyStore cfs,
                          Allocator allocator)

      Description copied from interface: `IColumn`
      clones the column for the memtable, interning column names and making copies of other underlying byte buffers. Unlike the other localCopy, this uses Allocator to allocate values in contiguous memory regions, which helps avoid heap fragmentation.
      Specified by:
        `localCopy` in interface `IColumn`

    - #### getString

          public java.lang.String getString(AbstractType<?> comparator)

      Specified by:
        `getString` in interface `IColumn`

    - #### isLive

          public boolean isLive()

      Description copied from interface: `IColumn`
      For a simple column, live == !isMarkedForDelete. For a supercolumn, live means it has at least one subcolumn whose timestamp is greater than the supercolumn deleted-at time.
      Specified by:
        `isLive` in interface `IColumn`

    - #### validateName

          protected void validateName(CFMetaData metadata)
                               throws MarshalException

      Throws:
        `MarshalException`

    - #### validateFields

          public void validateFields(CFMetaData metadata)
                              throws MarshalException

      Specified by:
        `validateFields` in interface `IColumn`
      Specified by:
        `validateFields` in interface `OnDiskAtom`
      Throws:
        `MarshalException`

    - #### hasIrrelevantData

          public boolean hasIrrelevantData(int gcBefore)

      Specified by:
        `hasIrrelevantData` in interface `IColumn`
      Returns:
        true if the column or any its subcolumns is no longer relevant after @param gcBefore

    - #### create

          public static Column create(java.lang.String value,
                      long timestamp,
                      java.lang.String... names)

    - #### create

          public static Column create(int value,
                      long timestamp,
                      java.lang.String... names)

    - #### create

          public static Column create(boolean value,
                      long timestamp,
                      java.lang.String... names)

    - #### create

          public static Column create(double value,
                      long timestamp,
                      java.lang.String... names)

    - #### create

          public static Column create(java.nio.ByteBuffer value,
                      long timestamp,
                      java.lang.String... names)

    - #### create

          public static Column create(java.net.InetAddress value,
                      long timestamp,
                      java.lang.String... names)

Copyright © 2014 The Apache Software Foundation