Prevent MockStore where commits should be prevented on close

This commit is contained in:
Simon Willnauer 2015-05-18 10:11:07 +02:00
parent 03e5149994
commit 6c56cedf9a
3 changed files with 4 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public class IndexStoreModule extends AbstractModule implements SpawnModules {
private final Settings settings;
public static enum Type {
public enum Type {
NIOFS {
@Override
public boolean match(String setting) {

View File

@ -40,6 +40,7 @@ import org.elasticsearch.monitor.fs.FsStats;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.engine.MockEngineSupport;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.test.store.MockFSIndexStoreModule;
import org.elasticsearch.test.transport.MockTransportService;
import org.elasticsearch.transport.TransportModule;
import org.junit.Test;
@ -81,6 +82,7 @@ public class CorruptedTranslogTests extends ElasticsearchIntegrationTest {
.put("index.number_of_shards", 1)
.put("index.number_of_replicas", 0)
.put("index.refresh_interval", "-1")
.put(IndexStoreModule.STORE_TYPE, IndexStoreModule.Type.DEFAULT) // no mock store - it commits for check-index
.put(MockEngineSupport.FLUSH_ON_CLOSE_RATIO, 0.0d) // never flush - always recover from translog
.put(IndexShard.INDEX_FLUSH_ON_CLOSE, false) // never flush - always recover from translog
.put(TranslogConfig.INDEX_TRANSLOG_SYNC_INTERVAL, "1s") // fsync the translog every second

View File

@ -365,7 +365,7 @@ public final class InternalTestCluster extends TestCluster {
.put("cluster.routing.schedule", (30 + random.nextInt(50)) + "ms")
.put(SETTING_CLUSTER_NODE_SEED, seed);
if (ENABLE_MOCK_MODULES && usually(random)) {
builder.put(IndexStoreModule.STORE_TYPE, MockFSIndexStoreModule.class.getName()); // no RAM dir for now!
builder.put(IndexStoreModule.STORE_TYPE, MockFSIndexStoreModule.class.getName());
builder.put(IndexShardModule.ENGINE_FACTORY, MockEngineFactory.class);
builder.put(PageCacheRecyclerModule.CACHE_IMPL, MockPageCacheRecyclerModule.class.getName());
builder.put(BigArraysModule.IMPL, MockBigArraysModule.class.getName());