Default to not using compound file format for the index (increases number of open files, but faster indexing and recovery), closes #384.
This commit is contained in:
parent
2f43af0bd7
commit
485f904140
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue