Class AtomicBTreePartition
- java.lang.Object
-
- org.apache.cassandra.db.partitions.AbstractBTreePartition
-
- org.apache.cassandra.db.partitions.AtomicBTreePartition
-
public final class AtomicBTreePartition extends AbstractBTreePartition
A thread-safe and atomic Partition implementation. Operations (in particular addAll) on this implementation are atomic and isolated (in the sense of ACID). Typically a addAll is guaranteed that no other thread can see the state where only parts but not all rows have been added.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
AbstractBTreePartition.Holder
-
-
Field Summary
Fields Modifier and Type Field Description static longEMPTY_SIZE-
Fields inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
EMPTY, HOLDER_UNSHARED_HEAP_SIZE, partitionKey
-
-
Constructor Summary
Constructors Constructor Description AtomicBTreePartition(TableMetadataRef metadata, DecoratedKey partitionKey, MemtableAllocator allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]addAllWithSizeDelta(PartitionUpdate update, Cloner cloner, OpOrder.Group writeOp, UpdateTransaction indexer)Adds a given update to this in-memtable partition.protected booleancanHaveShadowedData()DeletionInfodeletionInfo()RowgetRow(Clustering<?> clustering)Returns the row corresponding to the provided clustering, or null if there is not such row.protected AbstractBTreePartition.Holderholder()java.util.Iterator<Row>iterator()RowlastRow()TableMetadatametadata()DecoratedKeypartitionKey()RowstaticRow()UnfilteredRowIteratorunfilteredIterator()Returns an UnfilteredRowIterator over all the rows/RT contained by this partition.UnfilteredRowIteratorunfilteredIterator(ColumnFilter selection, java.util.NavigableSet<Clustering<?>> clusteringsInQueryOrder, boolean reversed)Returns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided clusterings.UnfilteredRowIteratorunfilteredIterator(ColumnFilter selection, Slices slices, boolean reversed)Returns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided slices.UnfilteredRowIteratorunfilteredIterator(AbstractBTreePartition.Holder current, ColumnFilter selection, Slices slices, boolean reversed)AbstractBTreePartition.HolderunsafeGetHolder()voidunsafeSetHolder(AbstractBTreePartition.Holder holder)booleanuseLock()-
Methods inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
build, build, build, columns, equals, hasRows, isEmpty, partitionLevelDeletion, rowCount, stats, toString, toString, unsafeConstructHolder, unsafeGetEmptyHolder
-
-
-
-
Constructor Detail
-
AtomicBTreePartition
public AtomicBTreePartition(TableMetadataRef metadata, DecoratedKey partitionKey, MemtableAllocator allocator)
-
-
Method Detail
-
holder
protected AbstractBTreePartition.Holder holder()
- Specified by:
holderin classAbstractBTreePartition
-
metadata
public TableMetadata metadata()
- Specified by:
metadatain interfacePartition- Specified by:
metadatain classAbstractBTreePartition
-
canHaveShadowedData
protected boolean canHaveShadowedData()
- Specified by:
canHaveShadowedDatain classAbstractBTreePartition
-
addAllWithSizeDelta
public long[] addAllWithSizeDelta(PartitionUpdate update, Cloner cloner, OpOrder.Group writeOp, UpdateTransaction indexer)
Adds a given update to this in-memtable partition.- Returns:
- an array containing first the difference in size seen after merging the updates, and second the minimum time detla between updates.
-
deletionInfo
public DeletionInfo deletionInfo()
- Overrides:
deletionInfoin classAbstractBTreePartition
-
staticRow
public Row staticRow()
- Overrides:
staticRowin classAbstractBTreePartition
-
partitionKey
public DecoratedKey partitionKey()
- Specified by:
partitionKeyin interfacePartition- Overrides:
partitionKeyin classAbstractBTreePartition
-
getRow
public Row getRow(Clustering<?> clustering)
Description copied from interface:PartitionReturns the row corresponding to the provided clustering, or null if there is not such row.- Specified by:
getRowin interfacePartition- Overrides:
getRowin classAbstractBTreePartition- Parameters:
clustering- clustering key to search- Returns:
- row corresponding to the clustering, it's either null or non-empty row.
-
lastRow
public Row lastRow()
- Overrides:
lastRowin classAbstractBTreePartition
-
unfilteredIterator
public UnfilteredRowIterator unfilteredIterator(ColumnFilter selection, Slices slices, boolean reversed)
Description copied from interface:PartitionReturns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided slices.- Specified by:
unfilteredIteratorin interfacePartition- Overrides:
unfilteredIteratorin classAbstractBTreePartition
-
unfilteredIterator
public UnfilteredRowIterator unfilteredIterator(ColumnFilter selection, java.util.NavigableSet<Clustering<?>> clusteringsInQueryOrder, boolean reversed)
Description copied from interface:PartitionReturns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided clusterings.- Specified by:
unfilteredIteratorin interfacePartition- Overrides:
unfilteredIteratorin classAbstractBTreePartition
-
unfilteredIterator
public UnfilteredRowIterator unfilteredIterator()
Description copied from interface:PartitionReturns an UnfilteredRowIterator over all the rows/RT contained by this partition.- Specified by:
unfilteredIteratorin interfacePartition- Overrides:
unfilteredIteratorin classAbstractBTreePartition
-
unfilteredIterator
public UnfilteredRowIterator unfilteredIterator(AbstractBTreePartition.Holder current, ColumnFilter selection, Slices slices, boolean reversed)
- Overrides:
unfilteredIteratorin classAbstractBTreePartition
-
iterator
public java.util.Iterator<Row> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Row>- Overrides:
iteratorin classAbstractBTreePartition
-
useLock
public boolean useLock()
-
unsafeSetHolder
public void unsafeSetHolder(AbstractBTreePartition.Holder holder)
-
unsafeGetHolder
public AbstractBTreePartition.Holder unsafeGetHolder()
-
-