Interface ShardManager
- All Known Implementing Classes:
ShardManagerDiskAware,ShardManagerNoDisks,ShardManagerTrivial
public interface ShardManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleSingle-partition, and generally sstables with very few partitions, can cover very small sections of the token space, resulting in very high densities. -
Method Summary
Modifier and TypeMethodDescriptionboundaries(int shardCount) Construct a boundary/shard iterator for the given number of shards.default doublecalculateCombinedDensity(Set<? extends SSTableReader> sstables) Estimate the density of the sstable that will be the result of compacting the given sources.default intcoveringRange(PartitionPosition first, PartitionPosition last) coveringRange(SSTableReader sstable) static ShardManagercreate(ColumnFamilyStore cfs) default doubledensity(SSTableReader rdr) Return the density of an SSTable, i.e.booleanisOutOfDate(long ringVersion) doubleThe total fraction of the token space covered by the local ranges.default doublerangeSpanned(PartitionPosition first, PartitionPosition last) doublerangeSpanned(Range<Token> tableRange) The token range fraction spanned by the given range, adjusted for the local range ownership.default doubleReturn the token space share that the given SSTable spans, excluding any non-locally owned space.doubleThe fraction of the token space covered by a shard set, i.e.
-
Field Details
-
MINIMUM_TOKEN_COVERAGE
static final double MINIMUM_TOKEN_COVERAGESingle-partition, and generally sstables with very few partitions, can cover very small sections of the token space, resulting in very high densities. Additionally, sstables that have completely fallen outside of the local token ranges will end up with a zero coverage. To avoid problems with both we check if coverage is below the minimum, and replace it with 1.
-
-
Method Details
-
create
-
isOutOfDate
boolean isOutOfDate(long ringVersion) -
rangeSpanned
The token range fraction spanned by the given range, adjusted for the local range ownership. -
localSpaceCoverage
double localSpaceCoverage()The total fraction of the token space covered by the local ranges. -
shardSetCoverage
double shardSetCoverage()The fraction of the token space covered by a shard set, i.e. the space that is split in the requested number of shards. If no disks are defined, this is the same as localSpaceCoverage(). Otherwise, it is the token coverage of a disk. -
boundaries
Construct a boundary/shard iterator for the given number of shards. Note: This does not offer a method of listing the shard boundaries it generates, just to advance to the corresponding one for a given token. The only usage for listing is currently in tests. Should a need for this arise, seeCompactionSimulationTestfor a possible implementation. -
coveringRange
-
coveringRange
-
rangeSpanned
Return the token space share that the given SSTable spans, excluding any non-locally owned space. Returns a positive floating-point number between 0 and 1. -
rangeSpanned
-
density
Return the density of an SSTable, i.e. its size divided by the covered token space share. This is an improved measure of the compaction age of an SSTable that grows both with STCS-like full-SSTable compactions (where size grows, share is constant), LCS-like size-threshold splitting (where size is constant but share shrinks), UCS-like compactions (where size may grow and covered shards i.e. share may decrease) and can reproduce levelling structure that corresponds to all, including their mixtures. -
compareByDensity
-
calculateCombinedDensity
Estimate the density of the sstable that will be the result of compacting the given sources.
-