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.
-
-
Field Summary
Fields Modifier and Type Field Description static long
EMPTY_SIZE
-
Fields inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
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 BTreePartitionUpdater
addAll(PartitionUpdate update, Cloner cloner, OpOrder.Group writeOp, UpdateTransaction indexer)
Adds a given update to this in-memtable partition.protected boolean
canHaveShadowedData()
DeletionInfo
deletionInfo()
Row
getRow(Clustering<?> clustering)
Returns the row corresponding to the provided clustering, or null if there is not such row.protected BTreePartitionData
holder()
java.util.Iterator<Row>
iterator()
Row
lastRow()
TableMetadata
metadata()
DecoratedKey
partitionKey()
Row
staticRow()
UnfilteredRowIterator
unfilteredIterator(BTreePartitionData current, ColumnFilter selection, Slices slices, boolean reversed)
BTreePartitionData
unsafeGetHolder()
void
unsafeSetHolder(BTreePartitionData holder)
boolean
useLock()
-
Methods inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
build, build, build, columns, equals, hasRows, isEmpty, partitionLevelDeletion, rowCount, stats, toString, toString, unfilteredIterator, unfilteredIterator, unfilteredIterator
-
-
-
-
Constructor Detail
-
AtomicBTreePartition
public AtomicBTreePartition(TableMetadataRef metadata, DecoratedKey partitionKey, MemtableAllocator allocator)
-
-
Method Detail
-
holder
protected BTreePartitionData holder()
- Specified by:
holder
in classAbstractBTreePartition
-
metadata
public TableMetadata metadata()
- Specified by:
metadata
in interfacePartition
- Specified by:
metadata
in classAbstractBTreePartition
-
canHaveShadowedData
protected boolean canHaveShadowedData()
- Specified by:
canHaveShadowedData
in classAbstractBTreePartition
-
addAll
public BTreePartitionUpdater addAll(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 delta between updates.
-
unsafeSetHolder
public void unsafeSetHolder(BTreePartitionData holder)
-
unsafeGetHolder
public BTreePartitionData unsafeGetHolder()
-
deletionInfo
public DeletionInfo deletionInfo()
- Overrides:
deletionInfo
in classAbstractBTreePartition
-
staticRow
public Row staticRow()
- Overrides:
staticRow
in classAbstractBTreePartition
-
partitionKey
public DecoratedKey partitionKey()
- Specified by:
partitionKey
in interfacePartition
- Overrides:
partitionKey
in classAbstractBTreePartition
-
getRow
public Row getRow(Clustering<?> clustering)
Description copied from interface:Partition
Returns the row corresponding to the provided clustering, or null if there is not such row.- Specified by:
getRow
in interfacePartition
- Overrides:
getRow
in 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:
lastRow
in classAbstractBTreePartition
-
unfilteredIterator
public UnfilteredRowIterator unfilteredIterator(BTreePartitionData current, ColumnFilter selection, Slices slices, boolean reversed)
- Overrides:
unfilteredIterator
in classAbstractBTreePartition
-
iterator
public java.util.Iterator<Row> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Row>
- Overrides:
iterator
in classAbstractBTreePartition
-
useLock
public boolean useLock()
-
-