Interface ShardManager
-
- All Known Implementing Classes:
ShardManagerDiskAware
,ShardManagerNoDisks
,ShardManagerTrivial
public interface ShardManager
-
-
Field Summary
Fields Modifier and Type Field Description static double
MINIMUM_TOKEN_COVERAGE
Single-partition, and generally sstables with very few partitions, can cover very small sections of the token space, resulting in very high densities.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ShardTracker
boundaries(int shardCount)
Construct a boundary/shard iterator for the given number of shards.default double
calculateCombinedDensity(java.util.Set<? extends SSTableReader> sstables)
Estimate the density of the sstable that will be the result of compacting the given sources.default int
compareByDensity(SSTableReader a, SSTableReader b)
static Range<Token>
coveringRange(PartitionPosition first, PartitionPosition last)
static Range<Token>
coveringRange(SSTableReader sstable)
static ShardManager
create(ColumnFamilyStore cfs)
default double
density(SSTableReader rdr)
Return the density of an SSTable, i.e.boolean
isOutOfDate(long ringVersion)
double
localSpaceCoverage()
The total fraction of the token space covered by the local ranges.default double
rangeSpanned(PartitionPosition first, PartitionPosition last)
double
rangeSpanned(Range<Token> tableRange)
The token range fraction spanned by the given range, adjusted for the local range ownership.default double
rangeSpanned(SSTableReader rdr)
Return the token space share that the given SSTable spans, excluding any non-locally owned space.double
shardSetCoverage()
The fraction of the token space covered by a shard set, i.e.
-
-
-
Field Detail
-
MINIMUM_TOKEN_COVERAGE
static final double MINIMUM_TOKEN_COVERAGE
Single-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 Detail
-
create
static ShardManager create(ColumnFamilyStore cfs)
-
isOutOfDate
boolean isOutOfDate(long ringVersion)
-
rangeSpanned
double rangeSpanned(Range<Token> tableRange)
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
ShardTracker boundaries(int shardCount)
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, seeCompactionSimulationTest
for a possible implementation.
-
coveringRange
static Range<Token> coveringRange(SSTableReader sstable)
-
coveringRange
static Range<Token> coveringRange(PartitionPosition first, PartitionPosition last)
-
rangeSpanned
default double rangeSpanned(SSTableReader rdr)
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
default double rangeSpanned(PartitionPosition first, PartitionPosition last)
-
density
default double density(SSTableReader rdr)
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
default int compareByDensity(SSTableReader a, SSTableReader b)
-
calculateCombinedDensity
default double calculateCombinedDensity(java.util.Set<? extends SSTableReader> sstables)
Estimate the density of the sstable that will be the result of compacting the given sources.
-
-