Package org.apache.cassandra.io.tries
Interface IncrementalTrieWriter<VALUE>
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
IncrementalDeepTrieWriterPageAware
,IncrementalTrieWriterBase
,IncrementalTrieWriterPageAware
,IncrementalTrieWriterSimple
public interface IncrementalTrieWriter<VALUE> extends java.lang.AutoCloseable
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 Modifier and Type Interface Description static interface
IncrementalTrieWriter.PartialTail
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(ByteComparable next, VALUE value)
Add an entry to the trie with the associated value.void
close()
long
complete()
Complete the process and return the position in the file of the root node.long
count()
Return the number of added entries.IncrementalTrieWriter.PartialTail
makePartialRoot()
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.void
reset()
-
-
-
Method Detail
-
add
void add(ByteComparable next, VALUE value) throws java.io.IOException
Add an entry to the trie with the associated value.- Throws:
java.io.IOException
-
count
long count()
Return the number of added entries.
-
complete
long complete() throws java.io.IOException
Complete the process and return the position in the file of the root node.- Throws:
java.io.IOException
-
reset
void reset()
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
makePartialRoot
IncrementalTrieWriter.PartialTail makePartialRoot() throws java.io.IOException
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:
java.io.IOException
-
open
static <VALUE> IncrementalTrieWriter<VALUE> open(TrieSerializer<VALUE,? super DataOutputPlus> trieSerializer, DataOutputPlus dest)
Construct a suitable trie writer.
-
-