public abstract static class TokenGenerators.AbstractTokenGenerator extends java.lang.Object implements TokenGenerator, java.io.Serializable
checkRangeValid()
at construction time.Modifier and Type | Field and Description |
---|---|
static java.math.BigInteger |
TWO |
Constructor and Description |
---|
TokenGenerators.AbstractTokenGenerator() |
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
getTokenForReplacementNode(java.math.BigInteger oldToken) |
java.util.Set<java.math.BigInteger> |
getTokensForReplacementNode(java.util.Set<java.math.BigInteger> oldTokens) |
void |
growingCluster(int numNewNodes)
Indicates that we are starting a new cluster of the given number of nodes,
so expect that number of consecutive calls to
TokenGenerator.newToken() . |
abstract java.math.BigInteger |
max() |
abstract java.math.BigInteger |
min() |
java.math.BigInteger |
newToken()
Unless we're explicitly starting a new cluster or resizing by a pre-defined number of nodes, then
let Cassandra decide (i.e.
|
abstract java.math.BigInteger |
range() |
void |
refresh(java.util.Set<java.math.BigInteger> currentNodes) |
void |
setOrigin(java.math.BigInteger shift) |
void |
shrinkingCluster(java.util.Set<java.math.BigInteger> nodesToRemove) |
public TokenGenerators.AbstractTokenGenerator()
public abstract java.math.BigInteger max()
max
in interface TokenGenerator
public abstract java.math.BigInteger min()
min
in interface TokenGenerator
public abstract java.math.BigInteger range()
range
in interface TokenGenerator
public void setOrigin(java.math.BigInteger shift)
setOrigin
in interface TokenGenerator
public java.math.BigInteger newToken()
newToken
in interface TokenGenerator
public java.math.BigInteger getTokenForReplacementNode(java.math.BigInteger oldToken)
getTokenForReplacementNode
in interface TokenGenerator
public java.util.Set<java.math.BigInteger> getTokensForReplacementNode(java.util.Set<java.math.BigInteger> oldTokens)
getTokensForReplacementNode
in interface TokenGenerator
public void growingCluster(int numNewNodes)
TokenGenerator
TokenGenerator.newToken()
.growingCluster
in interface TokenGenerator
public void shrinkingCluster(java.util.Set<java.math.BigInteger> nodesToRemove)
shrinkingCluster
in interface TokenGenerator
public void refresh(java.util.Set<java.math.BigInteger> currentNodes)
refresh
in interface TokenGenerator