Package org.apache.cassandra.db.rows
Class ComplexColumnData
- java.lang.Object
-
- org.apache.cassandra.db.rows.ColumnData
-
- org.apache.cassandra.db.rows.ComplexColumnData
-
- All Implemented Interfaces:
java.lang.Iterable<Cell<?>>,IMeasurableMemory
public class ComplexColumnData extends ColumnData implements java.lang.Iterable<Cell<?>>
The data for a complex column, that is it's cells and potential complex deletion time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComplexColumnData.Builder-
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.ColumnData
column, comparator, noOp
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> longaccumulate(BiLongAccumulator<A,Cell<?>> accumulator, A arg, long initialValue)longaccumulate(LongAccumulator<Cell<?>> accumulator, long initialValue)static ComplexColumnData.Builderbuilder()intcellsCount()ColumnDataclone(Cloner cloner)DeletionTimecomplexDeletion()The complex deletion time of the complex column.intdataSize()The size of the data hold by thisColumnData.voiddigest(Digest digest)Adds the data to the provided digest.booleanequals(java.lang.Object other)ComplexColumnDatafilter(ColumnFilter filter, DeletionTime activeDeletion, DroppedColumn dropped, LivenessInfo rowLiveness)Cell<?>getCell(CellPath path)Cell<?>getCellByIndex(int idx)inthashCode()booleanhasInvalidDeletions()Validates the deletions (ttl and local deletion time) if any.java.util.Iterator<Cell<?>>iterator()ComplexColumnDatamarkCounterLocalToBeCleared()longmaxTimestamp()ComplexColumnDatapurge(DeletionPurger purger, int nowInSec)ComplexColumnDatapurgeDataOlderThan(long timestamp)java.util.Iterator<Cell<?>>reverseIterator()SearchIterator<CellPath,Cell>searchIterator()java.lang.StringtoString()<V> ComplexColumnDatatransform(com.google.common.base.Function<? super Cell<?>,? extends Cell<?>> function)ComplexColumnDatatransformAndFilter(com.google.common.base.Function<? super Cell<?>,? extends Cell<?>> function)ComplexColumnDatatransformAndFilter(DeletionTime newDeletion, com.google.common.base.Function<? super Cell,? extends Cell> function)static ComplexColumnDataunsafeConstruct(ColumnMetadata column, java.lang.Object[] cells, DeletionTime complexDeletion)longunsharedHeapSize()longunsharedHeapSizeExcludingData()ComplexColumnDataupdateAllTimestamp(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.ComplexColumnDatawithOnlyQueriedData(ColumnFilter filter)-
Methods inherited from class org.apache.cassandra.db.rows.ColumnData
column, digest, reconciler
-
-
-
-
Method Detail
-
cellsCount
public int cellsCount()
-
getCellByIndex
public Cell<?> getCellByIndex(int idx)
-
complexDeletion
public DeletionTime complexDeletion()
The complex deletion time of the complex column.The returned "complex deletion" is a deletion of all the cells of the column. For instance, for a collection, this correspond to a full collection deletion. Please note that this deletion says nothing about the individual cells of the complex column: there can be no complex deletion but some of the individual cells can be deleted.
- Returns:
- the complex deletion time for the column this is the data of or
DeletionTime.LIVEif the column is not deleted.
-
iterator
public java.util.Iterator<Cell<?>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Cell<?>>
-
searchIterator
public SearchIterator<CellPath,Cell> searchIterator()
-
reverseIterator
public java.util.Iterator<Cell<?>> reverseIterator()
-
accumulate
public long accumulate(LongAccumulator<Cell<?>> accumulator, long initialValue)
-
accumulate
public <A> long accumulate(BiLongAccumulator<A,Cell<?>> accumulator, A arg, long initialValue)
-
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.
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSizein interfaceIMeasurableMemory- Specified by:
unsharedHeapSizein classColumnData- Returns:
- the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
-
unsharedHeapSizeExcludingData
public long unsharedHeapSizeExcludingData()
- Specified by:
unsharedHeapSizeExcludingDatain classColumnData
-
validate
public void validate()
Description copied from class:ColumnDataValidate the column data.- Specified by:
validatein classColumnData
-
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.
-
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
-
markCounterLocalToBeCleared
public ComplexColumnData markCounterLocalToBeCleared()
- Specified by:
markCounterLocalToBeClearedin classColumnData
-
filter
public ComplexColumnData filter(ColumnFilter filter, DeletionTime activeDeletion, DroppedColumn dropped, LivenessInfo rowLiveness)
-
purge
public ComplexColumnData purge(DeletionPurger purger, int nowInSec)
- Specified by:
purgein classColumnData
-
withOnlyQueriedData
public ComplexColumnData withOnlyQueriedData(ColumnFilter filter)
-
purgeDataOlderThan
public ComplexColumnData purgeDataOlderThan(long timestamp)
- Specified by:
purgeDataOlderThanin classColumnData
-
transformAndFilter
public ComplexColumnData transformAndFilter(com.google.common.base.Function<? super Cell<?>,? extends Cell<?>> function)
-
transformAndFilter
public ComplexColumnData transformAndFilter(DeletionTime newDeletion, com.google.common.base.Function<? super Cell,? extends Cell> function)
-
transform
public <V> ComplexColumnData transform(com.google.common.base.Function<? super Cell<?>,? extends Cell<?>> function)
-
clone
public ColumnData clone(Cloner cloner)
- Specified by:
clonein classColumnData
-
updateAllTimestamp
public ComplexColumnData 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
-
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
-
unsafeConstruct
public static ComplexColumnData unsafeConstruct(ColumnMetadata column, java.lang.Object[] cells, DeletionTime complexDeletion)
-
builder
public static ComplexColumnData.Builder builder()
-
-