Package org.apache.cassandra.testing
Class TestTokenSupplier
- java.lang.Object
-
- org.apache.cassandra.testing.TestTokenSupplier
-
public class TestTokenSupplier extends java.lang.ObjectStatic factory holder that provides a token supplier
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTestTokenSupplier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.cassandra.distributed.api.TokenSupplierevenlyDistributedTokens(int numNodesPerDC, int newNodesPerDC, int numDcs, int numTokensPerNode)Tokens are allocation used in tests to simulate token allocation nodes for an approx even distribution in a multiDC environment with neighboring nodes different DCs allocated adjacent tokens.static org.apache.cassandra.distributed.api.TokenSupplierevenlyDistributedTokens(Partitioner partitioner, int numNodesPerDC, int newNodesPerDC, int numDcs, int numTokensPerNode)Tokens are allocation used in tests to simulate token allocation nodes for an approx even distribution in a multiDC environment with neighboring nodes different DCs allocated adjacent tokens.
-
-
-
Method Detail
-
evenlyDistributedTokens
public static org.apache.cassandra.distributed.api.TokenSupplier evenlyDistributedTokens(int numNodesPerDC, int newNodesPerDC, int numDcs, int numTokensPerNode)Tokens are allocation used in tests to simulate token allocation nodes for an approx even distribution in a multiDC environment with neighboring nodes different DCs allocated adjacent tokens. Allocations for new nodes are interleaved among existing tokens. Usings the Murmur3 Partitioner to allocate tokens.- Parameters:
numNodesPerDC- number of nodes from a single DCnewNodesPerDC- number of additional nodes for a DCnumDcs- no. of datacentersnumTokensPerNode- no. tokens allocated to each node (this is always 1 if there are no vnodes)- Returns:
- The token supplier that vends the tokens
-
evenlyDistributedTokens
public static org.apache.cassandra.distributed.api.TokenSupplier evenlyDistributedTokens(Partitioner partitioner, int numNodesPerDC, int newNodesPerDC, int numDcs, int numTokensPerNode)
Tokens are allocation used in tests to simulate token allocation nodes for an approx even distribution in a multiDC environment with neighboring nodes different DCs allocated adjacent tokens. Allocations for new nodes are interleaved among existing tokens.- Parameters:
partitioner- the partitioner to use for token allocationnumNodesPerDC- number of nodes from a single DCnewNodesPerDC- number of additional nodes for a DCnumDcs- no. of datacentersnumTokensPerNode- no. tokens allocated to each node (this is always 1 if there are no vnodes)- Returns:
- The token supplier that vends the tokens
-
-