Class IncrementalTrieWriterSimple<VALUE>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, IncrementalTrieWriter<VALUE>

    @NotThreadSafe
    public class IncrementalTrieWriterSimple<VALUE>
    extends IncrementalTrieWriterBase<VALUE,​DataOutputPlus,​org.apache.cassandra.io.tries.IncrementalTrieWriterSimple.Node<VALUE>>
    implements IncrementalTrieWriter<VALUE>
    Incremental builder of on-disk tries. Takes sorted input.

    Incremental building is done by maintaining a stack of nodes in progress which follows the path to reach the last added entry. When a new entry is needed, comparison with the previous can tell us how much of the parents stack remains the same. The rest of the stack is complete as no new entry can affect them due to the input sorting. The completed nodes can be written to disk and discarded, keeping only a pointer to their location in the file (this pointer will be discarded too when the parent node is completed). This ensures that a very limited amount of data is kept in memory at all times.

    Note: This class is currently unused (but tested) and stands only as form of documentation for IncrementalTrieWriterPageAware.