org.apache.cassandra.db

## Class CounterUpdateColumn

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

- All Implemented Interfaces:
    IColumn, OnDiskAtom

      public class CounterUpdateColumn
      extends Column

  A counter update while it hasn't been applied yet by the leader replica. Contains a single counter update. When applied by the leader replica, this is transformed to a relevant CounterColumn. This Column is a temporary data structure that should never be stored inside a memtable or an sstable.

- - ### Nested Class Summary

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

      `OnDiskAtom.Serializer`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.db.Column

      `name, timestamp, value`

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

      `MAX_NAME_LENGTH`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `delta()`
    `IColumn` | `diff(IColumn column)`
    `CounterColumn` | `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.
    `IColumn` | `reconcile(IColumn column, Allocator allocator)`
    `int` | `serializationFlags()`

    - ### Methods inherited from class org.apache.cassandra.db.Column

      `addColumn, addColumn, create, create, create, create, create, create, dataSize, equals, getLocalDeletionTime, getMarkedForDeleteAt, getString, getSubColumn, getSubColumns, hashCode, hasIrrelevantData, isLive, isMarkedForDelete, maxTimestamp, minTimestamp, mostRecentLiveChangeAt, mostRecentNonGCableChangeAt, name, onDiskSerializer, reconcile, serializedSize, serializedSizeForSSTable, serializer, timestamp, updateDigest, validateFields, validateName, value`

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

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

- - ### Constructor Detail

    - #### CounterUpdateColumn

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

    - #### CounterUpdateColumn

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

  - ### Method Detail

    - #### delta

          public long delta()

    - #### diff

          public IColumn diff(IColumn column)

      Specified by:
        `diff` in interface `IColumn`
      Overrides:
        `diff` in class `Column`

    - #### reconcile

          public IColumn reconcile(IColumn column,
                          Allocator allocator)

      Specified by:
        `reconcile` in interface `IColumn`
      Overrides:
        `reconcile` in class `Column`

    - #### serializationFlags

          public int serializationFlags()

      Specified by:
        `serializationFlags` in interface `IColumn`
      Overrides:
        `serializationFlags` in class `Column`

    - #### localCopy

          public CounterColumn 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`
      Overrides:
        `localCopy` in class `Column`

    - #### 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`
      Overrides:
        `localCopy` in class `Column`

Copyright © 2014 The Apache Software Foundation