Class MemtableIndex
java.lang.Object
org.apache.cassandra.index.sai.memory.MemtableIndex
- All Implemented Interfaces:
MemtableOrdering
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongindex(DecoratedKey key, Clustering<?> clustering, ByteBuffer value) booleanisEmpty()iterator()orderBy(QueryContext queryContext, Expression orderer, AbstractBounds<PartitionPosition> keyRange) Order the index based on the given orderer (expression).orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) Order the given list ofPrimaryKeyresults corresponding to the given orderer.search(QueryContext queryContext, Expression expression, AbstractBounds<PartitionPosition> keyRange) longupdate(DecoratedKey key, Clustering<?> clustering, ByteBuffer oldValue, ByteBuffer newValue) longwriteDirect(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier, Function<PrimaryKey, Integer> postingTransformer)
-
Constructor Details
-
MemtableIndex
-
-
Method Details
-
writeCount
public long writeCount() -
estimatedMemoryUsed
public long estimatedMemoryUsed() -
isEmpty
public boolean isEmpty() -
getMemtable
-
getMinTerm
-
getMaxTerm
-
index
-
update
public long update(DecoratedKey key, Clustering<?> clustering, ByteBuffer oldValue, ByteBuffer newValue) -
search
public KeyRangeIterator search(QueryContext queryContext, Expression expression, AbstractBounds<PartitionPosition> keyRange) -
iterator
-
writeDirect
public SegmentMetadata.ComponentMetadataMap writeDirect(IndexDescriptor indexDescriptor, IndexIdentifier indexIdentifier, Function<PrimaryKey, Integer> postingTransformer) throws IOException- Throws:
IOException
-
orderBy
public CloseableIterator<PrimaryKeyWithScore> orderBy(QueryContext queryContext, Expression orderer, AbstractBounds<PartitionPosition> keyRange) Description copied from interface:MemtableOrderingOrder the index based on the given orderer (expression).- Specified by:
orderByin interfaceMemtableOrdering- Parameters:
queryContext- - the query contextorderer- - the expression to order bykeyRange- - the key range to search- Returns:
- an iterator over the results in score order.
-
orderResultsBy
public CloseableIterator<PrimaryKeyWithScore> orderResultsBy(QueryContext queryContext, List<PrimaryKey> results, Expression orderer) Description copied from interface:MemtableOrderingOrder the given list ofPrimaryKeyresults corresponding to the given orderer. Returns an iterator over the results in score order. Assumes that the given spans the same rows as the implementing index's segment.- Specified by:
orderResultsByin interfaceMemtableOrdering
-