Package org.apache.cassandra.io.tries
Interface IncrementalTrieWriter<VALUE>
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
IncrementalDeepTrieWriterPageAware,IncrementalTrieWriterBase,IncrementalTrieWriterPageAware,IncrementalTrieWriterSimple
Common interface for incremental trie writers. Incremental writers take sorted input to construct a trie file while
buffering only limited amount of data.
The writing itself is done by some node serializer passed on construction time.
See org/apache/cassandra/io/sstable/format/bti/BtiFormat.md for a description of the mechanisms of writing
and reading an on-disk trie.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ByteComparable next, VALUE value) Add an entry to the trie with the associated value.voidclose()longcomplete()Complete the process and return the position in the file of the root node.longcount()Return the number of added entries.Make a temporary in-memory representation of the unwritten nodes that covers everything added to the trie until this point.static <VALUE> IncrementalTrieWriter<VALUE>open(TrieSerializer<VALUE, ? super DataOutputPlus> trieSerializer, DataOutputPlus dest) Construct a suitable trie writer.voidreset()
-
Method Details
-
add
Add an entry to the trie with the associated value.- Throws:
IOException
-
count
long count()Return the number of added entries. -
complete
Complete the process and return the position in the file of the root node.- Throws:
IOException
-
reset
void reset() -
close
void close()- Specified by:
closein interfaceAutoCloseable
-
makePartialRoot
Make a temporary in-memory representation of the unwritten nodes that covers everything added to the trie until this point. The object returned represents a "tail" for the file that needs to be attached at the "cutoff" point to the file (using e.g. TailOverridingRebufferer).- Throws:
IOException
-
open
static <VALUE> IncrementalTrieWriter<VALUE> open(TrieSerializer<VALUE, ? super DataOutputPlus> trieSerializer, DataOutputPlus dest) Construct a suitable trie writer.
-