Package org.apache.cassandra.io.tries
Class IncrementalTrieWriterBase<VALUE,DEST,NODE extends org.apache.cassandra.io.tries.IncrementalTrieWriterBase.BaseNode<VALUE,NODE>>
java.lang.Object
org.apache.cassandra.io.tries.IncrementalTrieWriterBase<VALUE,DEST,NODE>
- All Implemented Interfaces:
AutoCloseable,IncrementalTrieWriter<VALUE>
- Direct Known Subclasses:
IncrementalTrieWriterPageAware,IncrementalTrieWriterSimple
public abstract class IncrementalTrieWriterBase<VALUE,DEST,NODE extends org.apache.cassandra.io.tries.IncrementalTrieWriterBase.BaseNode<VALUE,NODE>>
extends Object
implements IncrementalTrieWriter<VALUE>
Helper base class for incremental trie builders.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.io.tries.IncrementalTrieWriter
IncrementalTrieWriter.PartialTail -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DESTprotected ByteComparableprotected final TrieSerializer<VALUE,? super DEST> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIncrementalTrieWriterBase(TrieSerializer<VALUE, ? super DEST> serializer, DEST dest, NODE root) -
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.protected NODElongcount()Return the number of added entries.abstract IncrementalTrieWriter.PartialTailMake a temporary in-memory representation of the unwritten nodes that covers everything added to the trie until this point.protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.io.tries.IncrementalTrieWriter
reset
-
Field Details
-
stack
-
serializer
-
dest
-
prev
-
-
Constructor Details
-
IncrementalTrieWriterBase
protected IncrementalTrieWriterBase(TrieSerializer<VALUE, ? super DEST> serializer, DEST dest, NODE root)
-
-
Method Details
-
reset
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIncrementalTrieWriter<VALUE>
-
add
Description copied from interface:IncrementalTrieWriterAdd an entry to the trie with the associated value.- Specified by:
addin interfaceIncrementalTrieWriter<VALUE>- Throws:
IOException
-
complete
Description copied from interface:IncrementalTrieWriterComplete the process and return the position in the file of the root node.- Specified by:
completein interfaceIncrementalTrieWriter<VALUE>- Throws:
IOException
-
count
public long count()Description copied from interface:IncrementalTrieWriterReturn the number of added entries.- Specified by:
countin interfaceIncrementalTrieWriter<VALUE>
-
completeLast
- Throws:
IOException
-
makePartialRoot
Description copied from interface:IncrementalTrieWriterMake 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).- Specified by:
makePartialRootin interfaceIncrementalTrieWriter<VALUE>- Throws:
IOException
-