Class RowIndexReader
java.lang.Object
org.apache.cassandra.io.tries.Walker<RowIndexReader>
org.apache.cassandra.io.sstable.format.bti.RowIndexReader
- All Implemented Interfaces:
AutoCloseable
Reader class for row index files created by
RowIndexWriter.
Row index "tries" do not need to store whole keys, as what we need from them is to be able to tell where in the data file to start looking for a given key. Instead, we store some prefix that is greater than the greatest key of the previous index section and smaller than or equal to the smallest key of the next. So for a given key the first index section that could potentially contain it is given by the trie's floor for that key.
This builds upon the trie Walker class which provides basic trie walking functionality. The class is thread-unsafe
and must be re-instantiated for every thread that needs access to the trie (its overhead is below that of a
RandomAccessReader).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.cassandra.io.tries.Walker
Walker.Extractor<RESULT,VALUE>, Walker.PayloadToString, Walker.TransitionBytesCollector -
Field Summary
FieldsFields inherited from class org.apache.cassandra.io.tries.Walker
buf, BYTE_COMPARABLE_VERSION, greaterBranch, lesserBranch, nodeType, NONE, position, root -
Constructor Summary
ConstructorsConstructorDescriptionRowIndexReader(FileHandle file, long root, Version version) RowIndexReader(FileHandle file, org.apache.cassandra.io.sstable.format.bti.TrieIndexEntry entry, Version version) -
Method Summary
Modifier and TypeMethodDescriptionvoiddumpTrie(PrintStream out) protected RowIndexReader.IndexInfomin()protected RowIndexReader.IndexInforeadPayload(int ppos, int bits) Computes the floor for a given key.Methods inherited from class org.apache.cassandra.io.tries.Walker
close, dumpTrie, follow, followWithGreater, followWithLesser, getMaxTerm, getMinTerm, go, goMax, goMin, greaterTransition, hasChildren, hasPayload, lastTransition, lesserTransition, nodeSize, nodeTypeOrdinal, payloadFlags, payloadPosition, prefix, prefixAndNeighbours, search, toString, transition, transitionByte, transitionRange
-
Field Details
-
version
-
-
Constructor Details
-
RowIndexReader
-
RowIndexReader
public RowIndexReader(FileHandle file, org.apache.cassandra.io.sstable.format.bti.TrieIndexEntry entry, Version version)
-
-
Method Details
-
separatorFloor
Computes the floor for a given key.- Throws:
IOException
-
min
- Throws:
IOException
-
getCurrentIndexInfo
- Throws:
IOException
-
readPayload
- Throws:
IOException
-
dumpTrie
- Throws:
IOException
-