public abstract class AbstractAllocatorMemtable extends AbstractMemtableWithCommitlog
AbstractMemtable.AbstractFlushablePartitionSet<P extends Partition>, AbstractMemtable.ColumnsCollector, AbstractMemtable.StatsCollector
Memtable.Factory, Memtable.FlushablePartitionSet<P extends Partition>, Memtable.LastCommitLogPosition, Memtable.MemoryUsage, Memtable.Owner
Modifier and Type | Field and Description |
---|---|
protected MemtableAllocator |
allocator |
protected ClusteringComparator |
initialComparator |
static MemtablePool |
MEMORY_POOL |
protected Memtable.Owner |
owner |
columnsCollector, currentOperations, metadata, minLocalDeletionTime, minTimestamp, statsCollector
Constructor and Description |
---|
AbstractAllocatorMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound,
TableMetadataRef metadataRef,
Memtable.Owner owner) |
Modifier and Type | Method and Description |
---|---|
void |
addMemoryUsageTo(Memtable.MemoryUsage stats)
Add this memtable's used memory to the given usage object.
|
void |
discard()
This memtable is no longer in use or required for outstanding flushes or operations.
|
protected abstract Memtable.Factory |
factory() |
static Future<java.lang.Boolean> |
flushLargestMemtable()
Finds the largest memtable, as a percentage of *either* on- or off-heap memory limits, and immediately
queues it for flushing.
|
MemtableAllocator |
getAllocator() |
void |
localRangesUpdated()
Called when the known ranges have been updated and owner.localRangeSplits() may return different values.
|
void |
markExtraOffHeapUsed(long additionalSpace,
OpOrder.Group opGroup)
Adjust the used off-heap space by the given size (e.g.
|
void |
markExtraOnHeapUsed(long additionalSpace,
OpOrder.Group opGroup)
Adjust the used on-heap space by the given size (e.g.
|
void |
metadataUpdated()
Called when the table's metadata is updated.
|
void |
performSnapshot(java.lang.String snapshotName)
If the memtable needs to do some special action for snapshots (e.g.
|
boolean |
shouldSwitch(ColumnFamilyStore.FlushReason reason)
Decides whether the memtable should be switched/flushed for the passed reason.
|
void |
switchOut(OpOrder.Barrier writeBarrier,
java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound)
Called to tell the memtable that it is being switched out and will be flushed (or dropped) and discarded.
|
java.lang.String |
toString() |
accepts, getApproximateCommitLogLowerBound, getCommitLogLowerBound, getFinalCommitLogUpperBound, mayContainDataBefore
getMinLocalDeletionTime, getMinTimestamp, metadata, operationCount, updateMin, updateMin
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compareTo, getFlushSet, getLiveDataSize, getMemoryUsage, isClean, newMemoryUsage, partitionCount, put
partitionIterator, rowIterator, rowIterator
public static final MemtablePool MEMORY_POOL
protected final Memtable.Owner owner
protected final MemtableAllocator allocator
protected final ClusteringComparator initialComparator
public AbstractAllocatorMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound, TableMetadataRef metadataRef, Memtable.Owner owner)
public MemtableAllocator getAllocator()
public boolean shouldSwitch(ColumnFamilyStore.FlushReason reason)
Memtable
public void metadataUpdated()
Memtable
public void localRangesUpdated()
Memtable
public void performSnapshot(java.lang.String snapshotName)
Memtable
protected abstract Memtable.Factory factory()
public void switchOut(OpOrder.Barrier writeBarrier, java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogUpperBound)
Memtable
Memtable.getFlushSet(org.apache.cassandra.db.PartitionPosition, org.apache.cassandra.db.PartitionPosition)
call (if the table is not truncated or dropped), and a
Memtable.discard()
.switchOut
in interface Memtable
switchOut
in class AbstractMemtableWithCommitlog
writeBarrier
- The barrier that will signal that all writes to this memtable have completed. That is, the
point after which writes cannot be accepted by this memtable (it is permitted for writes
before this barrier to go into the next; see Memtable.accepts(org.apache.cassandra.utils.concurrent.OpOrder.Group, org.apache.cassandra.db.commitlog.CommitLogPosition)
).commitLogUpperBound
- The upper commit log position for this memtable. The value may be modified after this
call and will match the next memtable's lower commit log bound.public void discard()
Memtable
discard
in interface Memtable
discard
in class AbstractMemtableWithCommitlog
public java.lang.String toString()
toString
in class java.lang.Object
public void addMemoryUsageTo(Memtable.MemoryUsage stats)
Memtable
public void markExtraOnHeapUsed(long additionalSpace, OpOrder.Group opGroup)
Memtable
additionalSpace
- the number of allocated bytesopGroup
- write operation group, used to permit the operation to complete if it is needed to complete a
flush to free space.public void markExtraOffHeapUsed(long additionalSpace, OpOrder.Group opGroup)
Memtable
additionalSpace
- the number of allocated bytesopGroup
- write operation group, used to permit the operation to complete if it is needed to complete a
flush to free space.public static Future<java.lang.Boolean> flushLargestMemtable()
Copyright © 2009-2022 The Apache Software Foundation