List of usage examples for org.apache.lucene.store BaseDirectoryWrapper setCheckIndexOnClose
public void setCheckIndexOnClose(boolean value)
From source file:org.elasticsearch.indices.recovery.RecoverySourceHandlerTests.java
License:Apache License
private Store newStore(Path path, boolean checkIndex) throws IOException { DirectoryService directoryService = new DirectoryService(shardId, INDEX_SETTINGS) { @Override//from w w w. j a v a2 s . c o m public long throttleTimeInNanos() { return 0; } @Override public Directory newDirectory() throws IOException { BaseDirectoryWrapper baseDirectoryWrapper = RecoverySourceHandlerTests.newFSDirectory(path); if (checkIndex == false) { baseDirectoryWrapper.setCheckIndexOnClose(false); // don't run checkindex we might corrupt the index in these tests } return baseDirectoryWrapper; } }; return new Store(shardId, INDEX_SETTINGS, directoryService, new DummyShardLock(shardId)); }