Search in sources :

Example 11 with NIOFSDirectory

use of org.apache.lucene.store.NIOFSDirectory in project crate by crate.

the class StoreTests method testGetPendingFiles.

public void testGetPendingFiles() throws IOException {
    final ShardId shardId = new ShardId("index", "_na_", 1);
    final String testfile = "testfile";
    try (Store store = new Store(shardId, INDEX_SETTINGS, new NIOFSDirectory(createTempDir()), new DummyShardLock(shardId))) {
        store.directory().createOutput(testfile, IOContext.DEFAULT).close();
        try (IndexInput input = store.directory().openInput(testfile, IOContext.DEFAULT)) {
            store.directory().deleteFile(testfile);
            assertEquals(FilterDirectory.unwrap(store.directory()).getPendingDeletions(), store.directory().getPendingDeletions());
        }
    }
}
Also used : ShardId(org.elasticsearch.index.shard.ShardId) NIOFSDirectory(org.apache.lucene.store.NIOFSDirectory) ChecksumIndexInput(org.apache.lucene.store.ChecksumIndexInput) IndexInput(org.apache.lucene.store.IndexInput) Matchers.containsString(org.hamcrest.Matchers.containsString) DummyShardLock(org.elasticsearch.test.DummyShardLock)

Aggregations

NIOFSDirectory (org.apache.lucene.store.NIOFSDirectory)11 MMapDirectory (org.apache.lucene.store.MMapDirectory)6 SimpleFSDirectory (org.apache.lucene.store.SimpleFSDirectory)5 Directory (org.apache.lucene.store.Directory)4 IndexWriter (org.apache.lucene.index.IndexWriter)3 FSDirectory (org.apache.lucene.store.FSDirectory)3 File (java.io.File)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)2 RAMDirectory (org.apache.lucene.store.RAMDirectory)2 SingleInstanceLockFactory (org.apache.lucene.store.SingleInstanceLockFactory)2 Settings (org.elasticsearch.common.settings.Settings)2 IndexSettings (org.elasticsearch.index.IndexSettings)2 ShardId (org.elasticsearch.index.shard.ShardId)2 FileSystem (java.nio.file.FileSystem)1 HashSet (java.util.HashSet)1 RegionDirectory (org.apache.geode.cache.lucene.internal.directory.RegionDirectory)1 IndexRepository (org.apache.geode.cache.lucene.internal.repository.IndexRepository)1 IndexRepositoryImpl (org.apache.geode.cache.lucene.internal.repository.IndexRepositoryImpl)1