Class ShardManagerNoDisks.BoundaryTracker
- java.lang.Object
-
- org.apache.cassandra.db.compaction.ShardManagerNoDisks.BoundaryTracker
-
- All Implemented Interfaces:
ShardTracker
- Enclosing class:
- ShardManagerNoDisks
public class ShardManagerNoDisks.BoundaryTracker extends java.lang.Object implements ShardTracker
-
-
Constructor Summary
Constructors Constructor Description BoundaryTracker(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
advanceTo(Token nextToken)
Advance to the given token (e.g.int
count()
double
fractionInShard(Range<Token> targetSpan)
Returns the fraction of the given token range's coverage that falls within this shard.double
rangeSpanned(PartitionPosition first, PartitionPosition last)
Token
shardEnd()
int
shardIndex()
Range<Token>
shardSpan()
double
shardSpanSize()
Token
shardStart()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.db.compaction.ShardTracker
applyTokenSpaceCoverage, shardAdjustedKeyCount
-
-
-
-
Method Detail
-
shardStart
public Token shardStart()
- Specified by:
shardStart
in interfaceShardTracker
-
shardEnd
public Token shardEnd()
- Specified by:
shardEnd
in interfaceShardTracker
-
shardSpan
public Range<Token> shardSpan()
- Specified by:
shardSpan
in interfaceShardTracker
-
shardSpanSize
public double shardSpanSize()
- Specified by:
shardSpanSize
in interfaceShardTracker
-
advanceTo
public boolean advanceTo(Token nextToken)
Description copied from interface:ShardTracker
Advance to the given token (e.g. before writing a key). Returns true if this resulted in advancing to a new shard, and false otherwise.- Specified by:
advanceTo
in interfaceShardTracker
-
count
public int count()
- Specified by:
count
in interfaceShardTracker
-
fractionInShard
public double fractionInShard(Range<Token> targetSpan)
Description copied from interface:ShardTracker
Returns the fraction of the given token range's coverage that falls within this shard. E.g. if the span covers two shards exactly and the current shard is one of them, it will return 0.5.- Specified by:
fractionInShard
in interfaceShardTracker
-
rangeSpanned
public double rangeSpanned(PartitionPosition first, PartitionPosition last)
- Specified by:
rangeSpanned
in interfaceShardTracker
-
shardIndex
public int shardIndex()
- Specified by:
shardIndex
in interfaceShardTracker
-
-