org.apache.cassandra.io.sstable

## Class IndexSummaryBuilder

- java.lang.Object
- - org.apache.cassandra.io.sstable.IndexSummaryBuilder

    public class IndexSummaryBuilder
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`IndexSummaryBuilder(long expectedKeys, int minIndexInterval, int samplingLevel)`

### Method Summary

Methods
`IndexSummary` `build(IPartitioner partitioner)`
`IndexSummary` `build(IPartitioner partitioner, DecoratedKey exclusiveUpperBound)`
`static int` `calculateSamplingLevel(int currentSamplingLevel, int currentNumEntries, long targetNumEntries, int minIndexInterval, int maxIndexInterval)`
`static IndexSummary` `downsample(IndexSummary existing, int newSamplingLevel, int minIndexInterval, IPartitioner partitioner)` Downsamples an existing index summary to a new sampling level.
`static int` `entriesAtSamplingLevel(int samplingLevel, int maxSummarySize)`
`DecoratedKey` `getMaxReadableKey(long position, int offset)`
`IndexSummaryBuilder` `maybeAddEntry(DecoratedKey decoratedKey, long indexPosition)`

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

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

### Constructor Detail

#### IndexSummaryBuilder

    public IndexSummaryBuilder(long expectedKeys,
                       int minIndexInterval,
                       int samplingLevel)

### Method Detail

#### getMaxReadableKey

    public DecoratedKey getMaxReadableKey(long position,
                                 int offset)

#### maybeAddEntry

    public IndexSummaryBuilder maybeAddEntry(DecoratedKey decoratedKey,
                                    long indexPosition)

#### build

    public IndexSummary build(IPartitioner partitioner)

#### build

    public IndexSummary build(IPartitioner partitioner,
                     DecoratedKey exclusiveUpperBound)

#### entriesAtSamplingLevel

    public static int entriesAtSamplingLevel(int samplingLevel,
                             int maxSummarySize)

#### calculateSamplingLevel

    public static int calculateSamplingLevel(int currentSamplingLevel,
                             int currentNumEntries,
                             long targetNumEntries,
                             int minIndexInterval,
                             int maxIndexInterval)

#### downsample

    public static IndexSummary downsample(IndexSummary existing,
                          int newSamplingLevel,
                          int minIndexInterval,
                          IPartitioner partitioner)

Downsamples an existing index summary to a new sampling level.

Parameters:
  `existing` - an existing IndexSummary
  `newSamplingLevel` - the target level for the new IndexSummary. This must be less than the current sampling level for `existing`.
  `partitioner` - the partitioner used for the index summary
Returns:
  a new IndexSummary