Package org.apache.cassandra.db.rows
Class ColumnData
- java.lang.Object
-
- org.apache.cassandra.db.rows.ColumnData
-
- Direct Known Subclasses:
Cell,ComplexColumnData
public abstract class ColumnData extends java.lang.ObjectGeneric interface for the data of a given column (inside a row). In practice, there is only 2 implementations of this: eitherCellfor simple columns orComplexColumnDatafor complex columns.
-
-
Field Summary
Fields Modifier and Type Field Description protected ColumnMetadatacolumnstatic java.util.Comparator<ColumnData>comparator
-
Constructor Summary
Constructors Modifier Constructor Description protectedColumnData(ColumnMetadata column)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ColumnMetadatacolumn()The column this is data for.abstract intdataSize()The size of the data hold by thisColumnData.abstract voiddigest(Digest digest)Adds the data to the provided digest.static voiddigest(Digest digest, ColumnData cd)abstract booleanhasInvalidDeletions()Validates the deletions (ttl and local deletion time) if any.abstract ColumnDatamarkCounterLocalToBeCleared()abstract longmaxTimestamp()abstract ColumnDatapurge(DeletionPurger purger, int nowInSec)abstract longunsharedHeapSizeExcludingData()abstract ColumnDataupdateAllTimestamp(long newTimestamp)Returns a copy of the data where all timestamps for live data have replaced bynewTimestampand all deletion timestamp bynewTimestamp - 1.abstract voidvalidate()Validate the column data.
-
-
-
Field Detail
-
comparator
public static final java.util.Comparator<ColumnData> comparator
-
column
protected final ColumnMetadata column
-
-
Constructor Detail
-
ColumnData
protected ColumnData(ColumnMetadata column)
-
-
Method Detail
-
column
public final ColumnMetadata column()
The column this is data for.- Returns:
- the column this is a data for.
-
dataSize
public abstract int dataSize()
The size of the data hold by thisColumnData.- Returns:
- the size used by the data of this
ColumnData.
-
unsharedHeapSizeExcludingData
public abstract long unsharedHeapSizeExcludingData()
-
validate
public abstract void validate()
Validate the column data.- Throws:
MarshalException- if the data is not valid.
-
hasInvalidDeletions
public abstract boolean hasInvalidDeletions()
Validates the deletions (ttl and local deletion time) if any.- Returns:
- true if it has any invalid deletions, false otherwise
-
digest
public abstract void digest(Digest digest)
Adds the data to the provided digest.- Parameters:
digest- theDigestto add the data to.
-
digest
public static void digest(Digest digest, ColumnData cd)
-
updateAllTimestamp
public abstract ColumnData updateAllTimestamp(long newTimestamp)
Returns 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.
-
markCounterLocalToBeCleared
public abstract ColumnData markCounterLocalToBeCleared()
-
purge
public abstract ColumnData purge(DeletionPurger purger, int nowInSec)
-
maxTimestamp
public abstract long maxTimestamp()
-
-