Class RotationShardShuffler


  • public class RotationShardShuffler
    extends ShardShuffler
    Basic ShardShuffler implementation that uses an AtomicInteger to generate seeds and uses a rotation to permute shards.
    • Method Summary

      Modifier and Type Method Description
      int nextSeed()
      Return a new seed.
      java.util.List<ShardRouting> shuffle​(java.util.List<ShardRouting> shards, int seed)
      Return a shuffled view over the list of shards.
      • Methods inherited from class java.lang.Object

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

      • RotationShardShuffler

        public RotationShardShuffler​(int seed)
    • Method Detail

      • shuffle

        public java.util.List<ShardRouting> shuffle​(java.util.List<ShardRouting> shards,
                                                    int seed)
        Description copied from class: ShardShuffler
        Return a shuffled view over the list of shards. The behavior of this method must be deterministic: if the same list and the same seed are provided twice, then the result needs to be the same.
        Specified by:
        shuffle in class ShardShuffler