public abstract class Cell<V> extends ColumnData
A cell always holds at least a timestamp that gives us how the cell reconcile. We then have 3 main types of cells: 1) live regular cells: those will also have a value and, if for a complex column, a path. 2) expiring cells: on top of regular cells, those have a ttl and a local deletion time (when they are expired). 3) tombstone cells: those won't have value, but they have a local deletion time (when the tombstone was created).
Modifier and Type | Class and Description |
---|---|
static interface |
Cell.Factory<V> |
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<Cell<?>> |
comparator |
static int |
MAX_DELETION_TIME |
static int |
NO_DELETION_TIME |
static int |
NO_TTL |
static org.apache.cassandra.db.rows.Cell.Serializer |
serializer |
column
Modifier | Constructor and Description |
---|---|
protected |
Cell(ColumnMetadata column) |
Modifier and Type | Method and Description |
---|---|
abstract ValueAccessor<V> |
accessor() |
java.nio.ByteBuffer |
buffer() |
abstract Cell<?> |
copy(AbstractAllocator allocator) |
abstract boolean |
isCounterCell()
Whether the cell is a counter cell or not.
|
abstract boolean |
isExpiring()
Whether the cell is an expiring one or not.
|
abstract boolean |
isLive(int nowInSec)
Whether the cell is live or not given the current time.
|
abstract boolean |
isTombstone()
Whether the cell is a tombstone or not.
|
abstract int |
localDeletionTime()
The cell local deletion time.
|
abstract Cell<?> |
markCounterLocalToBeCleared() |
abstract CellPath |
path()
For cells belonging to complex types (non-frozen collection and UDT), the
path to the cell.
|
abstract Cell<?> |
purge(DeletionPurger purger,
int nowInSec) |
abstract long |
timestamp()
The cell timestamp.
|
abstract int |
ttl()
The cell ttl.
|
abstract V |
value() |
int |
valueSize() |
abstract Cell<?> |
withSkippedValue()
Used to apply the same optimization as in
Cell.Serializer.deserialize(org.apache.cassandra.io.util.DataInputPlus, org.apache.cassandra.db.LivenessInfo, org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.SerializationHeader, org.apache.cassandra.db.rows.DeserializationHelper, org.apache.cassandra.db.marshal.ValueAccessor<V>) when
the column is not queried but eventhough it's used for digest calculation. |
abstract Cell<?> |
withUpdatedColumn(ColumnMetadata newColumn) |
abstract Cell<?> |
withUpdatedTimestampAndLocalDeletionTime(long newTimestamp,
int newLocalDeletionTime) |
abstract Cell<?> |
withUpdatedValue(java.nio.ByteBuffer newValue) |
column, dataSize, digest, digest, hasInvalidDeletions, maxTimestamp, unsharedHeapSizeExcludingData, updateAllTimestamp, validate
public static final int NO_TTL
public static final int NO_DELETION_TIME
public static final int MAX_DELETION_TIME
public static final java.util.Comparator<Cell<?>> comparator
public static final org.apache.cassandra.db.rows.Cell.Serializer serializer
protected Cell(ColumnMetadata column)
public abstract boolean isCounterCell()
public abstract V value()
public abstract ValueAccessor<V> accessor()
public int valueSize()
public java.nio.ByteBuffer buffer()
public abstract long timestamp()
public abstract int ttl()
NO_TTL
if the cell isn't an expiring one.public abstract int localDeletionTime()
NO_DELETION_TIME
if the cell is neither
a tombstone nor an expiring one.public abstract boolean isTombstone()
public abstract boolean isExpiring()
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 isLive(int)
for that latter information.
public abstract boolean isLive(int nowInSec)
nowInSec
- the current time in seconds. This is used to
decide if an expiring cell is expired or live.nowInSec
.public abstract CellPath path()
null
for other cells.public abstract Cell<?> withUpdatedColumn(ColumnMetadata newColumn)
public abstract Cell<?> withUpdatedValue(java.nio.ByteBuffer newValue)
public abstract Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, int newLocalDeletionTime)
public abstract Cell<?> withSkippedValue()
Cell.Serializer.deserialize(org.apache.cassandra.io.util.DataInputPlus, org.apache.cassandra.db.LivenessInfo, org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.SerializationHeader, org.apache.cassandra.db.rows.DeserializationHelper, org.apache.cassandra.db.marshal.ValueAccessor<V>)
when
the column is not queried but eventhough it's used for digest calculation.public abstract Cell<?> copy(AbstractAllocator allocator)
public abstract Cell<?> markCounterLocalToBeCleared()
markCounterLocalToBeCleared
in class ColumnData
public abstract Cell<?> purge(DeletionPurger purger, int nowInSec)
purge
in class ColumnData
Copyright © 2009-2021 The Apache Software Foundation