org.apache.cassandra.index.sasi.disk

## Class OnDiskIndexBuilder

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

    public class OnDiskIndexBuilder
    extends java.lang.Object

### Nested Class Summary

Nested Classes
`static class` `OnDiskIndexBuilder.Mode`
`static class` `OnDiskIndexBuilder.TermSize`

### Field Summary

Fields
`static int` `BLOCK_SIZE`
`static int` `IS_PARTIAL_BIT`
`static int` `MAX_TERM_SIZE`
`static int` `SUPER_BLOCK_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`OnDiskIndexBuilder(AbstractType<?> keyComparator, AbstractType<?> comparator, OnDiskIndexBuilder.Mode mode)`
`OnDiskIndexBuilder(AbstractType<?> keyComparator, AbstractType<?> comparator, OnDiskIndexBuilder.Mode mode, boolean marksPartials)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`OnDiskIndexBuilder` `add(java.nio.ByteBuffer term, DecoratedKey key, long keyPosition)`
`protected static void` `alignToBlock(SequentialWriter out)`
`long` `estimatedMemoryUse()`
`protected boolean` `finish(Descriptor descriptor, java.io.File file)`
`protected void` `finish(Descriptor descriptor, Pair<java.nio.ByteBuffer,java.nio.ByteBuffer> range, java.io.File file, TermIterator terms)`
`boolean` `finish(java.io.File indexFile)` Finishes up index building process by creating/populating index file.
`void` `finish(Pair<java.nio.ByteBuffer,java.nio.ByteBuffer> range, java.io.File file, TermIterator terms)`
`boolean` `isEmpty()`

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

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

### Field Detail

#### BLOCK_SIZE

    public static final int BLOCK_SIZE

See Also:
  Constant Field Values

#### MAX_TERM_SIZE

    public static final int MAX_TERM_SIZE

See Also:
  Constant Field Values

#### SUPER_BLOCK_SIZE

    public static final int SUPER_BLOCK_SIZE

See Also:
  Constant Field Values

#### IS_PARTIAL_BIT

    public static final int IS_PARTIAL_BIT

See Also:
  Constant Field Values

### Constructor Detail

#### OnDiskIndexBuilder

    public OnDiskIndexBuilder(AbstractType<?> keyComparator,
                              AbstractType<?> comparator,
                              OnDiskIndexBuilder.Mode mode)

#### OnDiskIndexBuilder

    public OnDiskIndexBuilder(AbstractType<?> keyComparator,
                              AbstractType<?> comparator,
                              OnDiskIndexBuilder.Mode mode,
                              boolean marksPartials)

### Method Detail

#### add

    public OnDiskIndexBuilder add(java.nio.ByteBuffer term,
                                  DecoratedKey key,
                                  long keyPosition)

#### estimatedMemoryUse

    public long estimatedMemoryUse()

#### isEmpty

    public boolean isEmpty()

#### finish

    public void finish(Pair<java.nio.ByteBuffer,java.nio.ByteBuffer> range,
                       java.io.File file,
                       TermIterator terms)

#### finish

    public boolean finish(java.io.File indexFile)
                   throws FSWriteError

Finishes up index building process by creating/populating index file.

Parameters:
  `indexFile` - The file to write index contents to.
Returns:
  true if index was written successfully, false otherwise (e.g. if index was empty).
Throws:
  `FSWriteError` - on I/O error.

#### finish

    protected boolean finish(Descriptor descriptor,
                             java.io.File file)
                      throws FSWriteError

Throws:
  `FSWriteError`

#### finish

    protected void finish(Descriptor descriptor,
                          Pair<java.nio.ByteBuffer,java.nio.ByteBuffer> range,
                          java.io.File file,
                          TermIterator terms)

#### alignToBlock

    protected static void alignToBlock(SequentialWriter out)
                                throws java.io.IOException

Throws:
  `java.io.IOException`