public static byte [ ] getConfigureBytes ( int partitionCount , int tokenCount ) { Preconditions . checkArgument ( partitionCount > 0 ) ; Preconditions . checkArgument ( tokenCount > partitionCount ) ; Buckets buckets = new Buckets ( partitionCount , tokenCount ) ; ElasticHashinator hashinator = new ElasticHashinator ( buckets . getTokens ( ) ) ; return hashinator . getConfigBytes ( ) ; }
Convenience method for generating a deterministic token distribution for the ring based on a given partition count and tokens per partition . Each partition will have N tokens placed randomly on the ring .