diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/FsStore.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/FsStore.java index 8e93d848bc7..6474914d7a6 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/FsStore.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/FsStore.java @@ -40,6 +40,8 @@ import java.io.IOException; */ public abstract class FsStore extends AbstractStore { + public static final boolean DEFAULT_SUGGEST_USE_COMPOUND_FILE = false; + public FsStore(ShardId shardId, @IndexSettings Settings indexSettings, IndexStore indexStore) { super(shardId, indexSettings, indexStore); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/MmapFsStore.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/MmapFsStore.java index c0a2f78f178..be8b262027e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/MmapFsStore.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/MmapFsStore.java @@ -60,12 +60,12 @@ public class MmapFsStore extends FsStore { if (switchDirectory.v2() != null) { suggestUseCompoundFile = switchDirectory.v2(); } - logger.debug("Using [mmap_fs] Store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); + logger.debug("using [mmap_fs] store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); directory = wrapDirectory(switchDirectory.v1()); } else { - suggestUseCompoundFile = true; + suggestUseCompoundFile = DEFAULT_SUGGEST_USE_COMPOUND_FILE; directory = wrapDirectory(fsDirectory); - logger.debug("Using [mmap_fs] Store with path [{}]", fsDirectory.getFile()); + logger.debug("using [mmap_fs] store with path [{}]", fsDirectory.getFile()); } this.suggestUseCompoundFile = suggestUseCompoundFile; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/NioFsStore.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/NioFsStore.java index 49de22d2964..238fcc23e22 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/NioFsStore.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/NioFsStore.java @@ -60,12 +60,12 @@ public class NioFsStore extends FsStore { if (switchDirectory.v2() != null) { suggestUseCompoundFile = switchDirectory.v2(); } - logger.debug("Using [nio_fs] Store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); + logger.debug("using [nio_fs] store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); directory = wrapDirectory(switchDirectory.v1()); } else { - suggestUseCompoundFile = true; + suggestUseCompoundFile = DEFAULT_SUGGEST_USE_COMPOUND_FILE; directory = wrapDirectory(fsDirectory); - logger.debug("Using [nio_fs] Store with path [{}]", fsDirectory.getFile()); + logger.debug("using [nio_fs] store with path [{}]", fsDirectory.getFile()); } this.suggestUseCompoundFile = suggestUseCompoundFile; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/SimpleFsStore.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/SimpleFsStore.java index 68f0d5c5914..4b3f898fa27 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/SimpleFsStore.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/fs/SimpleFsStore.java @@ -60,12 +60,12 @@ public class SimpleFsStore extends FsStore { if (switchDirectory.v2() != null) { suggestUseCompoundFile = switchDirectory.v2(); } - logger.debug("Using [simple_fs] Store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); + logger.debug("using [simple_fs] store with path [{}], cache [true] with extensions [{}]", fsDirectory.getFile(), switchDirectory.v1().primaryExtensions()); directory = wrapDirectory(switchDirectory.v1()); } else { - suggestUseCompoundFile = true; + suggestUseCompoundFile = DEFAULT_SUGGEST_USE_COMPOUND_FILE; directory = wrapDirectory(fsDirectory); - logger.debug("Using [simple_fs] Store with path [{}]", fsDirectory.getFile()); + logger.debug("using [simple_fs] store with path [{}]", fsDirectory.getFile()); } this.suggestUseCompoundFile = suggestUseCompoundFile; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/support/AbstractStore.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/support/AbstractStore.java index ac4b5fd4502..047b2b8a0f2 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/support/AbstractStore.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/store/support/AbstractStore.java @@ -55,7 +55,7 @@ public abstract class AbstractStore extends AbstractIndexShardComponent implemen protected AbstractStore(ShardId shardId, @IndexSettings Settings indexSettings, IndexStore indexStore) { super(shardId, indexSettings); this.indexStore = indexStore; - this.sync = componentSettings.getAsBoolean("sync", false); + this.sync = componentSettings.getAsBoolean("sync", true); // TODO we don't really need to fsync when using shared gateway... } protected Directory wrapDirectory(Directory dir) throws IOException {