Package org.apache.cassandra.db.rows
Class AbstractCell<V>
- java.lang.Object
-
- org.apache.cassandra.db.rows.ColumnData
-
- org.apache.cassandra.db.rows.Cell<V>
-
- org.apache.cassandra.db.rows.AbstractCell<V>
-
- All Implemented Interfaces:
IMeasurableMemory
- Direct Known Subclasses:
ArrayCell,BufferCell,NativeCell
public abstract class AbstractCell<V> extends Cell<V>
Base abstract class forCellimplementations. Unless you have a very good reason not to, every cell implementation should probably extend this class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.rows.Cell
Cell.Factory<V>
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.rows.ColumnData
ColumnData.PostReconciliationFunction, ColumnData.Reconciler
-
-
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, noOp
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCell(ColumnMetadata column)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cell<?>clone(ByteBufferCloner cloner)intdataSize()The size of the data hold by thisColumnData.voiddigest(Digest digest)Adds the data to the provided digest.booleanequals(java.lang.Object other)static <V1,V2>
booleanequals(Cell<V1> left, Cell<V2> right)inthashCode()booleanhasInvalidDeletions()Validates the deletions (ttl and local deletion time) if any.booleanisCounterCell()Whether the cell is a counter cell or not.booleanisExpiring()Whether the cell is an expiring one or not.booleanisLive(int nowInSec)Whether the cell is live or not given the current time.booleanisTombstone()Whether the cell is a tombstone or not.Cell<?>markCounterLocalToBeCleared()longmaxTimestamp()Cell<?>purge(DeletionPurger purger, int nowInSec)Cell<?>purgeDataOlderThan(long timestamp)java.lang.StringtoString()Cell<?>updateAllTimestamp(long newTimestamp)Returns a copy of the data where all timestamps for live data have replaced bynewTimestampand all deletion timestamp bynewTimestamp - 1.voidvalidate()Validate the column data.-
Methods inherited from class org.apache.cassandra.db.rows.Cell
accessor, buffer, clone, localDeletionTime, path, timestamp, ttl, value, valueSize, withSkippedValue, withUpdatedColumn, withUpdatedTimestampAndLocalDeletionTime, withUpdatedValue
-
Methods inherited from class org.apache.cassandra.db.rows.ColumnData
column, digest, reconciler, unsharedHeapSize, unsharedHeapSizeExcludingData
-
-
-
-
Constructor Detail
-
AbstractCell
protected AbstractCell(ColumnMetadata column)
-
-
Method Detail
-
isCounterCell
public boolean isCounterCell()
Description copied from class:CellWhether the cell is a counter cell or not.- Specified by:
isCounterCellin classCell<V>- Returns:
- whether the cell is a counter cell or not.
-
isLive
public boolean isLive(int nowInSec)
Description copied from class:CellWhether the cell is live or not given the current time.
-
isTombstone
public boolean isTombstone()
Description copied from class:CellWhether the cell is a tombstone or not.- Specified by:
isTombstonein classCell<V>- Returns:
- whether the cell is a tombstone or not.
-
isExpiring
public boolean isExpiring()
Description copied from class:CellWhether 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:
isExpiringin classCell<V>- Returns:
- whether the cell is an expiring one or not.
-
markCounterLocalToBeCleared
public Cell<?> markCounterLocalToBeCleared()
- Specified by:
markCounterLocalToBeClearedin classCell<V>
-
purge
public Cell<?> purge(DeletionPurger purger, int nowInSec)
-
purgeDataOlderThan
public Cell<?> purgeDataOlderThan(long timestamp)
- Specified by:
purgeDataOlderThanin classCell<V>
-
clone
public Cell<?> clone(ByteBufferCloner cloner)
-
updateAllTimestamp
public Cell<?> updateAllTimestamp(long newTimestamp)
Description copied from class:ColumnDataReturns a copy of the data where all timestamps for live data have replaced bynewTimestampand all deletion timestamp bynewTimestamp - 1. This exists for the Paxos path, seePartitionUpdate#updateAllTimestampfor additional details.- Specified by:
updateAllTimestampin classColumnData
-
dataSize
public int dataSize()
Description copied from class:ColumnDataThe size of the data hold by thisColumnData.- Specified by:
dataSizein classColumnData- Returns:
- the size used by the data of this
ColumnData.
-
digest
public void digest(Digest digest)
Description copied from class:ColumnDataAdds the data to the provided digest.- Specified by:
digestin classColumnData- Parameters:
digest- theDigestto add the data to.
-
validate
public void validate()
Description copied from class:ColumnDataValidate the column data.- Specified by:
validatein classColumnData
-
hasInvalidDeletions
public boolean hasInvalidDeletions()
Description copied from class:ColumnDataValidates the deletions (ttl and local deletion time) if any.- Specified by:
hasInvalidDeletionsin classColumnData- Returns:
- true if it has any invalid deletions, false otherwise
-
maxTimestamp
public long maxTimestamp()
- Specified by:
maxTimestampin classColumnData
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-