org.apache.cassandra.index.sasi.disk

## Class AbstractTokenTreeBuilder

- java.lang.Object
- - org.apache.cassandra.index.sasi.disk.AbstractTokenTreeBuilder

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

Direct Known Subclasses:
  DynamicTokenTreeBuilder, StaticTokenTreeBuilder

    public abstract class AbstractTokenTreeBuilder
    extends java.lang.Object
    implements TokenTreeBuilder

### Nested Class Summary

Nested Classes
`protected class` `AbstractTokenTreeBuilder.InteriorNode`
`protected class` `AbstractTokenTreeBuilder.Leaf`
`static class` `AbstractTokenTreeBuilder.LevelIterator`
`protected class` `AbstractTokenTreeBuilder.Node`

### Nested classes/interfaces inherited from interface org.apache.cassandra.index.sasi.disk.TokenTreeBuilder

`TokenTreeBuilder.EntryType`

### Field Summary

Fields
`protected AbstractTokenTreeBuilder.Leaf` `leftmostLeaf`
`protected int` `numBlocks`
`protected AbstractTokenTreeBuilder.Leaf` `rightmostLeaf`
`protected AbstractTokenTreeBuilder.InteriorNode` `rightmostParent`
`protected AbstractTokenTreeBuilder.Node` `root`
`protected long` `tokenCount`
`protected long` `treeMaxToken`
`protected long` `treeMinToken`

### Fields inherited from interface org.apache.cassandra.index.sasi.disk.TokenTreeBuilder

`AB_MAGIC, BLOCK_BYTES, BLOCK_ENTRY_BYTES, BLOCK_HEADER_BYTES, ENTRY_TYPE_MASK, LAST_LEAF_SHIFT, MAX_OFFSET, OVERFLOW_ENTRY_BYTES, OVERFLOW_TRAILER_BYTES, OVERFLOW_TRAILER_CAPACITY, SHARED_HEADER_BYTES, TOKENS_PER_BLOCK`

### Constructor Summary

Constructors
Constructor and Description
`AbstractTokenTreeBuilder()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`void` `add(TokenTreeBuilder other)`
`protected static void` `alignBuffer(java.nio.ByteBuffer buffer, int blockSize)`
`protected abstract void` `constructTree()`
`TokenTreeBuilder` `finish()`
`protected void` `flushBuffer(java.nio.ByteBuffer buffer, DataOutputPlus o, boolean align)`
`long` `getTokenCount()`
`int` `serializedSize()`
`void` `write(DataOutputPlus out)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.cassandra.index.sasi.disk.TokenTreeBuilder

`add, add, add, isEmpty`

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

### Field Detail

#### numBlocks

    protected int numBlocks

#### root

    protected AbstractTokenTreeBuilder.Node root

#### rightmostParent

    protected AbstractTokenTreeBuilder.InteriorNode rightmostParent

#### leftmostLeaf

    protected AbstractTokenTreeBuilder.Leaf leftmostLeaf

#### rightmostLeaf

    protected AbstractTokenTreeBuilder.Leaf rightmostLeaf

#### tokenCount

    protected long tokenCount

#### treeMinToken

    protected long treeMinToken

#### treeMaxToken

    protected long treeMaxToken

### Constructor Detail

#### AbstractTokenTreeBuilder

    public AbstractTokenTreeBuilder()

### Method Detail

#### add

    public void add(TokenTreeBuilder other)

Specified by:
  `add` in interface `TokenTreeBuilder`

#### finish

    public TokenTreeBuilder finish()

Specified by:
  `finish` in interface `TokenTreeBuilder`

#### getTokenCount

    public long getTokenCount()

Specified by:
  `getTokenCount` in interface `TokenTreeBuilder`

#### serializedSize

    public int serializedSize()

Specified by:
  `serializedSize` in interface `TokenTreeBuilder`

#### write

    public void write(DataOutputPlus out)
               throws java.io.IOException

Specified by:
  `write` in interface `TokenTreeBuilder`
Throws:
  `java.io.IOException`

#### constructTree

    protected abstract void constructTree()

#### flushBuffer

    protected void flushBuffer(java.nio.ByteBuffer buffer,
                               DataOutputPlus o,
                               boolean align)
                        throws java.io.IOException

Throws:
  `java.io.IOException`

#### alignBuffer

    protected static void alignBuffer(java.nio.ByteBuffer buffer,
                                      int blockSize)