diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 5e710ceafde..2919704cd88 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -44,6 +44,9 @@ API Changes * LUCENE-9212: Deprecated Intervals.multiterm() methods that take a bare Automaton have been removed (Alan Woodward) +* LUCENE-9264: SimpleFSDirectory has been removed in favor of NIOFSDirectory. + (Yannick Welsch) + Improvements * LUCENE-8757: When provided with an ExecutorService to run queries across diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java index 690eba8aeeb..8cfca52d856 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java @@ -48,7 +48,7 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.MMapDirectory; -import org.apache.lucene.store.SimpleFSDirectory; +import org.apache.lucene.store.NIOFSDirectory; import org.apache.lucene.util.TestUtil; /** @@ -117,7 +117,7 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase { } } - try (Directory d = new SimpleFSDirectory(tempDir)) { + try (Directory d = new NIOFSDirectory(tempDir)) { // test auto try (DirectoryReader r = DirectoryReader.open(d)) { assertEquals(1, r.leaves().size()); @@ -128,7 +128,7 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase { } } - try (Directory d = new SimpleFSDirectory(tempDir)) { + try (Directory d = new NIOFSDirectory(tempDir)) { // test per field Map readerAttributes = new HashMap<>(); readerAttributes.put(BlockTreeTermsReader.FST_MODE_KEY, BlockTreeTermsReader.FSTLoadMode.OFF_HEAP.name()); @@ -143,7 +143,7 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase { } IllegalArgumentException invalid = expectThrows(IllegalArgumentException.class, () -> { - try (Directory d = new SimpleFSDirectory(tempDir)) { + try (Directory d = new NIOFSDirectory(tempDir)) { Map readerAttributes = new HashMap<>(); readerAttributes.put(BlockTreeTermsReader.FST_MODE_KEY, "invalid"); DirectoryReader.open(d, readerAttributes); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java index d2b18199ba2..cfc501a2439 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java @@ -71,7 +71,6 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.NIOFSDirectory; -import org.apache.lucene.store.SimpleFSDirectory; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; @@ -1442,8 +1441,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase { // - LuceneTestCase.FS_DIRECTORIES is private // - newFSDirectory returns BaseDirectoryWrapper // - BaseDirectoryWrapper doesn't expose delegate - Class dirImpl = random().nextBoolean() ? - SimpleFSDirectory.class : NIOFSDirectory.class; + Class dirImpl = NIOFSDirectory.class; args.add("-dir-impl"); args.add(dirImpl.getName()); diff --git a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java index c76a3c35ad4..ee9ec1e1c93 100644 --- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java @@ -53,13 +53,6 @@ import org.apache.lucene.util.IOUtils; * *