IndexSummary (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.io.sstable

## Class IndexSummary

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

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class IndexSummary
      extends java.lang.Object
      implements java.io.Closeable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IndexSummary.IndexSummarySerializer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static IndexSummary.IndexSummarySerializer` | `serializer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexSummary(IPartitioner partitioner, RefCountedMemory memory, int summarySize, int sizeAtFullSampling, int minIndexInterval, int samplingLevel)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `binarySearch(RowPosition key)`
    `void` | `close()`
    `double` | `getEffectiveIndexInterval()`
    `int` | `getEffectiveIndexIntervalAfterIndex(int index)` Returns the number of primary (on-disk) index entries between the index summary entry at `index` and the next index summary entry (assuming there is one).
    `byte[]` | `getEntry(int index)`
    `long` | `getEstimatedKeyCount()` Returns an estimate of the total number of keys in the SSTable.
    `byte[]` | `getKey(int index)`
    `int` | `getMaxNumberOfEntries()` Returns the number of entries this summary would have if it were at the full sampling level, which is equal to the number of entries in the primary on-disk index divided by the min index interval.
    `int` | `getMinIndexInterval()`
    `long` | `getOffHeapSize()` Returns the amount of off-heap memory used for this summary.
    `long` | `getPosition(int index)`
    `int` | `getPositionInSummary(int index)` Gets the position of the actual index summary entry in our Memory attribute, 'bytes'.
    `int` | `getSamplingLevel()`
    `IndexSummary` | `readOnlyClone()`
    `int` | `size()`

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

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

- - ### Field Detail

    - #### serializer

          public static final IndexSummary.IndexSummarySerializer serializer

  - ### Constructor Detail

    - #### IndexSummary

          public IndexSummary(IPartitioner partitioner,
                      RefCountedMemory memory,
                      int summarySize,
                      int sizeAtFullSampling,
                      int minIndexInterval,
                      int samplingLevel)

  - ### Method Detail

    - #### binarySearch

          public int binarySearch(RowPosition key)

    - #### getPositionInSummary

          public int getPositionInSummary(int index)

      Gets the position of the actual index summary entry in our Memory attribute, 'bytes'.
      Parameters:
        `index` - The index of the entry or key to get the position for
      Returns:
        an offset into our Memory attribute where the actual entry resides

    - #### getKey

          public byte[] getKey(int index)

    - #### getPosition

          public long getPosition(int index)

    - #### getEntry

          public byte[] getEntry(int index)

    - #### getMinIndexInterval

          public int getMinIndexInterval()

    - #### getEffectiveIndexInterval

          public double getEffectiveIndexInterval()

    - #### getEstimatedKeyCount

          public long getEstimatedKeyCount()

      Returns an estimate of the total number of keys in the SSTable.

    - #### size

          public int size()

    - #### getSamplingLevel

          public int getSamplingLevel()

    - #### getMaxNumberOfEntries

          public int getMaxNumberOfEntries()

      Returns the number of entries this summary would have if it were at the full sampling level, which is equal to the number of entries in the primary on-disk index divided by the min index interval.

    - #### getOffHeapSize

          public long getOffHeapSize()

      Returns the amount of off-heap memory used for this summary.
      Returns:
        size in bytes

    - #### getEffectiveIndexIntervalAfterIndex

          public int getEffectiveIndexIntervalAfterIndex(int index)

      Returns the number of primary (on-disk) index entries between the index summary entry at `index` and the next index summary entry (assuming there is one). Without any downsampling, this will always be equivalent to the index interval.
      Parameters:
        `index` - the index of an index summary entry (between zero and the index entry size)
      Returns:
        the number of partitions after `index` until the next partition with a summary entry

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

    - #### readOnlyClone

          public IndexSummary readOnlyClone()

Copyright © 2014 The Apache Software Foundation