Class IndexSummary
java.lang.Object
org.apache.cassandra.utils.concurrent.SharedCloseableImpl
org.apache.cassandra.utils.concurrent.WrappedSharedCloseable
org.apache.cassandra.io.sstable.indexsummary.IndexSummary
- All Implemented Interfaces:
AutoCloseable,SharedCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIndexSummary(IPartitioner partitioner, Memory offsets, int offsetCount, Memory entries, long entriesLength, int sizeAtFullSampling, int minIndexInterval, int samplingLevel) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTo(Ref.IdentityCollection identities) intdoubleintgetEffectiveIndexIntervalAfterIndex(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).longgetEndInSummary(int index) longReturns an estimate of the total number of keys in the SSTable.static intgetIndexFromBinarySearchResult(int binarySearchResult) byte[]getKey(int index) Iterable<byte[]>getKeySamples(Range<Token> range) intReturns 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.intlonglonggetPosition(int index) intgetPositionInSummary(int index) Gets the position of the actual index summary entry in our Memory attribute, 'bytes'.getSampleIndexesForRanges(Collection<Range<Token>> ranges) intlonglonggetScanPositionFromBinarySearchResult(int binarySearchResult) intsize()Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl
close, close, isCleanedUp
-
Field Details
-
serializer
-
-
Constructor Details
-
IndexSummary
public IndexSummary(IPartitioner partitioner, Memory offsets, int offsetCount, Memory entries, long entriesLength, int sizeAtFullSampling, int minIndexInterval, int samplingLevel)
-
-
Method Details
-
binarySearch
-
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) -
addTo
- Specified by:
addToin interfaceSharedCloseable- Overrides:
addToin classSharedCloseableImpl
-
getPosition
public long getPosition(int index) -
getEndInSummary
public long getEndInSummary(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() -
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
-
getSampleIndexesForRanges
-
getKeySamples
-
getScanPosition
-
getScanPositionFromBinarySearchResult
public long getScanPositionFromBinarySearchResult(int binarySearchResult) -
getIndexFromBinarySearchResult
public static int getIndexFromBinarySearchResult(int binarySearchResult)
-