public ShardIterator preferAttributesActiveInitializingShardsIt(List<String> attributes, DiscoveryNodes nodes, int seed) { AttributesKey key = new AttributesKey(attributes); AttributesRoutings activeRoutings = getActiveAttribute(key, nodes); AttributesRoutings initializingRoutings = getInitializingAttribute(key, nodes); // we now randomize, once between the ones that have the same attributes, and once for the ones that don't // we don't want to mix between the two! ArrayList<ShardRouting> ordered = new ArrayList<>(activeRoutings.totalSize + initializingRoutings.totalSize); ordered.addAll(shuffler.shuffle(activeRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(activeRoutings.withoutSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withoutSameAttribute, seed)); return new PlainShardIterator(shardId, ordered); }
public ShardIterator preferAttributesActiveInitializingShardsIt(String[] attributes, DiscoveryNodes nodes, int seed) { AttributesKey key = new AttributesKey(attributes); AttributesRoutings activeRoutings = getActiveAttribute(key, nodes); AttributesRoutings initializingRoutings = getInitializingAttribute(key, nodes); // we now randomize, once between the ones that have the same attributes, and once for the ones that don't // we don't want to mix between the two! ArrayList<ShardRouting> ordered = new ArrayList<>(activeRoutings.totalSize + initializingRoutings.totalSize); ordered.addAll(shuffler.shuffle(activeRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(activeRoutings.withoutSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withoutSameAttribute, seed)); return new PlainShardIterator(shardId, ordered); }
public ShardIterator preferAttributesActiveInitializingShardsIt(String[] attributes, DiscoveryNodes nodes, int seed) { AttributesKey key = new AttributesKey(attributes); AttributesRoutings activeRoutings = getActiveAttribute(key, nodes); AttributesRoutings initializingRoutings = getInitializingAttribute(key, nodes); // we now randomize, once between the ones that have the same attributes, and once for the ones that don't // we don't want to mix between the two! ArrayList<ShardRouting> ordered = new ArrayList<>(activeRoutings.totalSize + initializingRoutings.totalSize); ordered.addAll(shuffler.shuffle(activeRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(activeRoutings.withoutSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withoutSameAttribute, seed)); return new PlainShardIterator(shardId, ordered); }
public ShardIterator preferAttributesActiveInitializingShardsIt(List<String> attributes, DiscoveryNodes nodes, int seed) { AttributesKey key = new AttributesKey(attributes); AttributesRoutings activeRoutings = getActiveAttribute(key, nodes); AttributesRoutings initializingRoutings = getInitializingAttribute(key, nodes); // we now randomize, once between the ones that have the same attributes, and once for the ones that don't // we don't want to mix between the two! ArrayList<ShardRouting> ordered = new ArrayList<>(activeRoutings.totalSize + initializingRoutings.totalSize); ordered.addAll(shuffler.shuffle(activeRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(activeRoutings.withoutSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withoutSameAttribute, seed)); return new PlainShardIterator(shardId, ordered); }
public ShardIterator preferAttributesActiveInitializingShardsIt(List<String> attributes, DiscoveryNodes nodes, int seed) { AttributesKey key = new AttributesKey(attributes); AttributesRoutings activeRoutings = getActiveAttribute(key, nodes); AttributesRoutings initializingRoutings = getInitializingAttribute(key, nodes); // we now randomize, once between the ones that have the same attributes, and once for the ones that don't // we don't want to mix between the two! ArrayList<ShardRouting> ordered = new ArrayList<>(activeRoutings.totalSize + initializingRoutings.totalSize); ordered.addAll(shuffler.shuffle(activeRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(activeRoutings.withoutSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withSameAttribute, seed)); ordered.addAll(shuffler.shuffle(initializingRoutings.withoutSameAttribute, seed)); return new PlainShardIterator(shardId, ordered); }