Package org.apache.cassandra.db.memtable
Class SkipListMemtable
- java.lang.Object
-
- org.apache.cassandra.db.memtable.AbstractMemtable
-
- org.apache.cassandra.db.memtable.AbstractMemtableWithCommitlog
-
- org.apache.cassandra.db.memtable.AbstractAllocatorMemtable
-
- org.apache.cassandra.db.memtable.SkipListMemtable
-
- All Implemented Interfaces:
java.lang.Comparable<Memtable>,Memtable,UnfilteredSource
public class SkipListMemtable extends AbstractAllocatorMemtable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.memtable.AbstractMemtable
AbstractMemtable.AbstractFlushablePartitionSet<P extends Partition>, AbstractMemtable.ColumnsCollector, AbstractMemtable.StatsCollector
-
Nested classes/interfaces inherited from interface org.apache.cassandra.db.memtable.Memtable
Memtable.Factory, Memtable.FlushablePartitionSet<P extends Partition>, Memtable.LastCommitLogPosition, Memtable.MemoryUsage, Memtable.Owner
-
-
Field Summary
Fields Modifier and Type Field Description static Memtable.FactoryFACTORYprotected static intROW_OVERHEAD_HEAP_SIZE-
Fields inherited from class org.apache.cassandra.db.memtable.AbstractAllocatorMemtable
allocator, initialComparator, MEMORY_POOL, owner
-
Fields inherited from class org.apache.cassandra.db.memtable.AbstractMemtable
columnsCollector, currentOperations, metadata, minLocalDeletionTime, minTimestamp, statsCollector
-
Fields inherited from interface org.apache.cassandra.db.memtable.Memtable
NO_MIN_TIMESTAMP
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSkipListMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound, TableMetadataRef metadataRef, Memtable.Owner owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Memtable.Factoryfactory()Memtable.FlushablePartitionSet<?>getFlushSet(PartitionPosition from, PartitionPosition to)Get the collection of data between the given partition boundaries in a form suitable for flushing.longgetLiveDataSize()Size of the data not accounting for any metadata / mapping overheadsbooleanisClean()True if the memtable contains no datavoidmakeUnflushable()For testing only.longpartitionCount()Number of partitions stored in the memtableorg.apache.cassandra.db.memtable.SkipListMemtable.MemtableUnfilteredPartitionIteratorpartitionIterator(ColumnFilter columnFilter, DataRange dataRange, SSTableReadsListener readsListener)Returns a partition iterator for the given data range.longput(PartitionUpdate update, UpdateTransaction indexer, OpOrder.Group opGroup)Should only be called by ColumnFamilyStore.apply via Keyspace.apply, which supplies the appropriate OpOrdering.UnfilteredRowIteratorrowIterator(DecoratedKey key)UnfilteredRowIteratorrowIterator(DecoratedKey key, Slices slices, ColumnFilter selectedColumns, boolean reversed, SSTableReadsListener listener)Returns a row iterator for the given partition, applying the specified row and column filters.-
Methods inherited from class org.apache.cassandra.db.memtable.AbstractAllocatorMemtable
addMemoryUsageTo, createMemtableAllocatorPoolInternal, discard, flushLargestMemtable, getAllocator, localRangesUpdated, markExtraOffHeapUsed, markExtraOnHeapUsed, metadataUpdated, performSnapshot, shouldSwitch, switchOut, toString
-
Methods inherited from class org.apache.cassandra.db.memtable.AbstractMemtableWithCommitlog
accepts, getApproximateCommitLogLowerBound, getCommitLogLowerBound, getFinalCommitLogUpperBound, mayContainDataBefore
-
Methods inherited from class org.apache.cassandra.db.memtable.AbstractMemtable
getMinLocalDeletionTime, getMinTimestamp, metadata, operationCount, updateMin, updateMin
-
-
-
-
Field Detail
-
FACTORY
public static final Memtable.Factory FACTORY
-
ROW_OVERHEAD_HEAP_SIZE
protected static final int ROW_OVERHEAD_HEAP_SIZE
-
-
Constructor Detail
-
SkipListMemtable
protected SkipListMemtable(java.util.concurrent.atomic.AtomicReference<CommitLogPosition> commitLogLowerBound, TableMetadataRef metadataRef, Memtable.Owner owner)
-
-
Method Detail
-
factory
protected Memtable.Factory factory()
- Specified by:
factoryin classAbstractAllocatorMemtable
-
isClean
public boolean isClean()
Description copied from interface:MemtableTrue if the memtable contains no data
-
put
public long put(PartitionUpdate update, UpdateTransaction indexer, OpOrder.Group opGroup)
Should only be called by ColumnFamilyStore.apply via Keyspace.apply, which supplies the appropriate OpOrdering. commitLogSegmentPosition should only be null if this is a secondary index, in which case it is *expected* to be null- Parameters:
update- the partition update, may be a new partition or an update to an existing oneindexer- receives information about the update's effectopGroup- write operation group, used to permit the operation to complete if it is needed to complete a flush to free space.- Returns:
- the smallest timestamp delta between corresponding rows from existing and update. A
timestamp delta being computed as the difference between the cells and DeletionTimes from any existing partition
and those in
update. See CASSANDRA-7979.
-
partitionCount
public long partitionCount()
Description copied from interface:MemtableNumber of partitions stored in the memtable
-
partitionIterator
public org.apache.cassandra.db.memtable.SkipListMemtable.MemtableUnfilteredPartitionIterator partitionIterator(ColumnFilter columnFilter, DataRange dataRange, SSTableReadsListener readsListener)
Description copied from interface:UnfilteredSourceReturns a partition iterator for the given data range.- Parameters:
columnFilter- filter to apply to all returned partitionsdataRange- the partition and clustering range queriedreadsListener- a listener used to handle internal read events
-
rowIterator
public UnfilteredRowIterator rowIterator(DecoratedKey key, Slices slices, ColumnFilter selectedColumns, boolean reversed, SSTableReadsListener listener)
Description copied from interface:UnfilteredSourceReturns a row iterator for the given partition, applying the specified row and column filters.- Parameters:
key- the partition keyslices- the row ranges to returnselectedColumns- filter to apply to all returned partitionsreversed- true if the content should be returned in reverse orderlistener- a listener used to handle internal read events
-
rowIterator
public UnfilteredRowIterator rowIterator(DecoratedKey key)
-
getFlushSet
public Memtable.FlushablePartitionSet<?> getFlushSet(PartitionPosition from, PartitionPosition to)
Description copied from interface:MemtableGet the collection of data between the given partition boundaries in a form suitable for flushing.
-
getLiveDataSize
public long getLiveDataSize()
Description copied from interface:MemtableSize of the data not accounting for any metadata / mapping overheads
-
makeUnflushable
public void makeUnflushable()
For testing only. Give this memtable too big a size to make it always fail flushing.
-
-