org.apache.cassandra.db.rows

## Class AbstractCell

- java.lang.Object
- - org.apache.cassandra.db.rows.ColumnData
  - - org.apache.cassandra.db.rows.Cell
    - - org.apache.cassandra.db.rows.AbstractCell

Direct Known Subclasses:
  BufferCell, NativeCell

    public abstract class AbstractCell
    extends Cell

Base abstract class for `Cell` implementations. Unless you have a very good reason not to, every cell implementation should probably extend this class.

### Field Summary

### Fields inherited from class org.apache.cassandra.db.rows.Cell

`comparator, MAX_DELETION_TIME, NO_DELETION_TIME, NO_TTL, serializer`

### Fields inherited from class org.apache.cassandra.db.rows.ColumnData

`column`

### Constructor Summary

Constructors
`protected` `AbstractCell(ColumnDefinition column)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Cell` `copy(AbstractAllocator allocator)`
`int` `dataSize()` The size of the data hold by this `ColumnData`.
`void` `digest(java.security.MessageDigest digest)` Adds the data to the provided digest.
`boolean` `equals(java.lang.Object other)`
`int` `hashCode()`
`boolean` `isCounterCell()` Whether the cell is a counter cell or not.
`boolean` `isExpiring()` Whether the cell is an expiring one or not.
`boolean` `isLive(int nowInSec)` Whether the cell is live or not given the current time.
`boolean` `isTombstone()` Whether the cell is a tombstone or not.
`Cell` `markCounterLocalToBeCleared()`
`long` `maxTimestamp()`
`Cell` `purge(DeletionPurger purger, int nowInSec)`
`java.lang.String` `toString()`
`Cell` `updateAllTimestamp(long newTimestamp)` Returns a copy of the data where all timestamps for live data have replaced by `newTimestamp` and all deletion timestamp by `newTimestamp - 1`.
`void` `validate()` Validate the column data.

### Methods inherited from class org.apache.cassandra.db.rows.Cell

`localDeletionTime, path, timestamp, ttl, value, withUpdatedColumn, withUpdatedTimestampAndLocalDeletionTime, withUpdatedValue`

### Methods inherited from class org.apache.cassandra.db.rows.ColumnData

`column, unsharedHeapSizeExcludingData`

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

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

### Constructor Detail

#### AbstractCell

    protected AbstractCell(ColumnDefinition column)

### Method Detail

#### isCounterCell

    public boolean isCounterCell()

Description copied from class: `Cell`
Whether the cell is a counter cell or not.

Specified by:
  `isCounterCell` in class `Cell`
Returns:
  whether the cell is a counter cell or not.

#### isLive

    public boolean isLive(int nowInSec)

Description copied from class: `Cell`
Whether the cell is live or not given the current time.

Specified by:
  `isLive` in class `Cell`
Parameters:
  `nowInSec` - the current time in seconds. This is used to decide if an expiring cell is expired or live.
Returns:
  whether the cell is live or not at `nowInSec`.

#### isTombstone

    public boolean isTombstone()

Description copied from class: `Cell`
Whether the cell is a tombstone or not.

Specified by:
  `isTombstone` in class `Cell`
Returns:
  whether the cell is a tombstone or not.

#### isExpiring

    public boolean isExpiring()

Description copied from class: `Cell`
Whether the cell is an expiring one or not.

Note that this only correspond to whether the cell liveness info have a TTL or not, but doesn't tells whether the cell is already expired or not. You should use `Cell.isLive(int)` for that latter information.

Specified by:
  `isExpiring` in class `Cell`
Returns:
  whether the cell is an expiring one or not.

#### markCounterLocalToBeCleared

    public Cell markCounterLocalToBeCleared()

Specified by:
  `markCounterLocalToBeCleared` in class `Cell`

#### purge

    public Cell purge(DeletionPurger purger,
                      int nowInSec)

Specified by:
  `purge` in class `Cell`

#### copy

    public Cell copy(AbstractAllocator allocator)

Specified by:
  `copy` in class `Cell`

#### updateAllTimestamp

    public Cell updateAllTimestamp(long newTimestamp)

Description copied from class: `ColumnData`
Returns a copy of the data where all timestamps for live data have replaced by `newTimestamp` and all deletion timestamp by `newTimestamp - 1`. This exists for the Paxos path, see `PartitionUpdate.updateAllTimestamp(long)` for additional details.

Specified by:
  `updateAllTimestamp` in class `ColumnData`

#### dataSize

    public int dataSize()

Description copied from class: `ColumnData`
The size of the data hold by this `ColumnData`.

Specified by:
  `dataSize` in class `ColumnData`
Returns:
  the size used by the data of this `ColumnData`.

#### digest

    public void digest(java.security.MessageDigest digest)

Description copied from class: `ColumnData`
Adds the data to the provided digest.

Specified by:
  `digest` in class `ColumnData`
Parameters:
  `digest` - the `MessageDigest` to add the data to.

#### validate

    public void validate()

Description copied from class: `ColumnData`
Validate the column data.

Specified by:
  `validate` in class `ColumnData`

#### maxTimestamp

    public long maxTimestamp()

Specified by:
  `maxTimestamp` in class `ColumnData`

#### equals

    public boolean equals(java.lang.Object other)

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

#### hashCode

    public int hashCode()

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

#### toString

    public java.lang.String toString()

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