Search in sources :

Example 16 with DummyShardLock

use of org.elasticsearch.test.DummyShardLock in project elasticsearch by elastic.

the class IndexShardTestCase method createStore.

private Store createStore(IndexSettings indexSettings, ShardPath shardPath) throws IOException {
    final ShardId shardId = shardPath.getShardId();
    final DirectoryService directoryService = new DirectoryService(shardId, indexSettings) {

        @Override
        public Directory newDirectory() throws IOException {
            return newFSDirectory(shardPath.resolveIndex());
        }
    };
    return new Store(shardId, indexSettings, directoryService, new DummyShardLock(shardId));
}
Also used : Store(org.elasticsearch.index.store.Store) DirectoryService(org.elasticsearch.index.store.DirectoryService) DummyShardLock(org.elasticsearch.test.DummyShardLock)

Aggregations

DummyShardLock (org.elasticsearch.test.DummyShardLock)16 ShardId (org.elasticsearch.index.shard.ShardId)11 Document (org.apache.lucene.document.Document)6 TextField (org.apache.lucene.document.TextField)6 IndexWriter (org.apache.lucene.index.IndexWriter)6 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)6 MockAnalyzer (org.apache.lucene.analysis.MockAnalyzer)5 SortedDocValuesField (org.apache.lucene.document.SortedDocValuesField)5 CorruptIndexException (org.apache.lucene.index.CorruptIndexException)5 Directory (org.apache.lucene.store.Directory)5 BytesRef (org.apache.lucene.util.BytesRef)5 IndexSettings (org.elasticsearch.index.IndexSettings)5 ArrayList (java.util.ArrayList)4 Term (org.apache.lucene.index.Term)4 IndexOutput (org.apache.lucene.store.IndexOutput)4 RAMDirectory (org.apache.lucene.store.RAMDirectory)4 Store (org.elasticsearch.index.store.Store)4 IOException (java.io.IOException)3 Path (java.nio.file.Path)3 HashMap (java.util.HashMap)3