ColumnIndex.Builder (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db

## Class ColumnIndex.Builder

- java.lang.Object
- - org.apache.cassandra.db.ColumnIndex.Builder

- Enclosing class:
    ColumnIndex

      public static class ColumnIndex.Builder
      extends java.lang.Object

  Help to create an index for a column family based on size of columns, and write said columns to disk.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ColumnIndex.Builder(ColumnFamily cf, java.nio.ByteBuffer key, DataOutputPlus output)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(OnDiskAtom column)`
    `ColumnIndex` | `build()`
    `ColumnIndex` | `build(ColumnFamily cf)` Serializes the index into in-memory structure with all required components such as Bloom Filter, index block size, IndexInfo list
    `ColumnIndex` | `buildForCompaction(java.util.Iterator<OnDiskAtom> columns)` The important distinction wrt build() is that we may be building for a row that ends up being compacted away entirely, i.e., the input consists only of expired tombstones (or columns shadowed by expired tombstone).
    `void` | `maybeWriteEmptyRowHeader()`
    `RangeTombstone.Tracker` | `tombstoneTracker()`
    `int` | `writtenAtomCount()`

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

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

- - ### Constructor Detail

    - #### ColumnIndex.Builder

          public ColumnIndex.Builder(ColumnFamily cf,
                             java.nio.ByteBuffer key,
                             DataOutputPlus output)

  - ### Method Detail

    - #### tombstoneTracker

          public RangeTombstone.Tracker tombstoneTracker()

    - #### writtenAtomCount

          public int writtenAtomCount()

    - #### build

          public ColumnIndex build(ColumnFamily cf)
                            throws java.io.IOException

      Serializes the index into in-memory structure with all required components such as Bloom Filter, index block size, IndexInfo list
      Parameters:
        `cf` - Column family to create index for
      Returns:
        information about index - it's Bloom Filter, block size and IndexInfo list
      Throws:
        `java.io.IOException`

    - #### buildForCompaction

          public ColumnIndex buildForCompaction(java.util.Iterator<OnDiskAtom> columns)
                                         throws java.io.IOException

      The important distinction wrt build() is that we may be building for a row that ends up being compacted away entirely, i.e., the input consists only of expired tombstones (or columns shadowed by expired tombstone). Thus, it is the caller's responsibility to decide whether to write the header for an empty row.
      Throws:
        `java.io.IOException`

    - #### add

          public void add(OnDiskAtom column)
                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### build

          public ColumnIndex build()

    - #### maybeWriteEmptyRowHeader

          public void maybeWriteEmptyRowHeader()
                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2014 The Apache Software Foundation