[TEST] Randomize translog settings

This commit is contained in:
Shay Banon 2015-05-06 12:22:59 +02:00
parent 644fd00714
commit 8f163ad4b0
1 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,8 @@ import org.elasticsearch.index.shard.IndexShardModule;
import org.elasticsearch.index.shard.IndexShardState;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.store.IndexStoreModule;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.index.translog.TranslogFile;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
@ -437,6 +439,15 @@ public final class InternalTestCluster extends TestCluster {
builder.put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, random.nextBoolean());
}
if (random.nextBoolean()) {
builder.put(Translog.INDEX_TRANSLOG_FS_TYPE, RandomPicks.randomFrom(random, TranslogFile.Type.values()));
if (random.nextBoolean()) {
builder.put(Translog.INDEX_TRANSLOG_SYNC_INTERVAL, 0); // 0 has special meaning to sync each op
} else {
builder.put(Translog.INDEX_TRANSLOG_SYNC_INTERVAL, RandomInts.randomIntBetween(random, 100, 5000));
}
}
return builder.build();
}