Package org.apache.cassandra.dht
Class Splitter
java.lang.Object
org.apache.cassandra.dht.Splitter
Partition splitter.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BigIntegerelapsedTokens(Token token, Range<Token> range) Computes the number of elapsed tokens from the range start until this tokendoublepositionInRange(Token token, Range<Token> range) Computes the normalized position of this token relative to this rangesplit(Collection<Range<Token>> ranges, int parts) Splits the specified token ranges in at leastpartssubranges.splitOwnedRanges(int parts, List<Splitter.WeightedRange> weightedRanges, boolean dontSplitRanges) protected abstract TokentokenForValue(BigInteger value) protected BigIntegertokensInRange(Range<Token> range) protected abstract BigIntegervalueForToken(Token token)
-
Constructor Details
-
Splitter
-
-
Method Details
-
tokenForValue
-
valueForToken
-
tokensInRange
-
elapsedTokens
Computes the number of elapsed tokens from the range start until this token- Returns:
- the number of tokens from the range start to the token
-
positionInRange
Computes the normalized position of this token relative to this range- Returns:
- A number between 0.0 and 1.0 representing this token's position in this range or -1.0 if this range doesn't contain this token.
-
splitOwnedRanges
public List<Token> splitOwnedRanges(int parts, List<Splitter.WeightedRange> weightedRanges, boolean dontSplitRanges) -
split
Splits the specified token ranges in at leastpartssubranges.Each returned subrange will be contained in exactly one of the specified ranges.
- Parameters:
ranges- a collection of token ranges to be splitparts- the minimum number of returned ranges- Returns:
- at least
minPartstoken ranges coveringranges
-