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.

    • 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 interface java.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