public class IndexSummaryBuilder
extends java.lang.Object
Constructor and Description |
---|
IndexSummaryBuilder(long expectedKeys,
int minIndexInterval,
int samplingLevel) |
Modifier and Type | Method and Description |
---|---|
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) |
public IndexSummaryBuilder(long expectedKeys, int minIndexInterval, int samplingLevel)
public DecoratedKey getMaxReadableKey(long position, int offset)
public IndexSummaryBuilder maybeAddEntry(DecoratedKey decoratedKey, long indexPosition)
public IndexSummary build(IPartitioner partitioner)
public IndexSummary build(IPartitioner partitioner, DecoratedKey exclusiveUpperBound)
public static int entriesAtSamplingLevel(int samplingLevel, int maxSummarySize)
public static int calculateSamplingLevel(int currentSamplingLevel, int currentNumEntries, long targetNumEntries, int minIndexInterval, int maxIndexInterval)
public static IndexSummary downsample(IndexSummary existing, int newSamplingLevel, int minIndexInterval, IPartitioner partitioner)
existing
- an existing IndexSummarynewSamplingLevel
- 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 summaryCopyright © 2014 The Apache Software Foundation