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
Base abstract class for
Cell implementations.
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, INVALID_DELETION_TIME, MAX_DELETION_TIME, MAX_DELETION_TIME_2038_LEGACY_CAP, MAX_DELETION_TIME_UNSIGNED_INTEGER, NO_DELETION_TIME, NO_DELETION_TIME_UNSIGNED_INTEGER, NO_TTL, serializerFields inherited from class org.apache.cassandra.db.rows.ColumnData
column, noOp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCell<?>clone(ByteBufferCloner cloner) intdataSize()The size of the data hold by thisColumnData.voidAdds the data to the provided digest.booleanstatic <V1,V2> boolean inthashCode()booleanValidates the deletions (ttl and local deletion time) if any.booleanWhether the cell is a counter cell or not.CassandraUIntbooleanWhether the cell is an expiring one or not.booleanisLive(long nowInSec) Whether the cell is live or not given the current time.booleanWhether the cell is a tombstone or not.Cell<?>longCell<?>purge(DeletionPurger purger, long nowInSec) Cell<?>purgeDataOlderThan(long timestamp) toString()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, decodeLocalDeletionTime, deletionTimeLongToUnsignedInteger, deletionTimeUnsignedIntegerToLong, getVersionedMaxDeletiontionTime, localDeletionTime, localDeletionTimeAsUnsignedInt, path, timestamp, ttl, value, valueSize, withSkippedValue, withUpdatedColumn, withUpdatedTimestampAndLocalDeletionTime, withUpdatedValueMethods inherited from class org.apache.cassandra.db.rows.ColumnData
column, digest, reconciler, unsharedHeapSize, unsharedHeapSizeExcludingData
-
Constructor Details
-
AbstractCell
-
-
Method Details
-
isCounterCell
public boolean isCounterCell()Description copied from class:CellWhether the cell is a counter cell or not.CassandraUInt- Specified by:
isCounterCellin classCell<V>- Returns:
- whether the cell is a counter cell or not.
-
isLive
public boolean isLive(long 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(long)for that latter information.- Specified by:
isExpiringin classCell<V>- Returns:
- whether the cell is an expiring one or not.
-
markCounterLocalToBeCleared
- Specified by:
markCounterLocalToBeClearedin classCell<V>
-
purge
-
purgeDataOlderThan
- Specified by:
purgeDataOlderThanin classCell<V>
-
clone
-
updateAllTimestamp
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
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
-
equals
-
hashCode
public int hashCode() -
toString
-