Class RowMapping
- java.lang.Object
-
- org.apache.cassandra.index.sai.disk.RowMapping
-
@NotThreadSafe public class RowMapping extends java.lang.Object
In memory representation ofPrimaryKey
to row ID mappings which only containsRow
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 byStorageAttachedIndexWriter
, which is not threadsafe, we can consider this class not threadsafe as well.
-
-
Field Summary
Fields Modifier and Type Field Description static RowMapping
DUMMY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(PrimaryKey key, long sstableRowId)
Include PrimaryKey to RowId mappingvoid
complete()
Complete building in memory RowMapping, mark it as immutable.static RowMapping
create(OperationType opType)
Create row mapping for FLUSH operation only.int
get(PrimaryKey key)
Returns the SSTable row ID for aPrimaryKey
boolean
isComplete()
java.util.Iterator<Pair<ByteComparable,com.carrotsearch.hppc.LongArrayList>>
merge(MemtableIndex index)
Link the term ->PrimaryKeys
mappings from a providedMemtableIndex
to thePrimaryKey
-> row ID mappings maintained here inrowMapping
to produce mappings of terms to their postings lists.
-
-
-
Field Detail
-
DUMMY
public static final RowMapping DUMMY
-
-
Method Detail
-
create
public static RowMapping create(OperationType opType)
Create row mapping for FLUSH operation only.
-
merge
public java.util.Iterator<Pair<ByteComparable,com.carrotsearch.hppc.LongArrayList>> merge(MemtableIndex index)
Link the term ->PrimaryKeys
mappings from a providedMemtableIndex
to thePrimaryKey
-> row ID mappings maintained here inrowMapping
to produce mappings of terms to their postings lists.- Parameters:
index
- a Memtable-attached column index- Returns:
- an iterator of term -> postings list
Pair
s
-
complete
public void complete()
Complete building in memory RowMapping, mark it as immutable.
-
isComplete
public boolean isComplete()
-
add
public void add(PrimaryKey key, long sstableRowId) throws InMemoryTrie.SpaceExhaustedException
Include PrimaryKey to RowId mapping
-
get
public int get(PrimaryKey key)
Returns the SSTable row ID for aPrimaryKey
- Parameters:
key
- thePrimaryKey
- Returns:
- a valid SSTable row ID for the
PrimaryKey
or -1 if thePrimaryKey
doesn't exist in theRowMapping
-
-