Class StaticTokenTreeBuilder

  • All Implemented Interfaces:
    java.lang.Iterable<Pair<java.lang.Long,​com.carrotsearch.hppc.LongSet>>, TokenTreeBuilder

    public class StaticTokenTreeBuilder
    extends AbstractTokenTreeBuilder
    Intended usage of this class is to be used in place of DynamicTokenTreeBuilder when multiple index segments produced by PerSSTableIndexWriter are stitched together by PerSSTableIndexWriter.complete(). This class uses the RangeIterator, now provided by CombinedTerm.getTokenIterator(), to iterate the data twice. The first iteration builds the tree with leaves that contain only enough information to build the upper layers -- these leaves do not store more than their minimum and maximum tokens plus their total size, which makes them un-serializable. When the tree is written to disk the final layer is not written. Its at this point the data is iterated once again to write the leaves to disk. This (logarithmically) reduces copying of the token values while building and writing upper layers of the tree, removes the use of SortedMap when combining SAs, and relies on the memory mapped SAs otherwise, greatly improving performance and no longer causing OOMs when TokenTree sizes are big. See https://issues.apache.org/jira/browse/CASSANDRA-11383 for more details.
    • Constructor Detail

      • StaticTokenTreeBuilder

        public StaticTokenTreeBuilder​(CombinedTerm term)