Package org.apache.cassandra.db.rows
Class ColumnData
java.lang.Object
org.apache.cassandra.db.rows.ColumnData
- All Implemented Interfaces:
IMeasurableMemory
- Direct Known Subclasses:
Cell,ComplexColumnData
Generic interface for the data of a given column (inside a row).
In practice, there is only 2 implementations of this: either
Cell for simple columns
or ComplexColumnData for complex columns.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColumnMetadatastatic final Comparator<ColumnData> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ColumnDatafinal ColumnMetadatacolumn()The column this is data for.abstract intdataSize()The size of the data hold by thisColumnData.abstract voidAdds the data to the provided digest.static voiddigest(Digest digest, ColumnData cd) abstract booleanValidates the deletions (ttl and local deletion time) if any.abstract ColumnDataabstract longabstract ColumnDatapurge(DeletionPurger purger, long nowInSec) abstract ColumnDatapurgeDataOlderThan(long timestamp) static ColumnData.Reconcilerreconciler(ColumnData.PostReconciliationFunction updateF, DeletionTime activeDeletion) Construct an UpdateFunction for reconciling normal ColumnData (i.e.abstract longabstract longabstract 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 Details
-
comparator
-
noOp
-
column
-
-
Constructor Details
-
ColumnData
-
-
Method Details
-
reconciler
public static ColumnData.Reconciler reconciler(ColumnData.PostReconciliationFunction updateF, DeletionTime activeDeletion) Construct an UpdateFunction for reconciling normal ColumnData (i.e. not suitable for ComplexColumnDeletion sentinels, but suitable ComplexColumnData or Cell)- Parameters:
updateF- a consumer receiving all pairs of reconciled cellsactiveDeletion- the row or partition deletion time to use for purging
-
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.
-
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
Adds the data to the provided digest.- Parameters:
digest- theDigestto add the data to.
-
digest
-
clone
-
updateAllTimestamp
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
-
purge
-
purgeDataOlderThan
-
maxTimestamp
public abstract long maxTimestamp()
-