Class TestTokenSupplier


  • public class TestTokenSupplier
    extends java.lang.Object
    Static factory holder that provides a token supplier
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TestTokenSupplier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestTokenSupplier

        protected TestTokenSupplier()
    • 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 DC
        newNodesPerDC - number of additional nodes for a DC
        numDcs - no. of datacenters
        numTokensPerNode - 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 allocation
        numNodesPerDC - number of nodes from a single DC
        newNodesPerDC - number of additional nodes for a DC
        numDcs - no. of datacenters
        numTokensPerNode - no. tokens allocated to each node (this is always 1 if there are no vnodes)
        Returns:
        The token supplier that vends the tokens