Class RowMapping
java.lang.Object
org.apache.cassandra.index.sai.disk.RowMapping
In memory representation of
PrimaryKey to row ID mappings which only contains
Row regardless of whether it's live or deleted. (RangeTombstoneMarker is not included.)
While this inherits the threading behaviour of InMemoryTrie of single-writer / multiple-reader,
since it is only used by StorageAttachedIndexWriter, which is not threadsafe, we can consider
this class not threadsafe as well.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PrimaryKey key, long sstableRowId) Include PrimaryKey to RowId mappingvoidcomplete()Complete building in memory RowMapping, mark it as immutable.static RowMappingcreate(OperationType opType) Create row mapping for FLUSH operation only.intget(PrimaryKey key) Returns the SSTable row ID for aPrimaryKeybooleanIterator<Pair<ByteComparable,com.carrotsearch.hppc.LongArrayList>> merge(MemtableIndex index) Link the term ->PrimaryKeysmappings from a providedMemtableIndexto thePrimaryKey-> row ID mappings maintained here inrowMappingto produce mappings of terms to their postings lists.
-
Field Details
-
DUMMY
-
-
Method Details
-
create
Create row mapping for FLUSH operation only. -
merge
public Iterator<Pair<ByteComparable,com.carrotsearch.hppc.LongArrayList>> merge(MemtableIndex index) Link the term ->PrimaryKeysmappings from a providedMemtableIndexto thePrimaryKey-> row ID mappings maintained here inrowMappingto produce mappings of terms to their postings lists.- Parameters:
index- a Memtable-attached column index- Returns:
- an iterator of term -> postings list
Pairs
-
complete
public void complete()Complete building in memory RowMapping, mark it as immutable. -
isComplete
public boolean isComplete() -
add
Include PrimaryKey to RowId mapping -
get
Returns the SSTable row ID for aPrimaryKey- Parameters:
key- thePrimaryKey- Returns:
- a valid SSTable row ID for the
PrimaryKeyor -1 if thePrimaryKeydoesn't exist in theRowMapping
-