mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Use RandomPicks to select a random array element
This commit is contained in:
parent
11ceaccc20
commit
1c2cb99751
@ -19,6 +19,7 @@
|
|||||||
package org.elasticsearch.test;
|
package org.elasticsearch.test;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.SeedUtils;
|
import com.carrotsearch.randomizedtesting.SeedUtils;
|
||||||
|
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.Collections2;
|
import com.google.common.collect.Collections2;
|
||||||
@ -202,7 +203,7 @@ public final class TestCluster implements Iterable<Client> {
|
|||||||
} else {
|
} else {
|
||||||
builder.put(Transport.TransportSettings.TRANSPORT_TCP_COMPRESS, random.nextInt(10) == 0);
|
builder.put(Transport.TransportSettings.TRANSPORT_TCP_COMPRESS, random.nextInt(10) == 0);
|
||||||
}
|
}
|
||||||
builder.put("type", CacheRecycler.Type.values()[random.nextInt(CacheRecycler.Type.values().length)]);
|
builder.put("type", RandomPicks.randomFrom(random, CacheRecycler.Type.values()));
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user