|
@@ -45,6 +45,7 @@ import org.elasticsearch.common.Nullable;
|
|
|
import org.elasticsearch.common.Priority;
|
|
|
import org.elasticsearch.common.Strings;
|
|
|
import org.elasticsearch.common.collect.Tuple;
|
|
|
+import org.elasticsearch.common.math.MathUtils;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
import org.elasticsearch.common.unit.TimeValue;
|
|
|
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
|
@@ -465,7 +466,7 @@ public class DiscoveryWithServiceDisruptionsIT extends ESIntegTestCase {
|
|
|
logger.info("[{}] Acquired semaphore and it has {} permits left", name, semaphore.availablePermits());
|
|
|
try {
|
|
|
id = Integer.toString(idGenerator.incrementAndGet());
|
|
|
- int shard = Murmur3HashFunction.hash(id) % numPrimaries;
|
|
|
+ int shard = MathUtils.mod(Murmur3HashFunction.hash(id), numPrimaries);
|
|
|
logger.trace("[{}] indexing id [{}] through node [{}] targeting shard [{}]", name, id, node, shard);
|
|
|
IndexResponse response = client.prepareIndex("test", "type", id).setSource("{}").setTimeout("1s").get();
|
|
|
assertThat(response.getVersion(), equalTo(1l));
|