You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/02/06 14:26:54 UTC
[01/17] lucene-solr git commit: migrate current patch from svn
Repository: lucene-solr
Updated Branches:
refs/heads/master 072d44f9e -> 8e784699f
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java b/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
index bfec448..da03aea 100644
--- a/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
+++ b/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
+import java.util.Collection;
import java.util.Set;
import org.apache.lucene.index.IndexFileNames;
@@ -325,9 +326,11 @@ public class BlockDirectory extends FilterDirectory {
return dest;
}
- public void deleteFile(String name) throws IOException {
- cache.delete(getFileCacheName(name));
- super.deleteFile(name);
+ public void deleteFiles(Collection<String> names) throws IOException {
+ for(String name : names) {
+ cache.delete(getFileCacheName(name));
+ }
+ super.deleteFiles(names);
}
public boolean isBlockCacheReadEnabled() {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java b/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
index bee0f54..e5317bc 100644
--- a/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
+++ b/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
@@ -144,10 +144,12 @@ public class HdfsDirectory extends BaseDirectory {
}
@Override
- public void deleteFile(String name) throws IOException {
- Path path = new Path(hdfsDirPath, name);
- LOG.debug("Deleting {}", path);
- getFileSystem().delete(path, false);
+ public void deleteFiles(Collection<String> names) throws IOException {
+ for(String name : names) {
+ Path path = new Path(hdfsDirPath, name);
+ LOG.debug("Deleting {}", path);
+ getFileSystem().delete(path, false);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java b/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
index 153d324..e3a0e7b 100644
--- a/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
+++ b/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
@@ -18,6 +18,8 @@ package org.apache.solr.store.hdfs;
*/
import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
@@ -88,9 +90,7 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
@Test
public void testWritingAndReadingAFile() throws IOException {
String[] listAll = directory.listAll();
- for (String file : listAll) {
- directory.deleteFile(file);
- }
+ directory.deleteFiles(Arrays.asList(listAll));
IndexOutput output = directory.createOutput("testing.test", new IOContext());
output.writeInt(12345);
@@ -117,15 +117,13 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
assertFalse(slowFileExists(directory, "testing.test.other"));
assertTrue(slowFileExists(directory, "testing.test"));
- directory.deleteFile("testing.test");
+ directory.deleteFiles(Collections.singleton("testing.test"));
assertFalse(slowFileExists(directory, "testing.test"));
}
public void testRename() throws IOException {
String[] listAll = directory.listAll();
- for (String file : listAll) {
- directory.deleteFile(file);
- }
+ directory.deleteFiles(Arrays.asList(listAll));
IndexOutput output = directory.createOutput("testing.test", new IOContext());
output.writeInt(12345);
@@ -137,7 +135,7 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
assertEquals(12345, input.readInt());
assertEquals(input.getFilePointer(), input.length());
input.close();
- directory.deleteFile("testing.test.renamed");
+ directory.deleteFiles(Collections.singleton("testing.test.renamed"));
assertFalse(slowFileExists(directory, "testing.test.renamed"));
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java b/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
index 7f07f85..2f4803d 100644
--- a/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
+++ b/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
@@ -69,9 +69,6 @@ public class MockDirectoryFactory extends EphemeralDirectoryFactory {
// already been created.
mockDirWrapper.setPreventDoubleWrite(false);
- // IndexFetcher & co don't seem ready for this:
- mockDirWrapper.setEnableVirusScanner(false);
-
if (allowReadingFilesStillOpenForWrite) {
mockDirWrapper.setAllowReadingFilesStillOpenForWrite(true);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java b/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
index 1c3bbcd..81eaca0 100644
--- a/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
+++ b/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
@@ -51,7 +51,6 @@ public class MockFSDirectoryFactory extends StandardDirectoryFactory {
if (cdir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper)cdir).setAssertNoUnrefencedFilesOnClose(false);
((MockDirectoryWrapper)cdir).setPreventDoubleWrite(false);
- ((MockDirectoryWrapper)cdir).setEnableVirusScanner(false);
}
return dir;
}
[07/17] lucene-solr git commit: cutover more places back to deleteFile
Posted by mi...@apache.org.
cutover more places back to deleteFile
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/845eec10
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/845eec10
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/845eec10
Branch: refs/heads/master
Commit: 845eec103677dde05c34ffe1500a230dfecfd62e
Parents: a741ea5
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 15:44:08 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 3 15:44:08 2016 -0500
----------------------------------------------------------------------
.../index/TestBackwardsCompatibility.java | 2 --
.../benchmark/byTask/utils/StreamUtilsTest.java | 14 +--------
.../java/org/apache/lucene/store/Directory.java | 1 -
.../org/apache/lucene/store/FSDirectory.java | 13 ++++++--
.../lucene/index/TestIndexFileDeleter.java | 3 +-
.../taxonomy/directory/TestAddTaxonomy.java | 29 +++++++++---------
.../writercache/TestCompactLabelToOrdinal.java | 31 ++++++++++----------
.../IndexAndTaxonomyReplicationClientTest.java | 4 +--
.../replicator/IndexReplicationClientTest.java | 2 ++
.../replicator/http/HttpReplicatorTest.java | 7 ++---
.../lucene/analysis/VocabularyAssert.java | 4 +--
.../apache/lucene/mockfile/VirusCheckingFS.java | 18 +++++++-----
.../util/TestRuleTemporaryFilesCleanup.java | 2 +-
.../java/org/apache/lucene/util/TestUtil.java | 7 ++---
.../lucene/mockfile/TestVirusCheckingFS.java | 2 +-
.../org/apache/solr/core/DirectoryFactory.java | 7 +++--
.../org/apache/solr/handler/IndexFetcher.java | 4 +--
.../org/apache/solr/handler/RestoreCore.java | 4 +--
.../solr/store/blockcache/BlockDirectory.java | 11 +++----
.../apache/solr/store/hdfs/HdfsDirectory.java | 10 +++----
.../solr/store/hdfs/HdfsDirectoryTest.java | 14 +++++----
21 files changed, 87 insertions(+), 102 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
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 87cdea6..cad3974 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
@@ -60,7 +60,6 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.BaseDirectoryWrapper;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.NIOFSDirectory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSDirectory;
@@ -584,7 +583,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
checker.close();
dir.close();
- IOUtils.rm(oldIndexDir);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java
index df6bea1..762ee5c 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java
@@ -30,8 +30,6 @@ import java.nio.file.Path;
import org.apache.commons.compress.compressors.CompressorStreamFactory;
import org.apache.lucene.benchmark.BenchmarkTestCase;
-import org.apache.lucene.util.IOUtils;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -135,16 +133,6 @@ public class StreamUtilsTest extends BenchmarkTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
- testDir = getWorkDir().resolve("ContentSourceTest");
- IOUtils.rm(testDir);
- Files.createDirectory(testDir);
+ testDir = createTempDir("ContentSourceTest");
}
-
- @Override
- @After
- public void tearDown() throws Exception {
- IOUtils.rm(testDir);
- super.tearDown();
- }
-
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java
index b6da4cc..6aa46e9 100644
--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java
@@ -47,7 +47,6 @@ public abstract class Directory implements Closeable {
*
* @throws IOException in case of IO error
*/
- // nocommit should this sort?
public abstract String[] listAll() throws IOException;
/** Removes an existing file in the directory. */
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 a2edb84..fa6ce63 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -30,6 +30,7 @@ import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -217,7 +218,12 @@ public abstract class FSDirectory extends BaseDirectory {
}
}
- return entries.toArray(new String[entries.size()]);
+ String[] array = entries.toArray(new String[entries.size()]);
+
+ // Don't let filesystem specifics leak out of this abstraction:
+ Arrays.sort(array);
+
+ return array;
}
@Override
@@ -249,7 +255,7 @@ public abstract class FSDirectory extends BaseDirectory {
return new FSIndexOutput(name,
StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW);
} catch (FileAlreadyExistsException faee) {
- // Retry with next random name
+ // Retry with next incremented name
}
}
}
@@ -303,11 +309,12 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public void deleteFile(String name) throws IOException {
- pendingDeletes.remove(name);
try {
Files.delete(directory.resolve(name));
+ pendingDeletes.remove(name);
} catch (NoSuchFileException | FileNotFoundException e) {
// We were asked to delete a non-existent file:
+ pendingDeletes.remove(name);
throw e;
} catch (IOException ioe) {
// On windows, a file delete can fail because there's still an open
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index a5e3c7e..8c2dd91 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -39,7 +39,6 @@ import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.TestUtil;
/*
Verify we can read the pre-2.1 file format, do searches
@@ -225,7 +224,7 @@ public class TestIndexFileDeleter extends LuceneTestCase {
public void testVirusScannerDoesntCorruptIndex() throws IOException {
Path path = createTempDir();
- VirusCheckingFS fs = new VirusCheckingFS(path.getFileSystem(), random());
+ VirusCheckingFS fs = new VirusCheckingFS(path.getFileSystem(), random().nextLong());
FileSystem filesystem = fs.getFileSystem(URI.create("file:///"));
fs.disable();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
index 215067b..7dc73e1 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
@@ -1,19 +1,5 @@
package org.apache.lucene.facet.taxonomy.directory;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Random;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.lucene.facet.FacetTestCase;
-import org.apache.lucene.facet.taxonomy.FacetLabel;
-import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOrdinalMap;
-import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap;
-import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap;
-import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.TestUtil;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -31,6 +17,21 @@ import org.apache.lucene.util.TestUtil;
* limitations under the License.
*/
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.taxonomy.FacetLabel;
+import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOrdinalMap;
+import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap;
+import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.TestUtil;
+
+//@SuppressFileSystems("VirusCheckingFS")
public class TestAddTaxonomy extends FacetTestCase {
private void dotest(int ncats, final int range) throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
index 9826645..bf67929 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
@@ -1,20 +1,5 @@
package org.apache.lucene.facet.taxonomy.writercache;
-import java.nio.ByteBuffer;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-
-import org.apache.lucene.facet.FacetTestCase;
-import org.apache.lucene.facet.taxonomy.FacetLabel;
-
-import org.junit.Test;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -32,6 +17,22 @@ import org.junit.Test;
* limitations under the License.
*/
+import java.nio.ByteBuffer;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CodingErrorAction;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import org.apache.lucene.facet.FacetTestCase;
+import org.apache.lucene.facet.taxonomy.FacetLabel;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
+import org.junit.Test;
+
+@SuppressFileSystems("VirusCheckingFS")
public class TestCompactLabelToOrdinal extends FacetTestCase {
@Test
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
index 51ebae6..26e68d32 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
@@ -22,7 +22,6 @@ import java.io.Closeable;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Path;
-import java.util.Collections;
import java.util.HashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -43,7 +42,6 @@ import org.apache.lucene.index.CheckIndex;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.index.SnapshotDeletionPolicy;
import org.apache.lucene.replicator.IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter;
import org.apache.lucene.replicator.ReplicationClient.ReplicationHandler;
@@ -54,12 +52,14 @@ import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.ThreadInterruptedException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+@SuppressFileSystems("VirusCheckingFS")
public class IndexAndTaxonomyReplicationClientTest extends ReplicatorTestCase {
private static class IndexAndTaxonomyReadyCallback implements Callable<Boolean>, Closeable {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
index 3f91013..bcbf9cb 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
@@ -33,12 +33,14 @@ import org.apache.lucene.replicator.ReplicationClient.SourceDirectoryFactory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.ThreadInterruptedException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+@SuppressFileSystems("VirusCheckingFS")
public class IndexReplicationClientTest extends ReplicatorTestCase {
private static class IndexReadyCallback implements Callable<Boolean>, Closeable {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
index ecbe3b6..4298af8 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
@@ -36,17 +36,14 @@ import org.apache.lucene.replicator.Replicator;
import org.apache.lucene.replicator.ReplicatorTestCase;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.RuleChain;
-import org.junit.rules.TestRule;
-
-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
+@SuppressFileSystems("VirusCheckingFS")
public class HttpReplicatorTest extends ReplicatorTestCase {
private Path clientWorkDir;
private Replicator serverReplicator;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
index 208eab9..ef4ff28 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
@@ -25,8 +25,6 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.BaseTokenStreamTestCase;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.junit.Assert;
@@ -76,7 +74,7 @@ public class VocabularyAssert {
/** Run a vocabulary test against a tab-separated data file inside a zip file */
public static void assertVocabulary(Analyzer a, Path zipFile, String vocOut) throws IOException {
- Path tmp = LuceneTestCase.createTempDir().resolve("unzipped");
+ Path tmp = LuceneTestCase.createTempDir();
try (InputStream in = Files.newInputStream(zipFile)) {
TestUtil.unzip(in, tmp);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
index 759a840..8b34551 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -22,7 +22,7 @@ import java.nio.file.AccessDeniedException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Random;
+import java.util.concurrent.atomic.AtomicLong;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.util.LuceneTestCase;
@@ -33,17 +33,16 @@ import org.apache.lucene.util.LuceneTestCase;
*/
public class VirusCheckingFS extends FilterFileSystemProvider {
- // nocommit cannot use random here
- final Random random;
-
private boolean enabled = true;
+ private final AtomicLong state;
+
/**
* Create a new instance, wrapping {@code delegate}.
*/
- public VirusCheckingFS(FileSystem delegate, Random random) {
+ public VirusCheckingFS(FileSystem delegate, long salt) {
super("viruschecking://", delegate);
- this.random = new Random(random.nextLong());
+ this.state = new AtomicLong(salt);
}
public void enable() {
@@ -56,11 +55,14 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
@Override
public void delete(Path path) throws IOException {
+
+ // Fake but deterministic and hopefully portable like-randomness:
+ long hash = state.incrementAndGet() * path.getFileName().hashCode();
- if (enabled // test infra disables when it's "really" time to delete after test is done
+ if (enabled // test infra disables when it's "really" time to delete after test is done, so it can reclaim temp dirs
&& Files.exists(path) // important that we NOT delay a NoSuchFileException until later
&& path.getFileName().toString().equals(IndexWriter.WRITE_LOCK_NAME) == false // life is particularly difficult if the virus checker hits our lock file
- && random.nextInt(5) == 1) {
+ && (hash % 5) == 1) {
if (LuceneTestCase.VERBOSE) {
System.out.println("NOTE: VirusCheckingFS now refusing to delete " + path);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
index 27e4fb9..6e30b4c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
@@ -183,7 +183,7 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
// nocommit true:
if (allowed(avoid, VirusCheckingFS.class) && (true || random.nextInt(10) == 1)) {
// 10% of the time we swap in virus checking (acts-like-windows) FS:
- virusCheckingFS = new VirusCheckingFS(fs, random);
+ virusCheckingFS = new VirusCheckingFS(fs, random.nextLong());
fs = virusCheckingFS.getFileSystem(null);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
index 89af2e2..0329f4b 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
@@ -108,7 +108,6 @@ import org.junit.Assert;
import com.carrotsearch.randomizedtesting.generators.RandomInts;
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
-
/**
* General utility methods for Lucene unit tests.
*/
@@ -118,14 +117,12 @@ public final class TestUtil {
}
/**
- * Convenience method unzipping zipName into destDir, cleaning up
- * destDir first.
+ * Convenience method unzipping zipName into destDir. You must pass it a clean destDir.
+ *
* Closes the given InputStream after extracting!
*/
public static void unzip(InputStream in, Path destDir) throws IOException {
in = new BufferedInputStream(in);
- IOUtils.rm(destDir);
- Files.createDirectory(destDir);
try (ZipInputStream zipInput = new ZipInputStream(in)) {
ZipEntry entry;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
index 17b1575..4a34ab8 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
@@ -30,7 +30,7 @@ public class TestVirusCheckingFS extends MockFileSystemTestCase {
@Override
protected Path wrap(Path path) {
- FileSystem fs = new VirusCheckingFS(path.getFileSystem(), random()).getFileSystem(URI.create("file:///"));
+ FileSystem fs = new VirusCheckingFS(path.getFileSystem(), random().nextLong()).getFileSystem(URI.create("file:///"));
return new FilterPath(path, fs);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
index cf7220d..715b6a6 100644
--- a/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
@@ -22,7 +22,6 @@ import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -156,7 +155,7 @@ public abstract class DirectoryFactory implements NamedListInitializedPlugin,
*/
public void move(Directory fromDir, Directory toDir, String fileName, IOContext ioContext) throws IOException {
toDir.copyFrom(fromDir, fileName, fileName, ioContext);
- fromDir.deleteFiles(Collections.singleton(fileName));
+ fromDir.deleteFile(fileName);
}
/**
@@ -249,7 +248,9 @@ public abstract class DirectoryFactory implements NamedListInitializedPlugin,
try {
contents = dir.listAll();
if (contents != null) {
- dir.deleteFiles(Arrays.asList(contents));
+ for (String file : contents) {
+ dir.deleteFile(file);
+ }
}
} catch (IOException e) {
SolrException.log(log, "Error deleting files from Directory", e);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index 86aaf95..862d4e7 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -1206,7 +1206,7 @@ public class IndexFetcher {
}
}
try {
- dir.deleteFiles(Collections.singleton(IndexFetcher.INDEX_PROPERTIES));
+ dir.deleteFile(IndexFetcher.INDEX_PROPERTIES);
} catch (IOException e) {
// no problem
}
@@ -1651,7 +1651,7 @@ public class IndexFetcher {
}
public void delete() throws Exception {
- copy2Dir.deleteFiles(Collections.singleton(saveAs));
+ copy2Dir.deleteFile(saveAs);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
index cf426ce..735163b 100644
--- a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
+++ b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
@@ -17,11 +17,9 @@ package org.apache.solr.handler;
* limitations under the License.
*/
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
@@ -112,7 +110,7 @@ public class RestoreCore implements Callable<Boolean> {
try {
dir = core.getDirectoryFactory().get(core.getDataDir(), DirectoryFactory.DirContext.META_DATA,
core.getSolrConfig().indexConfig.lockType);
- dir.deleteFiles(Collections.singleton(IndexFetcher.INDEX_PROPERTIES));
+ dir.deleteFile(IndexFetcher.INDEX_PROPERTIES);
} finally {
if (dir != null) {
core.getDirectoryFactory().release(dir);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java b/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
index da03aea..5d9a8a6 100644
--- a/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
+++ b/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
@@ -21,7 +21,6 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
-import java.util.Collection;
import java.util.Set;
import org.apache.lucene.index.IndexFileNames;
@@ -325,12 +324,10 @@ public class BlockDirectory extends FilterDirectory {
}
return dest;
}
-
- public void deleteFiles(Collection<String> names) throws IOException {
- for(String name : names) {
- cache.delete(getFileCacheName(name));
- }
- super.deleteFiles(names);
+
+ public void deleteFile(String name) throws IOException {
+ cache.delete(getFileCacheName(name));
+ super.deleteFile(name);
}
public boolean isBlockCacheReadEnabled() {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java b/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
index e5317bc..bee0f54 100644
--- a/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
+++ b/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
@@ -144,12 +144,10 @@ public class HdfsDirectory extends BaseDirectory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
- for(String name : names) {
- Path path = new Path(hdfsDirPath, name);
- LOG.debug("Deleting {}", path);
- getFileSystem().delete(path, false);
- }
+ public void deleteFile(String name) throws IOException {
+ Path path = new Path(hdfsDirPath, name);
+ LOG.debug("Deleting {}", path);
+ getFileSystem().delete(path, false);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/845eec10/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java b/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
index e3a0e7b..153d324 100644
--- a/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
+++ b/solr/core/src/test/org/apache/solr/store/hdfs/HdfsDirectoryTest.java
@@ -18,8 +18,6 @@ package org.apache.solr.store.hdfs;
*/
import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
@@ -90,7 +88,9 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
@Test
public void testWritingAndReadingAFile() throws IOException {
String[] listAll = directory.listAll();
- directory.deleteFiles(Arrays.asList(listAll));
+ for (String file : listAll) {
+ directory.deleteFile(file);
+ }
IndexOutput output = directory.createOutput("testing.test", new IOContext());
output.writeInt(12345);
@@ -117,13 +117,15 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
assertFalse(slowFileExists(directory, "testing.test.other"));
assertTrue(slowFileExists(directory, "testing.test"));
- directory.deleteFiles(Collections.singleton("testing.test"));
+ directory.deleteFile("testing.test");
assertFalse(slowFileExists(directory, "testing.test"));
}
public void testRename() throws IOException {
String[] listAll = directory.listAll();
- directory.deleteFiles(Arrays.asList(listAll));
+ for (String file : listAll) {
+ directory.deleteFile(file);
+ }
IndexOutput output = directory.createOutput("testing.test", new IOContext());
output.writeInt(12345);
@@ -135,7 +137,7 @@ public class HdfsDirectoryTest extends SolrTestCaseJ4 {
assertEquals(12345, input.readInt());
assertEquals(input.getFilePointer(), input.length());
input.close();
- directory.deleteFiles(Collections.singleton("testing.test.renamed"));
+ directory.deleteFile("testing.test.renamed");
assertFalse(slowFileExists(directory, "testing.test.renamed"));
}
[08/17] lucene-solr git commit: remove nocommit
Posted by mi...@apache.org.
remove nocommit
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f0b9186f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f0b9186f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f0b9186f
Branch: refs/heads/master
Commit: f0b9186f55a158dcef2461a3024397ded48e196a
Parents: 845eec1
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 15:47:50 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 3 15:47:50 2016 -0500
----------------------------------------------------------------------
.../org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f0b9186f/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
index 6e30b4c..c864ec1 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
@@ -180,8 +180,7 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
if (allowed(avoid, ExtrasFS.class)) {
fs = new ExtrasFS(fs, random.nextInt(4) == 0, random.nextBoolean()).getFileSystem(null);
}
- // nocommit true:
- if (allowed(avoid, VirusCheckingFS.class) && (true || random.nextInt(10) == 1)) {
+ if (allowed(avoid, VirusCheckingFS.class) && random.nextInt(10) == 1) {
// 10% of the time we swap in virus checking (acts-like-windows) FS:
virusCheckingFS = new VirusCheckingFS(fs, random.nextLong());
fs = virusCheckingFS.getFileSystem(null);
[02/17] lucene-solr git commit: migrate current patch from svn
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
index f05297e..793c005 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
@@ -19,8 +19,10 @@ package org.apache.lucene.store;
import java.io.IOException;
import java.nio.file.Path;
+import java.util.Collections;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.TestUtil;
/** Simple tests for SimpleFSLockFactory */
public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
@@ -34,11 +36,12 @@ public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
public void testDeleteLockFile() throws IOException {
Directory dir = getDirectory(createTempDir());
try {
+ assumeFalse("test directly deletes lock files", TestUtil.hasVirusChecker(dir));
Lock lock = dir.obtainLock("test.lock");
lock.ensureValid();
try {
- dir.deleteFile("test.lock");
+ dir.deleteFiles(Collections.singleton("test.lock"));
} catch (Exception e) {
// we can't delete a file for some reason, just clean up and assume the test.
IOUtils.closeWhileHandlingException(lock);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
index 0985587..f9551d6 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
@@ -43,7 +43,7 @@ public class TestTrackingDirectoryWrapper extends BaseDirectoryTestCase {
TrackingDirectoryWrapper dir = new TrackingDirectoryWrapper(new RAMDirectory());
dir.createOutput("foo", newIOContext(random())).close();
assertEquals(asSet("foo"), dir.getCreatedFiles());
- dir.deleteFile("foo");
+ dir.deleteFiles(Collections.singleton("foo"));
assertEquals(Collections.emptySet(), dir.getCreatedFiles());
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
index d8a878c..ca8e802 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
@@ -30,6 +30,7 @@ import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.OfflineSorter.BufferSize;
import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
import org.apache.lucene.util.OfflineSorter.SortInfo;
@@ -37,6 +38,7 @@ import org.apache.lucene.util.OfflineSorter.SortInfo;
/**
* Tests for on-disk merge sorting.
*/
+@SuppressFileSystems("VirusCheckingFS")
public class TestOfflineSorter extends LuceneTestCase {
private Path tempDir;
@@ -54,30 +56,14 @@ public class TestOfflineSorter extends LuceneTestCase {
super.tearDown();
}
- private static Directory newDirectoryNoVirusScanner() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
-
- private static Directory newFSDirectoryNoVirusScanner() {
- Directory dir = newFSDirectory(createTempDir());
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
-
public void testEmpty() throws Exception {
- try (Directory dir = newDirectoryNoVirusScanner()) {
+ try (Directory dir = newDirectory()) {
checkSort(dir, new OfflineSorter(dir, "foo"), new byte [][] {});
}
}
public void testSingleLine() throws Exception {
- try (Directory dir = newDirectoryNoVirusScanner()) {
+ try (Directory dir = newDirectory()) {
checkSort(dir, new OfflineSorter(dir, "foo"), new byte [][] {
"Single line only.".getBytes(StandardCharsets.UTF_8)
});
@@ -86,7 +72,7 @@ public class TestOfflineSorter extends LuceneTestCase {
public void testIntermediateMerges() throws Exception {
// Sort 20 mb worth of data with 1mb buffer, binary merging.
- try (Directory dir = newDirectoryNoVirusScanner()) {
+ try (Directory dir = newDirectory()) {
SortInfo info = checkSort(dir, new OfflineSorter(dir, "foo", OfflineSorter.DEFAULT_COMPARATOR, BufferSize.megabytes(1), 2),
generateRandom((int)OfflineSorter.MB * 20));
assertTrue(info.mergeRounds > 10);
@@ -95,7 +81,7 @@ public class TestOfflineSorter extends LuceneTestCase {
public void testSmallRandom() throws Exception {
// Sort 20 mb worth of data with 1mb buffer.
- try (Directory dir = newDirectoryNoVirusScanner()) {
+ try (Directory dir = newDirectory()) {
SortInfo sortInfo = checkSort(dir, new OfflineSorter(dir, "foo", OfflineSorter.DEFAULT_COMPARATOR, BufferSize.megabytes(1), OfflineSorter.MAX_TEMPFILES),
generateRandom((int)OfflineSorter.MB * 20));
assertEquals(1, sortInfo.mergeRounds);
@@ -105,7 +91,7 @@ public class TestOfflineSorter extends LuceneTestCase {
@Nightly
public void testLargerRandom() throws Exception {
// Sort 100MB worth of data with 15mb buffer.
- try (Directory dir = newFSDirectoryNoVirusScanner()) {
+ try (Directory dir = newFSDirectory(createTempDir())) {
checkSort(dir, new OfflineSorter(dir, "foo", OfflineSorter.DEFAULT_COMPARATOR, BufferSize.megabytes(16), OfflineSorter.MAX_TEMPFILES),
generateRandom((int)OfflineSorter.MB * 100));
}
@@ -223,7 +209,7 @@ public class TestOfflineSorter extends LuceneTestCase {
Thread[] threads = new Thread[TestUtil.nextInt(random(), 4, 10)];
final AtomicBoolean failed = new AtomicBoolean();
final int iters = atLeast(1000);
- try (Directory dir = newDirectoryNoVirusScanner()) {
+ try (Directory dir = newDirectory()) {
for(int i=0;i<threads.length;i++) {
final int threadID = i;
threads[i] = new Thread() {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
index 3448150..dc17f96 100644
--- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
+++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
@@ -22,6 +22,7 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
+import java.util.Collections;
import java.util.List;
import org.apache.lucene.index.PointValues.IntersectVisitor;
@@ -394,9 +395,6 @@ public class TestBKD extends LuceneTestCase {
try {
dir.setRandomIOExceptionRate(0.05);
dir.setRandomIOExceptionRateOnOpen(0.05);
- if (dir instanceof MockDirectoryWrapper) {
- dir.setEnableVirusScanner(false);
- }
verify(dir, docValues, null, numDims, numBytesPerDim, 50, maxMBHeap);
} catch (IllegalArgumentException iae) {
// This just means we got a too-small maxMB for the maxPointsInLeafNode; just retry w/ more heap
@@ -820,9 +818,9 @@ public class TestBKD extends LuceneTestCase {
}
}
in.close();
- dir.deleteFile("bkd");
+ dir.deleteFiles(Collections.singleton("bkd"));
if (toMerge != null) {
- dir.deleteFile("bkd2");
+ dir.deleteFiles(Collections.singleton("bkd2"));
}
success = true;
} finally {
@@ -848,9 +846,6 @@ public class TestBKD extends LuceneTestCase {
} else {
dir = newDirectory();
}
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
return dir;
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
index 57d8374..e3868e4 100644
--- a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
+++ b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
@@ -18,6 +18,7 @@ package org.apache.lucene.util.fst;
*/
import java.util.Arrays;
+import java.util.Collections;
import java.util.Random;
import org.apache.lucene.store.Directory;
@@ -31,6 +32,7 @@ import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TimeUnits;
import org.apache.lucene.util.packed.PackedInts;
import org.junit.Ignore;
+
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@Ignore("Requires tons of heap to run (30 GB hits OOME but 35 GB passes after ~4.5 hours)")
@@ -126,7 +128,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFile("fst");
+ dir.deleteFiles(Collections.singleton("fst"));
}
}
}
@@ -203,7 +205,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFile("fst");
+ dir.deleteFiles(Collections.singleton("fst"));
}
}
}
@@ -287,7 +289,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFile("fst");
+ dir.deleteFiles(Collections.singleton("fst"));
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
index 27dd169..ac948d7 100644
--- a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
+++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
@@ -66,10 +66,11 @@ import org.apache.lucene.util.IntsRefBuilder;
import org.apache.lucene.util.LineFileDocs;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
-import org.apache.lucene.util.automaton.CompiledAutomaton;
import org.apache.lucene.util.automaton.Automaton;
+import org.apache.lucene.util.automaton.CompiledAutomaton;
import org.apache.lucene.util.automaton.RegExp;
import org.apache.lucene.util.fst.BytesRefFSTEnum.InputOutput;
import org.apache.lucene.util.fst.FST.Arc;
@@ -83,6 +84,7 @@ import static org.apache.lucene.util.fst.FSTTester.simpleRandomString;
import static org.apache.lucene.util.fst.FSTTester.toIntsRef;
@SuppressCodecs({ "SimpleText", "Memory", "Direct" })
+@SuppressFileSystems({ "VirusCheckingFS" })
@Slow
public class TestFSTs extends LuceneTestCase {
@@ -93,7 +95,6 @@ public class TestFSTs extends LuceneTestCase {
super.setUp();
dir = newMockDirectory();
dir.setPreventDoubleWrite(false);
- dir.setEnableVirusScanner(false);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
index bab144b..e11cfef 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Random;
@@ -840,7 +841,7 @@ public class TestPackedInts extends LuceneTestCase {
assertEquals(mutable.get(i), reader.get(i));
}
in.close();
- directory.deleteFile("packed-ints.bin");
+ directory.deleteFiles(Collections.singleton("packed-ints.bin"));
}
directory.close();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java b/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
index 9ffa011..970d2ed 100644
--- a/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
+++ b/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
@@ -46,7 +46,6 @@ public class TestFSTsMisc extends LuceneTestCase {
super.setUp();
dir = newMockDirectory();
dir.setPreventDoubleWrite(false);
- dir.setEnableVirusScanner(false);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
index 310399f..51ebae6 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
@@ -22,6 +22,7 @@ import java.io.Closeable;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Path;
+import java.util.Collections;
import java.util.HashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -424,22 +425,6 @@ public class IndexAndTaxonomyReplicationClientTest extends ReplicatorTestCase {
}
}
- if (indexStatus == null || indexStatus.clean == false) {
-
- // Because segments file for taxo index is replicated after
- // main index's segments file, if there's an error while replicating
- // main index's segments file and if virus checker prevents
- // deletion of taxo index's segments file, it can look like corruption.
- // But it should be "false" meaning if we remove the latest segments
- // file then the index is intact. It's like pulling a hideous
- // looking rock out of the ground, but then you pull the cruft
- // off the outside of it and discover it's actually a beautiful
- // diamond:
- String segmentsFileName = SegmentInfos.getLastCommitSegmentsFileName(handlerTaxoDir);
- assertTrue(handlerTaxoDir.didTryToDelete(segmentsFileName));
- handlerTaxoDir.getDelegate().deleteFile(segmentsFileName);
- TestUtil.checkIndex(handlerTaxoDir.getDelegate());
- }
} catch (IOException e) {
failed.set(true);
throw new RuntimeException(e);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
index 2c832da..7a4465a 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
@@ -77,10 +77,6 @@ public class IndexAndTaxonomyRevisionTest extends ReplicatorTestCase {
Directory taxoDir = newDirectory();
SnapshotDirectoryTaxonomyWriter taxoWriter = new SnapshotDirectoryTaxonomyWriter(taxoDir);
- // we look to see that certain files are deleted:
- if (indexDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)indexDir).setEnableVirusScanner(false);
- }
try {
indexWriter.addDocument(newDocument(taxoWriter));
indexWriter.commit();
@@ -101,10 +97,6 @@ public class IndexAndTaxonomyRevisionTest extends ReplicatorTestCase {
indexWriter.close();
} finally {
IOUtils.close(indexWriter, taxoWriter, taxoDir, indexDir);
- if (indexDir instanceof MockDirectoryWrapper) {
- // set back to on for other tests
- ((MockDirectoryWrapper)indexDir).setEnableVirusScanner(true);
- }
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
index 6ebdd15..9e267ab 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
@@ -73,10 +73,6 @@ public class IndexRevisionTest extends ReplicatorTestCase {
@Test
public void testRevisionRelease() throws Exception {
Directory dir = newDirectory();
- // we look to see that certain files are deleted:
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = new IndexWriterConfig(null);
conf.setIndexDeletionPolicy(new SnapshotDeletionPolicy(conf.getIndexDeletionPolicy()));
IndexWriter writer = new IndexWriter(dir, conf);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
index 3c9a8d1..b092e83 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
@@ -119,57 +119,35 @@ public class LocalReplicatorTest extends ReplicatorTestCase {
@Test
public void testPublishSameRevision() throws IOException {
- // we look to see that certain files are deleted:
- if (sourceDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
- }
- try {
- Revision rev = createRevision(1);
- replicator.publish(rev);
- SessionToken res = replicator.checkForUpdate(null);
- assertNotNull(res);
- assertEquals(rev.getVersion(), res.version);
- replicator.release(res.id);
- replicator.publish(new IndexRevision(sourceWriter));
- res = replicator.checkForUpdate(res.version);
- assertNull(res);
+ Revision rev = createRevision(1);
+ replicator.publish(rev);
+ SessionToken res = replicator.checkForUpdate(null);
+ assertNotNull(res);
+ assertEquals(rev.getVersion(), res.version);
+ replicator.release(res.id);
+ replicator.publish(new IndexRevision(sourceWriter));
+ res = replicator.checkForUpdate(res.version);
+ assertNull(res);
- // now make sure that publishing same revision doesn't leave revisions
- // "locked", i.e. that replicator releases revisions even when they are not
- // kept
- replicator.publish(createRevision(2));
- assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
- } finally {
- if (sourceDir instanceof MockDirectoryWrapper) {
- // set back to on for other tests
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
- }
- }
+ // now make sure that publishing same revision doesn't leave revisions
+ // "locked", i.e. that replicator releases revisions even when they are not
+ // kept
+ replicator.publish(createRevision(2));
+ assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
}
@Test
public void testPublishOlderRev() throws IOException {
- // we look to see that certain files are deleted:
- if (sourceDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
- }
+ replicator.publish(createRevision(1));
+ Revision old = new IndexRevision(sourceWriter);
+ replicator.publish(createRevision(2));
try {
- replicator.publish(createRevision(1));
- Revision old = new IndexRevision(sourceWriter);
- replicator.publish(createRevision(2));
- try {
- replicator.publish(old);
- fail("should have failed to publish an older revision");
- } catch (IllegalArgumentException e) {
- // expected
- }
- assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
- } finally {
- if (sourceDir instanceof MockDirectoryWrapper) {
- // set back to on for other tests
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
- }
+ replicator.publish(old);
+ fail("should have failed to publish an older revision");
+ } catch (IllegalArgumentException e) {
+ // expected
}
+ assertEquals(1, DirectoryReader.listCommits(sourceDir).size());
}
@Test
@@ -210,24 +188,12 @@ public class LocalReplicatorTest extends ReplicatorTestCase {
@Test
public void testRevisionRelease() throws Exception {
- // we look to see that certain files are deleted:
- if (sourceDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(false);
- }
-
- try {
- replicator.publish(createRevision(1));
- assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
- replicator.publish(createRevision(2));
- // now the files of revision 1 can be deleted
- assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_2"));
- assertFalse("segments_1 should not be found in index directory after revision is released", slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
- } finally {
- if (sourceDir instanceof MockDirectoryWrapper) {
- // set back to on for other tests
- ((MockDirectoryWrapper)sourceDir).setEnableVirusScanner(true);
- }
- }
+ replicator.publish(createRevision(1));
+ assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
+ replicator.publish(createRevision(2));
+ // now the files of revision 1 can be deleted
+ assertTrue(slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_2"));
+ assertFalse("segments_1 should not be found in index directory after revision is released", slowFileExists(sourceDir, IndexFileNames.SEGMENTS + "_1"));
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java b/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
index 42adeab..fa9ea00 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
@@ -213,7 +213,6 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
double[] lats = new double[2*numPoints];
double[] lons = new double[2*numPoints];
Directory dir = newDirectory();
- noVirusChecker(dir);
IndexWriterConfig iwc = newIndexWriterConfig();
initIndexWriterConfig(FIELD_NAME, iwc);
@@ -560,7 +559,6 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
} else {
dir = newDirectory();
}
- noVirusChecker(dir);
Set<Integer> deleted = new HashSet<>();
// RandomIndexWriter is too slow here:
@@ -755,11 +753,4 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
IOUtils.close(r, dir);
assertFalse(failed.get());
}
-
- protected Directory noVirusChecker(Directory dir) {
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
index 0b7a5de..edf2a1a 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
@@ -651,7 +651,7 @@ public class TestGeo3DPoint extends LuceneTestCase {
iwc.setCodec(getCodec());
Directory dir;
if (lats.length > 100000) {
- dir = noVirusChecker(newFSDirectory(createTempDir("TestBKDTree")));
+ dir = newFSDirectory(createTempDir("TestBKDTree"));
} else {
dir = getDirectory();
}
@@ -789,14 +789,7 @@ public class TestGeo3DPoint extends LuceneTestCase {
IOUtils.close(r, dir);
}
- private static Directory noVirusChecker(Directory dir) {
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
-
private static Directory getDirectory() {
- return noVirusChecker(newDirectory());
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
index f54ad03..cb2d38c 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
@@ -487,7 +487,7 @@ public class AnalyzingSuggester extends Lookup implements Accountable {
tempSortedFileName = sorter.sort(tempInput.getName());
// Free disk space:
- tempDir.deleteFile(tempInput.getName());
+ tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
reader = new OfflineSorter.ByteSequencesReader(tempDir.openInput(tempSortedFileName, IOContext.READONCE));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
index e07a68c..132c630 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
@@ -19,6 +19,7 @@ package org.apache.lucene.search.suggest.fst;
import java.io.Closeable;
import java.io.IOException;
+import java.util.Collections;
import java.util.Comparator;
import org.apache.lucene.store.IOContext;
@@ -68,7 +69,7 @@ public class ExternalRefSorter implements BytesRefSorter, Closeable {
success = true;
} finally {
if (success) {
- sorter.getDirectory().deleteFile(input.getName());
+ sorter.getDirectory().deleteFiles(Collections.singleton(input.getName()));
} else {
IOUtils.deleteFilesIgnoringExceptions(sorter.getDirectory(), input.getName());
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
index 24dd0f9..d178aa4 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
@@ -204,7 +204,7 @@ public class FSTCompletionLookup extends Lookup implements Accountable {
// We don't know the distribution of scores and we need to bucket them, so we'll sort
// and divide into equal buckets.
tempSortedFileName = sorter.sort(tempInput.getName());
- tempDir.deleteFile(tempInput.getName());
+ tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
FSTCompletionBuilder builder = new FSTCompletionBuilder(
buckets, externalSorter, sharedTailLength);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
index 35c5f25..ea0394b 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
@@ -61,11 +61,7 @@ public class PersistenceTest extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
private void runTest(Class<? extends Lookup> lookupClass, boolean supportsExactWeights) throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
index 55e70bd..050593e 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
@@ -171,10 +171,6 @@ public class TestInputIterator extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
index a9c7acc..1d0891b 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
@@ -1268,10 +1268,6 @@ public class AnalyzingSuggesterTest extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
index 47c19e1..9fbbba3 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
@@ -1213,10 +1213,6 @@ public class FuzzySuggesterTest extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
index ce332ce..7dec5fb 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
@@ -31,9 +31,6 @@ public class BytesRefSortersTest extends LuceneTestCase {
@Test
public void testExternalRefSorter() throws Exception {
Directory tempDir = newDirectory();
- if (tempDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) tempDir).setEnableVirusScanner(false);
- }
ExternalRefSorter s = new ExternalRefSorter(new OfflineSorter(tempDir, "temp"));
check(s);
IOUtils.close(s, tempDir);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
index bddb306..63d108c 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
@@ -273,10 +273,6 @@ public class FSTCompletionTest extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
index c213c4b..2c53ac4 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
@@ -236,10 +236,6 @@ public class WFSTCompletionTest extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
index 9122e99..0c40bb3 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
@@ -183,11 +183,6 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
// Just tests that we can open all files returned by listAll
public void testListAll() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test lists files manually and tries to verify every .cfs it finds,
- // but a virus scanner could leave some trash.
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
// riw should sometimes create docvalues fields, etc
RandomIndexWriter riw = new RandomIndexWriter(random(), dir);
Document doc = new Document();
@@ -252,7 +247,7 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
try {
- cfs.deleteFile(testfile);
+ cfs.deleteFiles(Collections.singleton(testfile));
fail("didn't get expected exception");
} catch (UnsupportedOperationException expected) {
// expected UOE
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
index c53293c..9409c47 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
@@ -197,11 +197,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {
public void testMergeStability() throws Exception {
assumeTrue("merge is not stable", mergeIsStable());
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // Else, the virus checker may prevent deletion of files and cause
- // us to see too many bytes used by extension in the end:
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
+
// do not use newMergePolicy that might return a MockMergePolicy that ignores the no-CFS ratio
// do not use RIW which will change things up!
MergePolicy mp = newTieredMergePolicy();
@@ -220,11 +216,6 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {
DirectoryReader reader = DirectoryReader.open(dir);
Directory dir2 = newDirectory();
- if (dir2 instanceof MockDirectoryWrapper) {
- // Else, the virus checker may prevent deletion of files and cause
- // us to see too many bytes used by extension in the end:
- ((MockDirectoryWrapper) dir2).setEnableVirusScanner(false);
- }
mp = newTieredMergePolicy();
mp.setNoCFSRatio(0);
cfg = new IndexWriterConfig(new MockAnalyzer(random())).setUseCompoundFile(false).setMergePolicy(mp);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
index 2b88d74..9a58f77 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
@@ -216,9 +216,6 @@ public abstract class BasePointFormatTestCase extends BaseIndexFileFormatTestCas
try {
dir.setRandomIOExceptionRate(0.05);
dir.setRandomIOExceptionRateOnOpen(0.05);
- if (dir instanceof MockDirectoryWrapper) {
- dir.setEnableVirusScanner(false);
- }
verify(dir, docValues, null, numDims, numBytesPerDim, true);
} catch (IllegalStateException ise) {
if (ise.getMessage().contains("this writer hit an unrecoverable error")) {
@@ -901,13 +898,6 @@ public abstract class BasePointFormatTestCase extends BaseIndexFileFormatTestCas
return x;
}
- private static Directory noVirusChecker(Directory dir) {
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
-
private Directory getDirectory(int numPoints) throws IOException {
Directory dir;
if (numPoints > 100000) {
@@ -915,7 +905,6 @@ public abstract class BasePointFormatTestCase extends BaseIndexFileFormatTestCas
} else {
dir = newDirectory();
}
- noVirusChecker(dir);
//dir = FSDirectory.open(createTempDir());
return dir;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
index e6dd26e..914cd6d 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
@@ -145,7 +145,6 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
fieldsProducer = null;
dir.close();
- IOUtils.rm(path);
}
}
@@ -172,7 +171,6 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
fieldsProducer.close();
dir.close();
- IOUtils.rm(path);
}
protected static void checkReuse(TermsEnum termsEnum, int firstFlags, int secondFlags, boolean shouldReuse) throws IOException {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java b/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
index 27ba502..fe09389 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
@@ -1271,6 +1271,5 @@ public class RandomPostingsTester {
fieldsProducer.close();
dir.close();
- IOUtils.rm(path);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
index 3d6e43c..894086f 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
@@ -654,7 +654,6 @@ public abstract class ThreadedIndexingAndSearchingTestCase extends LuceneTestCas
TestUtil.checkIndex(dir);
dir.close();
- IOUtils.rm(tempDir);
if (VERBOSE) {
System.out.println("TEST: done [" + (System.currentTimeMillis()-t0) + " ms]");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
new file mode 100644
index 0000000..801a688
--- /dev/null
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -0,0 +1,65 @@
+package org.apache.lucene.mockfile;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.FileSystem;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Random;
+
+import org.apache.lucene.index.IndexWriter;
+
+/**
+ * Acts like Windows, where random programs may open the files you just wrote in an unfriendly
+ * way preventing deletion (e.g. not passing FILE_SHARE_DELETE) or renaming or overwriting etc.
+ */
+public class VirusCheckingFS extends FilterFileSystemProvider {
+
+ // nocommit cannot use random here
+ final Random random;
+
+ private boolean enabled = true;
+
+ /**
+ * Create a new instance, wrapping {@code delegate}.
+ */
+ public VirusCheckingFS(FileSystem delegate, Random random) {
+ super("viruschecking://", delegate);
+ this.random = new Random(random.nextLong());
+ }
+
+ public void disable() {
+ enabled = false;
+ }
+
+ @Override
+ public void delete(Path path) throws IOException {
+
+ if (enabled // test infra disables when it's "really" time to delete after test is done
+ && Files.exists(path) // important that we NOT delay a NoSuchFileException until later
+ && path.getFileName().toString().equals(IndexWriter.WRITE_LOCK_NAME) == false // life is particularly difficult if the virus checker hits our lock file
+ && random.nextInt(5) == 1) {
+ throw new AccessDeniedException("VirusCheckingFS is randomly refusing to delete file \"" + path + "\"");
+ }
+ super.delete(path);
+ }
+
+ // TODO: rename? createOutput? deleteIfExists?
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index c015351..db83153 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -164,7 +164,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
int count = dir.listAll().length;
dir.createOutput("foo.txt", IOContext.DEFAULT).close();
assertEquals(count+1, dir.listAll().length);
- dir.deleteFile("foo.txt");
+ dir.deleteFiles(Collections.singleton("foo.txt"));
assertEquals(count, dir.listAll().length);
dir.close();
}
@@ -668,6 +668,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
// LUCENE-3382 -- make sure we get exception if the directory really does not exist.
public void testNoDir() throws Throwable {
Path tempDir = createTempDir("doesnotexist");
+ assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(tempDir));
IOUtils.rm(tempDir);
Directory dir = getDirectory(tempDir);
try {
@@ -750,9 +751,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
}
in2.close();
- dir.deleteFile("test");
- dir.deleteFile("test2");
-
+ dir.deleteFiles(Arrays.asList(new String[] {"test", "test2"}));
dir.close();
}
@@ -827,6 +826,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
// TODO: somehow change this test to
public void testFsyncDoesntCreateNewFiles() throws Exception {
Path path = createTempDir("nocreate");
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(path));
Directory fsdir = getDirectory(path);
// this test backdoors the directory via the filesystem. so it must be an FSDir (for now)
@@ -1185,7 +1185,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
in.close();
}
Set<String> files = new HashSet<String>(Arrays.asList(dir.listAll()));
- // In case ExtraFS struck:
+ // In case ExtrasFS struck:
files.remove("extra0");
assertEquals(new HashSet<String>(names), files);
dir.close();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index 13bc0ff..5dfe3e8 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@ -17,6 +17,17 @@ package org.apache.lucene.store;
* limitations under the License.
*/
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.Path;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
+
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@@ -32,17 +43,7 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.PrintStreamInfoStream;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.file.AccessDeniedException;
-import java.nio.file.Path;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.ReentrantLock;
+import org.apache.lucene.util.TestUtil;
/** Base class for per-LockFactory tests. */
public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
@@ -54,7 +55,9 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test obtaining and releasing locks, checking validity */
public void testBasics() throws IOException {
- Directory dir = getDirectory(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
try {
@@ -72,7 +75,9 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test closing locks twice */
public void testDoubleClose() throws IOException {
- Directory dir = getDirectory(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
l.close();
@@ -83,18 +88,20 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test ensureValid returns true after acquire */
public void testValidAfterAcquire() throws IOException {
- Directory dir = getDirectory(createTempDir());
-
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
l.ensureValid(); // no exception
l.close();
-
dir.close();
}
/** Test ensureValid throws exception after close */
public void testInvalidAfterClose() throws IOException {
- Directory dir = getDirectory(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
l.close();
@@ -103,12 +110,13 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
l.ensureValid();
fail("didn't get exception");
} catch (AlreadyClosedException expected) {}
-
dir.close();
}
public void testObtainConcurrently() throws InterruptedException, IOException {
- final Directory directory = getDirectory(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ final Directory directory = getDirectory(tempPath);
final AtomicBoolean running = new AtomicBoolean(true);
final AtomicInteger atomicCounter = new AtomicInteger(0);
final ReentrantLock assertingLock = new ReentrantLock();
@@ -156,7 +164,9 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
// IndexWriters over & over in 2 threads and making sure
// no unexpected exceptions are raised:
public void testStressLocks() throws Exception {
- Directory dir = getDirectory(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
+ Directory dir = getDirectory(tempPath);
// First create a 1 doc index:
IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.CREATE));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index ec99c7e..3bd2319 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -73,12 +73,10 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
double randomIOExceptionRate;
double randomIOExceptionRateOnOpen;
Random randomState;
- boolean noDeleteOpenFile = true;
boolean assertNoDeleteOpenFile = false;
boolean preventDoubleWrite = true;
boolean trackDiskUsage = false;
boolean useSlowOpenClosers = LuceneTestCase.TEST_NIGHTLY;
- boolean enableVirusScanner = true;
boolean allowRandomFileNotFoundException = true;
boolean allowReadingFilesStillOpenForWrite = false;
private Set<String> unSyncedFiles;
@@ -105,15 +103,10 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
// is made to delete an open file, we enroll it here.
private Set<String> openFilesDeleted;
- // only tracked if virus scanner is enabled:
- // set of files it prevented deletion for
- private Set<String> triedToDelete;
-
private synchronized void init() {
if (openFiles == null) {
openFiles = new HashMap<>();
openFilesDeleted = new HashSet<>();
- triedToDelete = new HashSet<>();
}
if (createdFiles == null)
@@ -171,18 +164,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
allowReadingFilesStillOpenForWrite = value;
}
- /** Returns true if the virus scanner is enabled */
- public boolean getEnableVirusScanner() {
- return enableVirusScanner;
- }
-
- /** If set to true (the default), deleteFile sometimes
- * fails because a virus scanner is open.
- */
- public void setEnableVirusScanner(boolean value) {
- this.enableVirusScanner = value;
- }
-
/**
* Enum for controlling hard disk throttling.
* Set via {@link MockDirectoryWrapper #setThrottling(Throttling)}
@@ -237,12 +218,8 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
throw new IOException("cannot rename after crash");
}
- if (openFiles.containsKey(source)) {
- if (assertNoDeleteOpenFile) {
- throw (AssertionError) fillOpenTrace(new AssertionError("MockDirectoryWrapper: file \"" + source + "\" is still open: cannot rename"), source, true);
- } else if (noDeleteOpenFile) {
- throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + source + "\" is still open: cannot rename"), source, true);
- }
+ if (assertNoDeleteOpenFile && openFiles.containsKey(source)) {
+ throw (AssertionError) fillOpenTrace(new AssertionError("MockDirectoryWrapper: file \"" + source + "\" is still open: cannot rename"), source, true);
}
boolean success = false;
@@ -281,7 +258,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
/** Simulates a crash of OS or machine by overwriting
* unsynced files. */
public synchronized void crash() throws IOException {
- crashed = true;
openFiles = new HashMap<>();
openFilesForWrite = new HashSet<>();
openFilesDeleted = new HashSet<>();
@@ -303,7 +279,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
if (damage == 0) {
action = "deleted";
- deleteFile(name, true);
+ deleteFiles(Collections.singleton(name));
} else if (damage == 1) {
action = "zeroed";
// Zero out file entirely
@@ -337,28 +313,45 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
ii.close();
// Delete original and copy bytes back:
- deleteFile(name, true);
+ deleteFiles(Collections.singleton(name));
- final IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState));
- ii = in.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
- out.copyBytes(ii, ii.length());
- out.close();
- ii.close();
- deleteFile(tempFileName, true);
+ try(IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
+ ii = in.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
+ out.copyBytes(ii, ii.length());
+ ii.close();
+ } catch (IOException ioe) {
+ // VirusCheckingFS may have blocked the delete, at which point FSDir cannot overwrite here
+ if (ioe.getMessage().equals("file \"" + name + "\" is pending delete and cannot be overwritten")) {
+ // OK
+ action = "deleted";
+ } else {
+ throw ioe;
+ }
+ }
+ deleteFiles(Collections.singleton(tempFileName));
} else if (damage == 3) {
// The file survived intact:
action = "didn't change";
} else {
action = "fully truncated";
// Totally truncate the file to zero bytes
- deleteFile(name, true);
- IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState));
- out.close();
+ deleteFiles(Collections.singleton(name));
+ try (IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
+ } catch (IOException ioe) {
+ // VirusCheckingFS may have blocked the delete, at which point FSDir cannot overwrite here
+ if (ioe.getMessage().equals("file \"" + name + "\" is pending delete and cannot be overwritten")) {
+ // OK
+ action = "deleted";
+ } else {
+ throw ioe;
+ }
+ }
}
if (LuceneTestCase.VERBOSE) {
System.out.println("MockDirectoryWrapper: " + action + " unsynced file: " + name);
}
}
+ crashed = true;
}
public synchronized void clearCrash() {
@@ -385,18 +378,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
}
/**
- * Emulate windows whereby deleting an open file is not
- * allowed (raise IOException).
- */
- public void setNoDeleteOpenFile(boolean value) {
- this.noDeleteOpenFile = value;
- }
-
- public boolean getNoDeleteOpenFile() {
- return noDeleteOpenFile;
- }
-
- /**
* Trip a test assert if there is an attempt
* to delete an open file.
*/
@@ -468,9 +449,28 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
}
@Override
- public synchronized void deleteFile(String name) throws IOException {
+ public synchronized void deleteFiles(Collection<String> names) throws IOException {
maybeYield();
- deleteFile(name, false);
+
+ maybeThrowDeterministicException();
+
+ if (crashed) {
+ throw new IOException("cannot delete after crash");
+ }
+
+ for(String name : names) {
+ if (openFiles.containsKey(name)) {
+ openFilesDeleted.add(name);
+ if (assertNoDeleteOpenFile) {
+ throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot delete"), name, true);
+ }
+ } else {
+ openFilesDeleted.remove(name);
+ }
+ }
+
+ unSyncedFiles.removeAll(names);
+ in.deleteFiles(names);
}
// sets the cause of the incoming ioe to be the stack
@@ -494,46 +494,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
}
}
- private synchronized void deleteFile(String name, boolean forced) throws IOException {
- maybeYield();
-
- maybeThrowDeterministicException();
-
- if (crashed && !forced)
- throw new IOException("cannot delete after crash");
-
- if (unSyncedFiles.contains(name))
- unSyncedFiles.remove(name);
- if (!forced && (noDeleteOpenFile || assertNoDeleteOpenFile)) {
- if (openFiles.containsKey(name)) {
- openFilesDeleted.add(name);
-
- if (!assertNoDeleteOpenFile) {
- throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot delete"), name, true);
- } else {
- throw (AssertionError) fillOpenTrace(new AssertionError("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot delete"), name, true);
- }
- } else {
- openFilesDeleted.remove(name);
- }
- }
- if (!forced && enableVirusScanner && (randomState.nextInt(4) == 0)) {
- triedToDelete.add(name);
- if (LuceneTestCase.VERBOSE) {
- System.out.println("MDW: now refuse to delete file: " + name);
- }
- throw new IOException("cannot delete file: " + name + ", a virus scanner has it open");
- }
- triedToDelete.remove(name);
- in.deleteFile(name);
- }
-
- /** Returns true if {@link #deleteFile} was called with this
- * fileName, but the virus checker prevented the deletion. */
- public boolean didTryToDelete(String fileName) {
- return triedToDelete.contains(fileName);
- }
-
public synchronized Set<String> getOpenDeletedFiles() {
return new HashSet<>(openFilesDeleted);
}
@@ -561,12 +521,8 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
throw new IOException("file \"" + name + "\" was already written to");
}
}
- if ((noDeleteOpenFile || assertNoDeleteOpenFile) && openFiles.containsKey(name)) {
- if (!assertNoDeleteOpenFile) {
- throw new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot overwrite");
- } else {
- throw new AssertionError("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot overwrite");
- }
+ if (assertNoDeleteOpenFile && openFiles.containsKey(name)) {
+ throw new AssertionError("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot overwrite");
}
unSyncedFiles.add(name);
@@ -751,9 +707,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
// files that we tried to delete, but couldn't because readers were open.
// all that matters is that we tried! (they will eventually go away)
// still open when we tried to delete
- Set<String> pendingDeletions = new HashSet<>(openFilesDeleted);
- // virus scanner when we tried to delete
- pendingDeletions.addAll(triedToDelete);
maybeYield();
if (openFiles == null) {
openFiles = new HashMap<>();
@@ -782,6 +735,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
if (getCheckIndexOnClose()) {
randomIOExceptionRate = 0.0;
randomIOExceptionRateOnOpen = 0.0;
+
if (DirectoryReader.indexExists(this)) {
if (LuceneTestCase.VERBOSE) {
System.out.println("\nNOTE: MockDirectoryWrapper: now crush");
@@ -790,13 +744,14 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
if (LuceneTestCase.VERBOSE) {
System.out.println("\nNOTE: MockDirectoryWrapper: now run CheckIndex");
}
+
+ // nocommit: we should also confirm all prior segments_N are not corrupt?
TestUtil.checkIndex(this, getCrossCheckTermVectorsOnClose(), true);
// TODO: factor this out / share w/ TestIW.assertNoUnreferencedFiles
if (assertNoUnreferencedFilesOnClose) {
// now look for unreferenced files: discount ones that we tried to delete but could not
Set<String> allFiles = new HashSet<>(Arrays.asList(listAll()));
- allFiles.removeAll(pendingDeletions);
String[] startFiles = allFiles.toArray(new String[0]);
IndexWriterConfig iwc = new IndexWriterConfig(null);
iwc.setIndexDeletionPolicy(NoDeletionPolicy.INSTANCE);
@@ -806,51 +761,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
Set<String> startSet = new TreeSet<>(Arrays.asList(startFiles));
Set<String> endSet = new TreeSet<>(Arrays.asList(endFiles));
- if (pendingDeletions.contains("segments.gen") && endSet.contains("segments.gen")) {
- // this is possible if we hit an exception while writing segments.gen, we try to delete it
- // and it ends out in pendingDeletions (but IFD wont remove this).
- startSet.add("segments.gen");
- if (LuceneTestCase.VERBOSE) {
- System.out.println("MDW: Unreferenced check: Ignoring segments.gen that we could not delete.");
- }
- }
-
- // it's possible we cannot delete the segments_N on windows if someone has it open and
- // maybe other files too, depending on timing. normally someone on windows wouldnt have
- // an issue (IFD would nuke this stuff eventually), but we pass NoDeletionPolicy...
- for (String file : pendingDeletions) {
- if (file.startsWith("segments") && !file.equals("segments.gen") && endSet.contains(file)) {
- startSet.add(file);
- if (LuceneTestCase.VERBOSE) {
- System.out.println("MDW: Unreferenced check: Ignoring segments file: " + file + " that we could not delete.");
- }
- SegmentInfos sis;
- try {
- sis = SegmentInfos.readCommit(in, file);
- } catch (IOException ioe) {
- // OK: likely some of the .si files were deleted
- sis = new SegmentInfos();
- }
-
- try {
- Set<String> ghosts = new HashSet<>(sis.files(false));
- for (String s : ghosts) {
- if (endSet.contains(s) && !startSet.contains(s)) {
- assert pendingDeletions.contains(s);
- if (LuceneTestCase.VERBOSE) {
- System.out.println("MDW: Unreferenced check: Ignoring referenced file: " + s + " " +
- "from " + file + " that we could not delete.");
- }
- startSet.add(s);
- }
- }
- } catch (Throwable t) {
- System.err.println("ERROR processing leftover segments file " + file + ":");
- t.printStackTrace();
- }
- }
- }
-
startFiles = startSet.toArray(new String[0]);
endFiles = endSet.toArray(new String[0]);
@@ -880,10 +790,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
extras += "\n\nThese files were added (waaaaaaaaaat!): " + added;
}
- if (pendingDeletions.size() != 0) {
- extras += "\n\nThese files we had previously tried to delete, but couldn't: " + pendingDeletions;
- }
-
throw new RuntimeException("unreferenced files: before delete:\n " + Arrays.toString(startFiles) + "\n after delete:\n " + Arrays.toString(endFiles) + extras);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
index 86f685a..27e4fb9 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
@@ -39,6 +39,7 @@ import org.apache.lucene.mockfile.HandleLimitFS;
import org.apache.lucene.mockfile.LeakFS;
import org.apache.lucene.mockfile.ShuffleFS;
import org.apache.lucene.mockfile.VerboseFS;
+import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.mockfile.WindowsFS;
import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase.SuppressFsync;
@@ -75,6 +76,11 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
private FileSystem fileSystem;
/**
+ * Only set if the file system chain includes the VirusCheckingFS
+ */
+ private VirusCheckingFS virusCheckingFS;
+
+ /**
* Suite failure marker.
*/
private final TestRuleMarkFailure failureMarker;
@@ -174,10 +180,17 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
if (allowed(avoid, ExtrasFS.class)) {
fs = new ExtrasFS(fs, random.nextInt(4) == 0, random.nextBoolean()).getFileSystem(null);
}
+ // nocommit true:
+ if (allowed(avoid, VirusCheckingFS.class) && (true || random.nextInt(10) == 1)) {
+ // 10% of the time we swap in virus checking (acts-like-windows) FS:
+ virusCheckingFS = new VirusCheckingFS(fs, random);
+ fs = virusCheckingFS.getFileSystem(null);
+ }
}
if (LuceneTestCase.VERBOSE) {
System.out.println("filesystem: " + fs.provider());
}
+
return fs.provider().getFileSystem(URI.create("file:///"));
}
@@ -211,6 +224,12 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
// was successful. Otherwise just report the path of temporary files
// and leave them there.
if (failureMarker.wasSuccessful()) {
+
+ if (virusCheckingFS != null) {
+ // Otherwise our IOUtils.rm below can fail:
+ virusCheckingFS.disable();
+ }
+
try {
IOUtils.rm(everything);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
index 99d4be3..89af2e2 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
@@ -26,6 +26,7 @@ import java.io.PrintStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.CharBuffer;
+import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -90,10 +91,15 @@ import org.apache.lucene.index.SlowCodecReaderWrapper;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.index.TieredMergePolicy;
+import org.apache.lucene.mockfile.FilterFileSystem;
+import org.apache.lucene.mockfile.VirusCheckingFS;
+import org.apache.lucene.mockfile.WindowsFS;
import org.apache.lucene.search.FieldDoc;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.FilterDirectory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.NoLockFactory;
import org.apache.lucene.store.RAMDirectory;
@@ -102,6 +108,7 @@ import org.junit.Assert;
import com.carrotsearch.randomizedtesting.generators.RandomInts;
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
+
/**
* General utility methods for Lucene unit tests.
*/
@@ -1281,4 +1288,43 @@ public final class TestUtil {
}
return ram;
}
+
+ public static boolean hasWindowsFS(Directory dir) {
+ dir = FilterDirectory.unwrap(dir);
+ if (dir instanceof FSDirectory) {
+ Path path = ((FSDirectory) dir).getDirectory();
+ FileSystem fs = path.getFileSystem();
+ while (fs instanceof FilterFileSystem) {
+ FilterFileSystem ffs = (FilterFileSystem) fs;
+ if (ffs.getParent() instanceof WindowsFS) {
+ return true;
+ }
+ fs = ffs.getDelegate();
+ }
+ }
+
+ return false;
+ }
+
+ public static boolean hasVirusChecker(Directory dir) {
+ dir = FilterDirectory.unwrap(dir);
+ if (dir instanceof FSDirectory) {
+ return hasVirusChecker(((FSDirectory) dir).getDirectory());
+ } else {
+ return false;
+ }
+ }
+
+ public static boolean hasVirusChecker(Path path) {
+ FileSystem fs = path.getFileSystem();
+ while (fs instanceof FilterFileSystem) {
+ FilterFileSystem ffs = (FilterFileSystem) fs;
+ if (ffs.getParent() instanceof VirusCheckingFS) {
+ return true;
+ }
+ fs = ffs.getDelegate();
+ }
+
+ return false;
+ }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java b/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
index a2ace61..3800ff7 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
@@ -317,7 +317,7 @@ public class FSTTester<T> {
fst = new FST<>(in, outputs);
} finally {
in.close();
- dir.deleteFile("fst.bin");
+ dir.deleteFiles(Collections.singleton("fst.bin"));
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
index d416f8a..f69ea19 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
@@ -55,10 +55,6 @@ public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTes
public void testDeletePartiallyWrittenFilesIfAbort() throws IOException {
Directory dir = newDirectory();
- // test explicitly needs files to always be actually deleted
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig iwConf = newIndexWriterConfig(new MockAnalyzer(random()));
iwConf.setMaxBufferedDocs(RandomInts.randomIntBetween(random(), 2, 30));
iwConf.setCodec(CompressingCodec.randomInstance(random()));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
new file mode 100644
index 0000000..17b1575
--- /dev/null
+++ b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestVirusCheckingFS.java
@@ -0,0 +1,62 @@
+package org.apache.lucene.mockfile;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.FileSystem;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+/** Basic tests for VirusCheckingFS */
+public class TestVirusCheckingFS extends MockFileSystemTestCase {
+
+ @Override
+ protected Path wrap(Path path) {
+ FileSystem fs = new VirusCheckingFS(path.getFileSystem(), random()).getFileSystem(URI.create("file:///"));
+ return new FilterPath(path, fs);
+ }
+
+ /** Test Files.delete fails if a file has an open inputstream against it */
+ public void testDeleteSometimesFails() throws IOException {
+ Path dir = wrap(createTempDir());
+
+ int counter = 0;
+ while (true) {
+ Path path = dir.resolve("file" + counter);
+ counter++;
+
+ OutputStream file = Files.newOutputStream(path);
+ file.write(5);
+ file.close();
+
+ // File is now closed, we attempt delete:
+ try {
+ Files.delete(path);
+ } catch (AccessDeniedException ade) {
+ // expected (sometimes)
+ assertTrue(ade.getMessage().contains("VirusCheckingFS is randomly refusing to delete file "));
+ break;
+ }
+
+ assertFalse(Files.exists(path));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java
index 333ff00..7b80604 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java
@@ -41,10 +41,10 @@ import org.apache.lucene.util.Constants;
/** Basic tests for WindowsFS */
public class TestWindowsFS extends MockFileSystemTestCase {
- // currently we don't emulate windows well enough to work on windows!
@Override
public void setUp() throws Exception {
super.setUp();
+ // irony: currently we don't emulate windows well enough to work on windows!
assumeFalse("windows is not supported", Constants.WINDOWS);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java b/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
index fd30582..92bf568 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
@@ -37,7 +37,6 @@ public class TestMockDirectoryWrapper extends BaseDirectoryTestCase {
} else {
dir = newMockFSDirectory(path);
}
- dir.setEnableVirusScanner(false); // test manipulates filesystem directly
return dir;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
index 715b6a6..cf7220d 100644
--- a/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/DirectoryFactory.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -155,7 +156,7 @@ public abstract class DirectoryFactory implements NamedListInitializedPlugin,
*/
public void move(Directory fromDir, Directory toDir, String fileName, IOContext ioContext) throws IOException {
toDir.copyFrom(fromDir, fileName, fileName, ioContext);
- fromDir.deleteFile(fileName);
+ fromDir.deleteFiles(Collections.singleton(fileName));
}
/**
@@ -248,9 +249,7 @@ public abstract class DirectoryFactory implements NamedListInitializedPlugin,
try {
contents = dir.listAll();
if (contents != null) {
- for (String file : contents) {
- dir.deleteFile(file);
- }
+ dir.deleteFiles(Arrays.asList(contents));
}
} catch (IOException e) {
SolrException.log(log, "Error deleting files from Directory", e);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index 862d4e7..86aaf95 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -1206,7 +1206,7 @@ public class IndexFetcher {
}
}
try {
- dir.deleteFile(IndexFetcher.INDEX_PROPERTIES);
+ dir.deleteFiles(Collections.singleton(IndexFetcher.INDEX_PROPERTIES));
} catch (IOException e) {
// no problem
}
@@ -1651,7 +1651,7 @@ public class IndexFetcher {
}
public void delete() throws Exception {
- copy2Dir.deleteFile(saveAs);
+ copy2Dir.deleteFiles(Collections.singleton(saveAs));
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
index d6a7e1d..cf426ce 100644
--- a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
+++ b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
@@ -21,6 +21,7 @@ import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
@@ -111,7 +112,7 @@ public class RestoreCore implements Callable<Boolean> {
try {
dir = core.getDirectoryFactory().get(core.getDataDir(), DirectoryFactory.DirContext.META_DATA,
core.getSolrConfig().indexConfig.lockType);
- dir.deleteFile(IndexFetcher.INDEX_PROPERTIES);
+ dir.deleteFiles(Collections.singleton(IndexFetcher.INDEX_PROPERTIES));
} finally {
if (dir != null) {
core.getDirectoryFactory().release(dir);
[17/17] lucene-solr git commit: Merge branch 'lucene-6835'
Posted by mi...@apache.org.
Merge branch 'lucene-6835'
Retrying file deletion is now the responsibility of Directory.deleteFile, and Directory.listAll now returns all entries in sorted order.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8e784699
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8e784699
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8e784699
Branch: refs/heads/master
Commit: 8e784699f009b80301306f7fc55225d64b95416b
Parents: 072d44f 5b4c1d9
Author: Mike McCandless <mi...@apache.org>
Authored: Sat Feb 6 08:26:15 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Sat Feb 6 08:26:15 2016 -0500
----------------------------------------------------------------------
lucene/CHANGES.txt | 5 +
.../analysis/hunspell/Test64kAffixes.java | 4 +-
.../analysis/hunspell/TestAllDictionaries.java | 6 +-
.../analysis/hunspell/TestAllDictionaries2.java | 6 -
.../analysis/hunspell/TestDictionary.java | 6 +-
.../hunspell/TestHunspellStemFilter.java | 6 +-
.../util/TestFilesystemResourceLoader.java | 28 +-
.../index/TestBackwardsCompatibility.java | 8 -
.../benchmark/byTask/TestPerfTasksLogic.java | 2 -
.../benchmark/byTask/utils/StreamUtilsTest.java | 14 +-
.../codecs/lucene50/Lucene50CompoundReader.java | 14 +-
.../apache/lucene/index/IndexFileDeleter.java | 137 +--
.../org/apache/lucene/index/IndexWriter.java | 14 +-
.../index/PersistentSnapshotDeletionPolicy.java | 2 +-
.../java/org/apache/lucene/store/Directory.java | 3 +-
.../org/apache/lucene/store/FSDirectory.java | 147 ++-
.../lucene/store/FileSwitchDirectory.java | 6 +-
.../org/apache/lucene/store/MMapDirectory.java | 1 +
.../org/apache/lucene/store/NIOFSDirectory.java | 2 +-
.../lucene/store/NRTCachingDirectory.java | 2 -
.../org/apache/lucene/store/RAMDirectory.java | 9 +-
.../apache/lucene/store/SimpleFSDirectory.java | 1 +
.../java/org/apache/lucene/util/IOUtils.java | 8 +-
.../lucene/util/bkd/OfflinePointWriter.java | 1 -
.../org/apache/lucene/index/TestAddIndexes.java | 2 -
.../index/TestAllFilesCheckIndexHeader.java | 5 -
.../index/TestAllFilesDetectTruncation.java | 5 -
.../apache/lucene/index/TestAtomicUpdate.java | 1 -
.../index/TestBinaryDocValuesUpdates.java | 4 -
.../lucene/index/TestCodecHoldsOpenFiles.java | 12 +-
.../index/TestConcurrentMergeScheduler.java | 4 -
.../apache/lucene/index/TestDeletionPolicy.java | 34 +-
.../index/TestDemoParallelLeafReader.java | 8 +-
.../lucene/index/TestDirectoryReader.java | 384 ++++----
.../lucene/index/TestDirectoryReaderReopen.java | 10 +-
.../test/org/apache/lucene/index/TestDoc.java | 8 +-
.../apache/lucene/index/TestFieldsReader.java | 65 +-
.../lucene/index/TestIndexFileDeleter.java | 31 +-
.../apache/lucene/index/TestIndexWriter.java | 947 +++++++++----------
.../lucene/index/TestIndexWriterCommit.java | 20 -
.../lucene/index/TestIndexWriterDelete.java | 9 +-
.../index/TestIndexWriterDeleteByQuery.java | 2 +-
.../lucene/index/TestIndexWriterExceptions.java | 15 +-
.../lucene/index/TestIndexWriterForceMerge.java | 1 -
.../lucene/index/TestIndexWriterFromReader.java | 17 +-
.../lucene/index/TestIndexWriterOnDiskFull.java | 1 -
.../TestIndexWriterOutOfFileDescriptors.java | 2 +
.../lucene/index/TestNRTReaderCleanup.java | 10 +-
.../apache/lucene/index/TestNeverDelete.java | 8 -
.../index/TestNumericDocValuesUpdates.java | 4 -
.../apache/lucene/index/TestOmitPositions.java | 5 +-
.../org/apache/lucene/index/TestOmitTf.java | 5 +-
.../TestPersistentSnapshotDeletionPolicy.java | 2 +-
.../apache/lucene/index/TestRollingUpdates.java | 4 -
.../index/TestSnapshotDeletionPolicy.java | 22 +-
.../apache/lucene/index/TestStressIndexing.java | 2 +-
.../lucene/index/TestStressIndexing2.java | 6 +-
.../org/apache/lucene/index/TestStressNRT.java | 2 +-
.../lucene/index/TestSwappedIndexFiles.java | 9 -
.../apache/lucene/search/TestPointQueries.java | 41 +-
.../lucene/store/TestBufferedIndexInput.java | 86 +-
.../org/apache/lucene/store/TestDirectory.java | 19 +-
.../lucene/store/TestFileSwitchDirectory.java | 1 -
.../lucene/store/TestNativeFSLockFactory.java | 21 +-
.../apache/lucene/store/TestRAMDirectory.java | 1 -
.../lucene/store/TestSimpleFSLockFactory.java | 1 +
.../org/apache/lucene/util/TestIOUtils.java | 1 +
.../apache/lucene/util/TestOfflineSorter.java | 28 +-
.../org/apache/lucene/util/bkd/TestBKD.java | 6 -
.../org/apache/lucene/util/fst/Test2BFST.java | 1 +
.../org/apache/lucene/util/fst/TestFSTs.java | 3 +-
.../taxonomy/directory/TestAddTaxonomy.java | 17 +-
.../writercache/TestCompactLabelToOrdinal.java | 4 +-
.../org/apache/lucene/store/RAFDirectory.java | 1 +
.../apache/lucene/util/fst/TestFSTsMisc.java | 1 -
.../IndexAndTaxonomyReplicationClientTest.java | 17 -
.../IndexAndTaxonomyRevisionTest.java | 8 -
.../lucene/replicator/IndexRevisionTest.java | 4 -
.../lucene/replicator/LocalReplicatorTest.java | 90 +-
.../replicator/http/HttpReplicatorTest.java | 5 -
.../spatial/util/BaseGeoPointTestCase.java | 9 -
.../org/apache/lucene/geo3d/TestGeo3DPoint.java | 11 +-
.../analyzing/AnalyzingInfixSuggester.java | 3 +-
.../search/suggest/fst/ExternalRefSorter.java | 1 +
.../lucene/search/suggest/PersistenceTest.java | 6 +-
.../search/suggest/TestInputIterator.java | 6 +-
.../analyzing/AnalyzingSuggesterTest.java | 6 +-
.../suggest/analyzing/FuzzySuggesterTest.java | 6 +-
.../search/suggest/fst/BytesRefSortersTest.java | 3 -
.../search/suggest/fst/FSTCompletionTest.java | 6 +-
.../search/suggest/fst/WFSTCompletionTest.java | 6 +-
.../lucene/analysis/VocabularyAssert.java | 2 -
.../index/BaseCompoundFormatTestCase.java | 5 -
.../index/BaseIndexFileFormatTestCase.java | 11 +-
.../lucene/index/BasePointFormatTestCase.java | 11 -
.../index/BasePostingsFormatTestCase.java | 2 -
.../lucene/index/RandomPostingsTester.java | 1 -
.../ThreadedIndexingAndSearchingTestCase.java | 1 -
.../apache/lucene/mockfile/VirusCheckingFS.java | 80 ++
.../lucene/store/BaseDirectoryTestCase.java | 74 +-
.../lucene/store/BaseLockFactoryTestCase.java | 46 +-
.../lucene/store/MockDirectoryWrapper.java | 203 +---
.../org/apache/lucene/util/LuceneTestCase.java | 34 +-
.../util/TestRuleTemporaryFilesCleanup.java | 2 +
.../java/org/apache/lucene/util/TestUtil.java | 102 +-
.../TestCompressingStoredFieldsFormat.java | 4 -
.../lucene/mockfile/TestVirusCheckingFS.java | 62 ++
.../apache/lucene/mockfile/TestWindowsFS.java | 2 +-
.../lucene/store/TestMockDirectoryWrapper.java | 1 -
.../org/apache/solr/handler/RestoreCore.java | 1 -
.../solr/store/blockcache/BlockDirectory.java | 2 +-
.../apache/solr/core/MockDirectoryFactory.java | 3 -
.../solr/core/MockFSDirectoryFactory.java | 1 -
113 files changed, 1536 insertions(+), 1631 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8e784699/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --cc lucene/CHANGES.txt
index 5ec505f,df6723e..c2aa772
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@@ -110,6 -110,6 +110,11 @@@ Changes in Runtime Behavio
and codec components are no longer allowed to use this extension
(Robert Muir, Mike McCandless)
++* LUCENE-6835: Directory.listAll now returns entries in sorted order,
++ to not leak platform-specific behavior, and "retrying file deletion"
++ is now the responsibility of Directory.deleteFile, not the caller.
++ (Robert Muir, Mike McCandless)
++
Tests
* LUCENE-7009: Add expectThrows utility to LuceneTestCase. This uses a lambda
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8e784699/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
----------------------------------------------------------------------
diff --cc lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
index 790c73d,0000000..aa1da81
mode 100644,000000..100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
@@@ -1,769 -1,0 +1,760 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.spatial.util;
+
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.NumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.MultiDocValues;
+import org.apache.lucene.index.NumericDocValues;
+import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SimpleCollector;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.FixedBitSet;
+import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.SloppyMath;
+import org.apache.lucene.util.TestUtil;
+import org.junit.BeforeClass;
+
+// TODO: cutover TestGeoUtils too?
+
+public abstract class BaseGeoPointTestCase extends LuceneTestCase {
+
+ protected static final String FIELD_NAME = "point";
+
+ private static final double LON_SCALE = (0x1L<< GeoEncodingUtils.BITS)/360.0D;
+ private static final double LAT_SCALE = (0x1L<< GeoEncodingUtils.BITS)/180.0D;
+
+ private static double originLat;
+ private static double originLon;
+ private static double lonRange;
+ private static double latRange;
+
+ @BeforeClass
+ public static void beforeClassBase() throws Exception {
+ // Between 1.0 and 3.0:
+ lonRange = 2 * (random().nextDouble() + 0.5);
+ latRange = 2 * (random().nextDouble() + 0.5);
+
+ originLon = GeoUtils.normalizeLon(GeoUtils.MIN_LON_INCL + lonRange + (GeoUtils.MAX_LON_INCL - GeoUtils.MIN_LON_INCL - 2 * lonRange) * random().nextDouble());
+ originLat = GeoUtils.normalizeLat(GeoUtils.MIN_LAT_INCL + latRange + (GeoUtils.MAX_LAT_INCL - GeoUtils.MIN_LAT_INCL - 2 * latRange) * random().nextDouble());
+ }
+
+ /** Return true when testing on a non-small region may be too slow (GeoPoint*Query) */
+ protected boolean forceSmall() {
+ return false;
+ }
+
+ // A particularly tricky adversary for BKD tree:
+ public void testSamePointManyTimes() throws Exception {
+
+ // For GeoPointQuery, only run this test nightly:
+ assumeTrue("GeoPoint*Query is too slow otherwise", TEST_NIGHTLY || forceSmall() == false);
+
+ int numPoints = atLeast(1000);
+ boolean small = random().nextBoolean();
+
+ // Every doc has 2 points:
+ double theLat = randomLat(small);
+ double theLon = randomLon(small);
+
+ double[] lats = new double[numPoints];
+ Arrays.fill(lats, theLat);
+
+ double[] lons = new double[numPoints];
+ Arrays.fill(lons, theLon);
+
+ verify(small, lats, lons);
+ }
+
+ public void testAllLatEqual() throws Exception {
+
+ // For GeoPointQuery, only run this test nightly:
+ assumeTrue("GeoPoint*Query is too slow otherwise", TEST_NIGHTLY || forceSmall() == false);
+
+ int numPoints = atLeast(10000);
+ boolean small = forceSmall() || random().nextBoolean();
+ double lat = randomLat(small);
+ double[] lats = new double[numPoints];
+ double[] lons = new double[numPoints];
+
+ boolean haveRealDoc = false;
+
+ for(int docID=0;docID<numPoints;docID++) {
+ int x = random().nextInt(20);
+ if (x == 17) {
+ // Some docs don't have a point:
+ lats[docID] = Double.NaN;
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " is missing");
+ }
+ continue;
+ }
+
+ if (docID > 0 && x == 14 && haveRealDoc) {
+ int oldDocID;
+ while (true) {
+ oldDocID = random().nextInt(docID);
+ if (Double.isNaN(lats[oldDocID]) == false) {
+ break;
+ }
+ }
+
+ // Fully identical point:
+ lons[docID] = lons[oldDocID];
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " lat=" + lat + " lon=" + lons[docID] + " (same lat/lon as doc=" + oldDocID + ")");
+ }
+ } else {
+ lons[docID] = randomLon(small);
+ haveRealDoc = true;
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " lat=" + lat + " lon=" + lons[docID]);
+ }
+ }
+ lats[docID] = lat;
+ }
+
+ verify(small, lats, lons);
+ }
+
+ public void testAllLonEqual() throws Exception {
+
+ // For GeoPointQuery, only run this test nightly:
+ assumeTrue("GeoPoint*Query is too slow otherwise", TEST_NIGHTLY || forceSmall() == false);
+
+ int numPoints = atLeast(10000);
+ boolean small = forceSmall() || random().nextBoolean();
+ double theLon = randomLon(small);
+ double[] lats = new double[numPoints];
+ double[] lons = new double[numPoints];
+
+ boolean haveRealDoc = false;
+
+ //System.out.println("theLon=" + theLon);
+
+ for(int docID=0;docID<numPoints;docID++) {
+ int x = random().nextInt(20);
+ if (x == 17) {
+ // Some docs don't have a point:
+ lats[docID] = Double.NaN;
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " is missing");
+ }
+ continue;
+ }
+
+ if (docID > 0 && x == 14 && haveRealDoc) {
+ int oldDocID;
+ while (true) {
+ oldDocID = random().nextInt(docID);
+ if (Double.isNaN(lats[oldDocID]) == false) {
+ break;
+ }
+ }
+
+ // Fully identical point:
+ lats[docID] = lats[oldDocID];
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " lat=" + lats[docID] + " lon=" + theLon + " (same lat/lon as doc=" + oldDocID + ")");
+ }
+ } else {
+ lats[docID] = randomLat(small);
+ haveRealDoc = true;
+ if (VERBOSE) {
+ System.out.println(" doc=" + docID + " lat=" + lats[docID] + " lon=" + theLon);
+ }
+ }
+ lons[docID] = theLon;
+ }
+
+ verify(small, lats, lons);
+ }
+
+ public void testMultiValued() throws Exception {
+
+ // For GeoPointQuery, only run this test nightly:
+ assumeTrue("GeoPoint*Query is too slow otherwise", TEST_NIGHTLY || forceSmall() == false);
+
+ int numPoints = atLeast(10000);
+ // Every doc has 2 points:
+ double[] lats = new double[2*numPoints];
+ double[] lons = new double[2*numPoints];
+ Directory dir = newDirectory();
- noVirusChecker(dir);
+ IndexWriterConfig iwc = newIndexWriterConfig();
+ initIndexWriterConfig(FIELD_NAME, iwc);
+
+ // We rely on docID order:
+ iwc.setMergePolicy(newLogMergePolicy());
+ RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
+
+ boolean small = random().nextBoolean();
+
+ for (int id=0;id<numPoints;id++) {
+ Document doc = new Document();
+ lats[2*id] = randomLat(small);
+ lons[2*id] = randomLon(small);
+ doc.add(newStringField("id", ""+id, Field.Store.YES));
+ addPointToDoc(FIELD_NAME, doc, lats[2*id], lons[2*id]);
+ lats[2*id+1] = randomLat(small);
+ lons[2*id+1] = randomLon(small);
+ addPointToDoc(FIELD_NAME, doc, lats[2*id+1], lons[2*id+1]);
+
+ if (VERBOSE) {
+ System.out.println("id=" + id);
+ System.out.println(" lat=" + lats[2*id] + " lon=" + lons[2*id]);
+ System.out.println(" lat=" + lats[2*id+1] + " lon=" + lons[2*id+1]);
+ }
+ w.addDocument(doc);
+ }
+
+ // TODO: share w/ verify; just need parallel array of the expected ids
+ if (random().nextBoolean()) {
+ w.forceMerge(1);
+ }
+ IndexReader r = w.getReader();
+ w.close();
+
+ // We can't wrap with "exotic" readers because the BKD query must see the BKDDVFormat:
+ IndexSearcher s = newSearcher(r, false);
+
+ int iters = atLeast(75);
+ for (int iter=0;iter<iters;iter++) {
+ GeoRect rect = randomRect(small, small == false);
+
+ if (VERBOSE) {
+ System.out.println("\nTEST: iter=" + iter + " rect=" + rect);
+ }
+
+ Query query = newRectQuery(FIELD_NAME, rect);
+
+ final FixedBitSet hits = new FixedBitSet(r.maxDoc());
+ s.search(query, new SimpleCollector() {
+
+ private int docBase;
+
+ @Override
+ public boolean needsScores() {
+ return false;
+ }
+
+ @Override
+ protected void doSetNextReader(LeafReaderContext context) throws IOException {
+ docBase = context.docBase;
+ }
+
+ @Override
+ public void collect(int doc) {
+ hits.set(docBase+doc);
+ }
+ });
+
+ boolean fail = false;
+
+ for(int docID=0;docID<lats.length/2;docID++) {
+ double latDoc1 = lats[2*docID];
+ double lonDoc1 = lons[2*docID];
+ double latDoc2 = lats[2*docID+1];
+ double lonDoc2 = lons[2*docID+1];
+
+ Boolean result1 = rectContainsPoint(rect, latDoc1, lonDoc1);
+ if (result1 == null) {
+ // borderline case: cannot test
+ continue;
+ }
+
+ Boolean result2 = rectContainsPoint(rect, latDoc2, lonDoc2);
+ if (result2 == null) {
+ // borderline case: cannot test
+ continue;
+ }
+
+ boolean expected = result1 == Boolean.TRUE || result2 == Boolean.TRUE;
+
+ if (hits.get(docID) != expected) {
+ String id = s.doc(docID).get("id");
+ if (expected) {
+ System.out.println(Thread.currentThread().getName() + ": id=" + id + " docID=" + docID + " should match but did not");
+ } else {
+ System.out.println(Thread.currentThread().getName() + ": id=" + id + " docID=" + docID + " should not match but did");
+ }
+ System.out.println(" rect=" + rect);
+ System.out.println(" lat=" + latDoc1 + " lon=" + lonDoc1 + "\n lat=" + latDoc2 + " lon=" + lonDoc2);
+ System.out.println(" result1=" + result1 + " result2=" + result2);
+ fail = true;
+ }
+ }
+
+ if (fail) {
+ fail("some hits were wrong");
+ }
+ }
+ r.close();
+ dir.close();
+ }
+
+ public void testRandomTiny() throws Exception {
+ // Make sure single-leaf-node case is OK:
+ doTestRandom(10);
+ }
+
+ public void testRandomMedium() throws Exception {
+ doTestRandom(10000);
+ }
+
+ @Nightly
+ public void testRandomBig() throws Exception {
+ assumeFalse("Direct codec can OOME on this test", TestUtil.getDocValuesFormat(FIELD_NAME).equals("Direct"));
+ assumeFalse("Memory codec can OOME on this test", TestUtil.getDocValuesFormat(FIELD_NAME).equals("Memory"));
+ doTestRandom(200000);
+ }
+
+ private void doTestRandom(int count) throws Exception {
+
+ int numPoints = atLeast(count);
+
+ if (VERBOSE) {
+ System.out.println("TEST: numPoints=" + numPoints);
+ }
+
+ double[] lats = new double[numPoints];
+ double[] lons = new double[numPoints];
+
+ boolean small = random().nextBoolean();
+
+ boolean haveRealDoc = false;
+
+ for (int id=0;id<numPoints;id++) {
+ int x = random().nextInt(20);
+ if (x == 17) {
+ // Some docs don't have a point:
+ lats[id] = Double.NaN;
+ if (VERBOSE) {
+ System.out.println(" id=" + id + " is missing");
+ }
+ continue;
+ }
+
+ if (id > 0 && x < 3 && haveRealDoc) {
+ int oldID;
+ while (true) {
+ oldID = random().nextInt(id);
+ if (Double.isNaN(lats[oldID]) == false) {
+ break;
+ }
+ }
+
+ if (x == 0) {
+ // Identical lat to old point
+ lats[id] = lats[oldID];
+ lons[id] = randomLon(small);
+ if (VERBOSE) {
+ System.out.println(" id=" + id + " lat=" + lats[id] + " lon=" + lons[id] + " (same lat as doc=" + oldID + ")");
+ }
+ } else if (x == 1) {
+ // Identical lon to old point
+ lats[id] = randomLat(small);
+ lons[id] = lons[oldID];
+ if (VERBOSE) {
+ System.out.println(" id=" + id + " lat=" + lats[id] + " lon=" + lons[id] + " (same lon as doc=" + oldID + ")");
+ }
+ } else {
+ assert x == 2;
+ // Fully identical point:
+ lats[id] = lats[oldID];
+ lons[id] = lons[oldID];
+ if (VERBOSE) {
+ System.out.println(" id=" + id + " lat=" + lats[id] + " lon=" + lons[id] + " (same lat/lon as doc=" + oldID + ")");
+ }
+ }
+ } else {
+ lats[id] = randomLat(small);
+ lons[id] = randomLon(small);
+ haveRealDoc = true;
+ if (VERBOSE) {
+ System.out.println(" id=" + id + " lat=" + lats[id] + " lon=" + lons[id]);
+ }
+ }
+ }
+
+ verify(small, lats, lons);
+ }
+
+ public double randomLat(boolean small) {
+ double result;
+ if (small) {
+ result = GeoUtils.normalizeLat(originLat + latRange * (random().nextDouble() - 0.5));
+ } else {
+ result = -90 + 180.0 * random().nextDouble();
+ }
+ return result;
+ }
+
+ public double randomLon(boolean small) {
+ double result;
+ if (small) {
+ result = GeoUtils.normalizeLon(originLon + lonRange * (random().nextDouble() - 0.5));
+ } else {
+ result = -180 + 360.0 * random().nextDouble();
+ }
+ return result;
+ }
+
+ protected GeoRect randomRect(boolean small, boolean canCrossDateLine) {
+ double lat0 = randomLat(small);
+ double lat1 = randomLat(small);
+ double lon0 = randomLon(small);
+ double lon1 = randomLon(small);
+
+ if (lat1 < lat0) {
+ double x = lat0;
+ lat0 = lat1;
+ lat1 = x;
+ }
+
+ if (canCrossDateLine == false && lon1 < lon0) {
+ double x = lon0;
+ lon0 = lon1;
+ lon1 = x;
+ }
+
+ return new GeoRect(lon0, lon1, lat0, lat1);
+ }
+
+ protected void initIndexWriterConfig(String field, IndexWriterConfig iwc) {
+ }
+
+ protected abstract void addPointToDoc(String field, Document doc, double lat, double lon);
+
+ protected abstract Query newRectQuery(String field, GeoRect bbox);
+
+ protected abstract Query newDistanceQuery(String field, double centerLat, double centerLon, double radiusMeters);
+
+ protected abstract Query newDistanceRangeQuery(String field, double centerLat, double centerLon, double minRadiusMeters, double radiusMeters);
+
+ protected abstract Query newPolygonQuery(String field, double[] lats, double[] lons);
+
+ /** Returns null if it's borderline case */
+ protected abstract Boolean rectContainsPoint(GeoRect rect, double pointLat, double pointLon);
+
+ /** Returns null if it's borderline case */
+ protected abstract Boolean polyRectContainsPoint(GeoRect rect, double pointLat, double pointLon);
+
+ /** Returns null if it's borderline case */
+ protected abstract Boolean circleContainsPoint(double centerLat, double centerLon, double radiusMeters, double pointLat, double pointLon);
+
+ protected abstract Boolean distanceRangeContainsPoint(double centerLat, double centerLon, double minRadiusMeters, double radiusMeters, double pointLat, double pointLon);
+
+ private static abstract class VerifyHits {
+
+ public void test(AtomicBoolean failed, boolean small, IndexSearcher s, NumericDocValues docIDToID, Set<Integer> deleted, Query query, double[] lats, double[] lons) throws Exception {
+ int maxDoc = s.getIndexReader().maxDoc();
+ final FixedBitSet hits = new FixedBitSet(maxDoc);
+ s.search(query, new SimpleCollector() {
+
+ private int docBase;
+
+ @Override
+ public boolean needsScores() {
+ return false;
+ }
+
+ @Override
+ protected void doSetNextReader(LeafReaderContext context) throws IOException {
+ docBase = context.docBase;
+ }
+
+ @Override
+ public void collect(int doc) {
+ hits.set(docBase+doc);
+ }
+ });
+
+ boolean fail = false;
+
+ for(int docID=0;docID<maxDoc;docID++) {
+ int id = (int) docIDToID.get(docID);
+ Boolean expected;
+ if (deleted.contains(id)) {
+ expected = false;
+ } else if (Double.isNaN(lats[id])) {
+ expected = false;
+ } else {
+ expected = shouldMatch(lats[id], lons[id]);
+ }
+
+ // null means it's a borderline case which is allowed to be wrong:
+ if (expected != null && hits.get(docID) != expected) {
+ if (expected) {
+ System.out.println(Thread.currentThread().getName() + ": id=" + id + " should match but did not");
+ } else {
+ System.out.println(Thread.currentThread().getName() + ": id=" + id + " should not match but did");
+ }
+ System.out.println(" small=" + small + " query=" + query +
+ " docID=" + docID + "\n lat=" + lats[id] + " lon=" + lons[id] +
+ "\n deleted?=" + deleted.contains(id));
+ if (Double.isNaN(lats[id]) == false) {
+ describe(docID, lats[id], lons[id]);
+ }
+ fail = true;
+ }
+ }
+
+ if (fail) {
+ failed.set(true);
+ fail("some hits were wrong");
+ }
+ }
+
+ /** Return true if we definitely should match, false if we definitely
+ * should not match, and null if it's a borderline case which might
+ * go either way. */
+ protected abstract Boolean shouldMatch(double lat, double lon);
+
+ protected abstract void describe(int docID, double lat, double lon);
+ }
+
+ protected void verify(boolean small, double[] lats, double[] lons) throws Exception {
+ IndexWriterConfig iwc = newIndexWriterConfig();
+ // Else we can get O(N^2) merging:
+ int mbd = iwc.getMaxBufferedDocs();
+ if (mbd != -1 && mbd < lats.length/100) {
+ iwc.setMaxBufferedDocs(lats.length/100);
+ }
+ Directory dir;
+ if (lats.length > 100000) {
+ dir = newFSDirectory(createTempDir(getClass().getSimpleName()));
+ } else {
+ dir = newDirectory();
+ }
- noVirusChecker(dir);
+
+ Set<Integer> deleted = new HashSet<>();
+ // RandomIndexWriter is too slow here:
+ IndexWriter w = new IndexWriter(dir, iwc);
+ for(int id=0;id<lats.length;id++) {
+ Document doc = new Document();
+ doc.add(newStringField("id", ""+id, Field.Store.NO));
+ doc.add(new NumericDocValuesField("id", id));
+ if (Double.isNaN(lats[id]) == false) {
+ addPointToDoc(FIELD_NAME, doc, lats[id], lons[id]);
+ }
+ w.addDocument(doc);
+ if (id > 0 && random().nextInt(100) == 42) {
+ int idToDelete = random().nextInt(id);
+ w.deleteDocuments(new Term("id", ""+idToDelete));
+ deleted.add(idToDelete);
+ if (VERBOSE) {
+ System.out.println(" delete id=" + idToDelete);
+ }
+ }
+ }
+
+ if (random().nextBoolean()) {
+ w.forceMerge(1);
+ }
+ final IndexReader r = DirectoryReader.open(w);
+ w.close();
+
+ // We can't wrap with "exotic" readers because the BKD query must see the BKDDVFormat:
+ IndexSearcher s = newSearcher(r, false);
+
+ // Make sure queries are thread safe:
+ int numThreads = TestUtil.nextInt(random(), 2, 5);
+
+ List<Thread> threads = new ArrayList<>();
+ final int iters = atLeast(75);
+
+ final CountDownLatch startingGun = new CountDownLatch(1);
+ final AtomicBoolean failed = new AtomicBoolean();
+
+ for(int i=0;i<numThreads;i++) {
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ try {
+ _run();
+ } catch (Exception e) {
+ failed.set(true);
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void _run() throws Exception {
+ startingGun.await();
+
+ NumericDocValues docIDToID = MultiDocValues.getNumericValues(r, "id");
+
+ for (int iter=0;iter<iters && failed.get() == false;iter++) {
+
+ if (VERBOSE) {
+ System.out.println("\nTEST: iter=" + iter + " s=" + s);
+ }
+ Query query;
+ VerifyHits verifyHits;
+
+ if (random().nextBoolean()) {
+ // Rect: don't allow dateline crossing when testing small:
+ final GeoRect rect = randomRect(small, small == false);
+
+ query = newRectQuery(FIELD_NAME, rect);
+
+ verifyHits = new VerifyHits() {
+ @Override
+ protected Boolean shouldMatch(double pointLat, double pointLon) {
+ return rectContainsPoint(rect, pointLat, pointLon);
+ }
+ @Override
+ protected void describe(int docID, double lat, double lon) {
+ }
+ };
+
+ } else if (random().nextBoolean()) {
+ // Distance
+ final boolean rangeQuery = random().nextBoolean();
+ final double centerLat = randomLat(small);
+ final double centerLon = randomLon(small);
+
+ double radiusMeters;
+ double minRadiusMeters;
+
+ if (small) {
+ // Approx 3 degrees lon at the equator:
+ radiusMeters = random().nextDouble() * 333000 + 1.0;
+ } else {
+ // So the query can cover at most 50% of the earth's surface:
+ radiusMeters = random().nextDouble() * GeoProjectionUtils.SEMIMAJOR_AXIS * Math.PI / 2.0 + 1.0;
+ }
+
+ // generate a random minimum radius between 1% and 95% the max radius
+ minRadiusMeters = (0.01 + 0.94 * random().nextDouble()) * radiusMeters;
+
+ if (VERBOSE) {
+ final DecimalFormat df = new DecimalFormat("#,###.00", DecimalFormatSymbols.getInstance(Locale.ENGLISH));
+ System.out.println(" radiusMeters = " + df.format(radiusMeters)
+ + ((rangeQuery == true) ? " minRadiusMeters = " + df.format(minRadiusMeters) : ""));
+ }
+
+ try {
+ if (rangeQuery == true) {
+ query = newDistanceRangeQuery(FIELD_NAME, centerLat, centerLon, minRadiusMeters, radiusMeters);
+ } else {
+ query = newDistanceQuery(FIELD_NAME, centerLat, centerLon, radiusMeters);
+ }
+ } catch (IllegalArgumentException e) {
+ if (e.getMessage().contains("exceeds maxRadius")) {
+ continue;
+ }
+ throw e;
+ }
+
+ verifyHits = new VerifyHits() {
+ @Override
+ protected Boolean shouldMatch(double pointLat, double pointLon) {
+ if (rangeQuery == false) {
+ return circleContainsPoint(centerLat, centerLon, radiusMeters, pointLat, pointLon);
+ } else {
+ return distanceRangeContainsPoint(centerLat, centerLon, minRadiusMeters, radiusMeters, pointLat, pointLon);
+ }
+ }
+
+ @Override
+ protected void describe(int docID, double pointLat, double pointLon) {
+ double distanceKM = SloppyMath.haversin(centerLat, centerLon, pointLat, pointLon);
+ System.out.println(" docID=" + docID + " centerLon=" + centerLon + " centerLat=" + centerLat
+ + " pointLon=" + pointLon + " pointLat=" + pointLat + " distanceMeters=" + (distanceKM * 1000)
+ + " vs" + ((rangeQuery == true) ? " minRadiusMeters=" + minRadiusMeters : "") + " radiusMeters=" + radiusMeters);
+ }
+ };
+
+ // TODO: get poly query working with dateline crossing too (how?)!
+ } else {
+
+ // TODO: poly query can't handle dateline crossing yet:
+ final GeoRect bbox = randomRect(small, false);
+
+ // Polygon
+ double[] lats = new double[5];
+ double[] lons = new double[5];
+ lats[0] = bbox.minLat;
+ lons[0] = bbox.minLon;
+ lats[1] = bbox.maxLat;
+ lons[1] = bbox.minLon;
+ lats[2] = bbox.maxLat;
+ lons[2] = bbox.maxLon;
+ lats[3] = bbox.minLat;
+ lons[3] = bbox.maxLon;
+ lats[4] = bbox.minLat;
+ lons[4] = bbox.minLon;
+ query = newPolygonQuery(FIELD_NAME, lats, lons);
+
+ verifyHits = new VerifyHits() {
+ @Override
+ protected Boolean shouldMatch(double pointLat, double pointLon) {
+ return polyRectContainsPoint(bbox, pointLat, pointLon);
+ }
+
+ @Override
+ protected void describe(int docID, double lat, double lon) {
+ }
+ };
+ }
+
+ if (query != null) {
+
+ if (VERBOSE) {
+ System.out.println(" query=" + query);
+ }
+
+ verifyHits.test(failed, small, s, docIDToID, deleted, query, lats, lons);
+ }
+ }
+ }
+ };
+ thread.setName("T" + i);
+ thread.start();
+ threads.add(thread);
+ }
+ startingGun.countDown();
+ for(Thread thread : threads) {
+ thread.join();
+ }
+ IOUtils.close(r, dir);
+ assertFalse(failed.get());
+ }
-
- protected Directory noVirusChecker(Directory dir) {
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
+}
[09/17] lucene-solr git commit: fix some more nocommits;
reduce retry-pending-deletes frequency so it's not O(N^2)
Posted by mi...@apache.org.
fix some more nocommits; reduce retry-pending-deletes frequency so it's not O(N^2)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8cd731be
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8cd731be
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8cd731be
Branch: refs/heads/master
Commit: 8cd731be50aaa0df2b9d5bb038668e7f08081dca
Parents: f0b9186
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 16:56:10 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 3 16:56:10 2016 -0500
----------------------------------------------------------------------
.../org/apache/lucene/index/IndexWriter.java | 3 +-
.../org/apache/lucene/store/FSDirectory.java | 81 +++++++++++++-------
.../apache/lucene/index/TestIndexWriter.java | 30 ++++++--
.../lucene/store/MockDirectoryWrapper.java | 1 -
4 files changed, 80 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd731be/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index ce79309..f161f5a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -4617,8 +4617,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
* commits are no longer needed. Otherwise, those commits will
* be deleted the next time commit() is called.
*/
- // nocommit remove this
public synchronized void deleteUnusedFiles() throws IOException {
+ // TODO: should we remove this method now that it's the Directory's job to retry deletions? Except, for the super expert IDP use case
+ // it's still needed?
ensureOpen(false);
deleter.revisitPolicy();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd731be/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 fa6ce63..da69aca 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -38,6 +38,7 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.lucene.index.IndexFileNames;
@@ -129,7 +130,9 @@ public abstract class FSDirectory extends BaseDirectory {
/** Maps files that we are trying to delete (or we tried already but failed)
* before attempting to delete that key. */
- protected final Set<String> pendingDeletes = Collections.newSetFromMap(new ConcurrentHashMap<String,Boolean>());
+ private final Set<String> pendingDeletes = Collections.newSetFromMap(new ConcurrentHashMap<String,Boolean>());
+
+ private final AtomicInteger opsSinceLastDelete = new AtomicInteger();
/** Used to generate temp file names in {@link #createTempOutput}. */
private final AtomicLong nextTempFileCounter = new AtomicLong();
@@ -241,17 +244,23 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public IndexOutput createOutput(String name, IOContext context) throws IOException {
ensureOpen();
- // nocommit do we need to check pending deletes?
- deletePendingFiles();
+
+ // If this file was pending delete, we are now bringing it back to life:
+ pendingDeletes.remove(name);
+ maybeDeletePendingFiles();
return new FSIndexOutput(name);
}
@Override
public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException {
ensureOpen();
+ maybeDeletePendingFiles();
while (true) {
try {
String name = IndexFileNames.segmentFileName(prefix, suffix + "_" + Long.toString(nextTempFileCounter.getAndIncrement(), Character.MAX_RADIX), "tmp");
+ if (pendingDeletes.contains(name)) {
+ continue;
+ }
return new FSIndexOutput(name,
StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW);
} catch (FileAlreadyExistsException faee) {
@@ -261,7 +270,7 @@ public abstract class FSDirectory extends BaseDirectory {
}
protected void ensureCanRead(String name) throws IOException {
- deletePendingFiles();
+ maybeDeletePendingFiles();
if (pendingDeletes.contains(name)) {
throw new NoSuchFileException("file \"" + name + "\" is pending delete and cannot be opened for read");
}
@@ -270,6 +279,7 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public void sync(Collection<String> names) throws IOException {
ensureOpen();
+ maybeDeletePendingFiles();
for (String name : names) {
fsync(name);
@@ -279,6 +289,7 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public void renameFile(String source, String dest) throws IOException {
ensureOpen();
+ maybeDeletePendingFiles();
Files.move(directory.resolve(source), directory.resolve(dest), StandardCopyOption.ATOMIC_MOVE);
// TODO: should we move directory fsync to a separate 'syncMetadata' method?
// for example, to improve listCommits(), IndexFileDeleter could also call that after deleting segments_Ns
@@ -288,7 +299,7 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public synchronized void close() throws IOException {
isOpen = false;
- deletePendingFiles();
+ maybeDeletePendingFiles();
}
/** @return the underlying filesystem directory */
@@ -303,12 +314,48 @@ public abstract class FSDirectory extends BaseDirectory {
}
protected void fsync(String name) throws IOException {
- deletePendingFiles();
IOUtils.fsync(directory.resolve(name), false);
}
@Override
public void deleteFile(String name) throws IOException {
+ if (pendingDeletes.contains(name)) {
+ throw new NoSuchFileException("file \"" + name + "\" is already pending delete");
+ }
+ privateDeleteFile(name);
+ }
+
+ /** Tries to delete any pending deleted files, and returns true if
+ * there are still files that could not be deleted. */
+ public boolean checkPendingDeletions() throws IOException {
+ deletePendingFiles();
+ return pendingDeletes.isEmpty() == false;
+ }
+
+ /** Try to delete any pending files that we had previously tried to delete but failed
+ * because we are on Windows and the files were still held open. */
+ public void deletePendingFiles() throws IOException {
+
+ // TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
+
+ // Clone the set since we mutate it in privateDeleteFile:
+ for(String name : new HashSet<>(pendingDeletes)) {
+ privateDeleteFile(name);
+ }
+ }
+
+ private void maybeDeletePendingFiles() throws IOException {
+ if (pendingDeletes.isEmpty() == false) {
+ // This is a silly heuristic to try to avoid O(N^2), where N = number of files pending deletion, behavior:
+ int count = opsSinceLastDelete.incrementAndGet();
+ if (count >= pendingDeletes.size()) {
+ opsSinceLastDelete.addAndGet(-count);
+ deletePendingFiles();
+ }
+ }
+ }
+
+ private void privateDeleteFile(String name) throws IOException {
try {
Files.delete(directory.resolve(name));
pendingDeletes.remove(name);
@@ -331,28 +378,6 @@ public abstract class FSDirectory extends BaseDirectory {
}
}
- /** Tries to delete any pending deleted files, and returns true if
- * there are still files that could not be deleted. */
- public boolean checkPendingDeletions() throws IOException {
- deletePendingFiles();
- return pendingDeletes.isEmpty() == false;
- }
-
- /** Try to delete any pending files that we had previously tried to delete but failed
- * because we are on Windows and the files were still held open. */
- public void deletePendingFiles() throws IOException {
- // nocommit do we need exponential backoff here for windows?
-
- // TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
-
- Set<String> toDelete = new HashSet<>(pendingDeletes);
-
- // nocommit heroic exceptions here or not?
- for(String name : toDelete) {
- deleteFile(name);
- }
- }
-
final class FSIndexOutput extends OutputStreamIndexOutput {
/**
* The maximum chunk size is 8192 bytes, because file channel mallocs
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd731be/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index 3b45036..a75d032 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -75,15 +75,18 @@ import org.apache.lucene.store.BaseDirectoryWrapper;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.IOContext;
+import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.LockObtainFailedException;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.NIOFSDirectory;
import org.apache.lucene.store.NoLockFactory;
import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.lucene.store.SimpleFSLockFactory;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.Constants;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
@@ -2703,26 +2706,43 @@ public class TestIndexWriter extends LuceneTestCase {
IOUtils.close(r, r2, w, dir);
}
- // nocommit turn test on once we have VirusCheckingFS
- /*
public void testWithPendingDeletions() throws Exception {
- try (FSDirectory dir = FSDirectory.open(createTempDir())) {
+ // irony: currently we don't emulate windows well enough to work on windows!
+ assumeFalse("windows is not supported", Constants.WINDOWS);
+
+ Path path = createTempDir();
+
+ // Use WindowsFS to prevent open files from being deleted:
+ FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///"));
+ Path root = new FilterPath(path, fs);
+
+ // MMapDirectory doesn't work because it closes its file handles after mapping!
+ try (FSDirectory dir = new SimpleFSDirectory(root)) {
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
IndexWriter w = new IndexWriter(dir, iwc);
w.commit();
- IndexInput in = dir.openInput("segments_0", IOContext.DEFAULT);
+ IndexInput in = dir.openInput("segments_1", IOContext.DEFAULT);
w.addDocument(new Document());
w.close();
assertTrue(dir.checkPendingDeletions());
+
+ // make sure we get NFSF if we try to delete and already-pending-delete file:
+ try {
+ dir.deleteFile("segments_1");
+ fail("didn't hit exception");
+ } catch (NoSuchFileException nfse) {
+ // expected
+ }
+
iwc = new IndexWriterConfig(new MockAnalyzer(random()));
try {
w = new IndexWriter(dir, iwc);
} catch (IllegalArgumentException iae) {
assertEquals("Directory still has pending deleted files", iae.getMessage());
}
+ in.close();
}
}
- */
public void testLeftoverTempFiles() throws Exception {
Directory dir = newDirectory();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cd731be/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index 3c79410..b86c043 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -742,7 +742,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
System.out.println("\nNOTE: MockDirectoryWrapper: now run CheckIndex");
}
- // nocommit: we should also confirm all prior segments_N are not corrupt?
TestUtil.checkIndex(this, getCrossCheckTermVectorsOnClose(), true);
// TODO: factor this out / share w/ TestIW.assertNoUnreferencedFiles
[05/17] lucene-solr git commit: fix a few tests; add some nocommits
Posted by mi...@apache.org.
fix a few tests; add some nocommits
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b4a2bf2b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b4a2bf2b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b4a2bf2b
Branch: refs/heads/master
Commit: b4a2bf2b41952be6ec3027943425d15365bcd9a0
Parents: 84f4458
Author: Mike McCandless <mi...@apache.org>
Authored: Tue Feb 2 18:07:06 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Tue Feb 2 18:07:06 2016 -0500
----------------------------------------------------------------------
.../java/org/apache/lucene/store/Directory.java | 1 +
.../org/apache/lucene/store/FSDirectory.java | 55 ++++++++++++++------
.../lucene/index/TestDirectoryReader.java | 6 ++-
.../org/apache/lucene/util/TestIOUtils.java | 3 ++
.../apache/lucene/mockfile/VirusCheckingFS.java | 4 ++
5 files changed, 52 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4a2bf2b/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java
index b9e5ad4..bb12c92 100644
--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java
@@ -47,6 +47,7 @@ public abstract class Directory implements Closeable {
*
* @throws IOException in case of IO error
*/
+ // nocommit should this sort?
public abstract String[] listAll() throws IOException;
/** Removes the specified files from the directory. If an exception is thrown, behavior is undefined
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4a2bf2b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 0e1d4e9..9eb78b4 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -229,22 +229,20 @@ public abstract class FSDirectory extends BaseDirectory {
return listAll(directory, pendingDeletes);
}
- /** Returns the length in bytes of a file in the directory. */
@Override
public long fileLength(String name) throws IOException {
ensureOpen();
return Files.size(directory.resolve(name));
}
- /** Removes an existing file in the directory. */
@Override
public void deleteFiles(Collection<String> names) throws IOException {
ensureOpen();
+ // nocommit isn't it an error if they were already pending delete?
pendingDeletes.addAll(names);
deletePendingFiles();
}
- /** Creates an IndexOutput for the file with the given name. */
@Override
public IndexOutput createOutput(String name, IOContext context) throws IOException {
ensureOpen();
@@ -277,7 +275,7 @@ public abstract class FSDirectory extends BaseDirectory {
protected void ensureCanRead(String name) throws IOException {
deletePendingFiles();
if (pendingDeletes.contains(name)) {
- throw new NoSuchFileException("file \"" + name + "\" is pending delete and cannot be overwritten");
+ throw new NoSuchFileException("file \"" + name + "\" is pending delete and cannot be opened for read");
}
}
@@ -299,7 +297,6 @@ public abstract class FSDirectory extends BaseDirectory {
IOUtils.fsync(directory, true);
}
- /** Closes the store to future operations. */
@Override
public synchronized void close() throws IOException {
isOpen = false;
@@ -312,7 +309,6 @@ public abstract class FSDirectory extends BaseDirectory {
return directory;
}
- /** For debug output. */
@Override
public String toString() {
return this.getClass().getSimpleName() + "@" + directory + " lockFactory=" + lockFactory;
@@ -324,14 +320,13 @@ public abstract class FSDirectory extends BaseDirectory {
}
/** Returns true if the file was successfully removed. */
- private boolean deleteFile(String name) throws IOException {
+ private synchronized boolean deleteFile(String name) throws IOException {
+ pendingDeletes.remove(name);
try {
Files.delete(directory.resolve(name));
- pendingDeletes.remove(name);
return true;
} catch (NoSuchFileException | FileNotFoundException e) {
// We were asked to delete a non-existent file:
- pendingDeletes.remove(name);
throw e;
} catch (IOException ioe) {
// On windows, a file delete can fail because there's still an open
@@ -358,21 +353,36 @@ public abstract class FSDirectory extends BaseDirectory {
}
/** Try to delete any pending files that we had previously tried to delete but failed
- * because we are on Windows and the files were still
- * held open. */
- public void deletePendingFiles() throws IOException {
+ * because we are on Windows and the files were still held open. */
+ public synchronized void deletePendingFiles() throws IOException {
// TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
// Clone the set because it will change as we iterate:
List<String> toDelete = new ArrayList<>(pendingDeletes);
+ System.out.println("del pending: " + pendingDeletes);
// First pass: delete any segments_N files. We do these first to be certain stale commit points are removed
// before we remove any files they reference. If any delete of segments_N fails, we leave all other files
// undeleted so index is never in a corrupt state:
+ Throwable firstException = null;
for (String fileName : toDelete) {
if (fileName.startsWith(IndexFileNames.SEGMENTS)) {
- if (deleteFile(fileName) == false) {
- return;
+ try {
+ if (deleteFile(fileName) == false) {
+ // nocommit
+ System.out.println(" false on " + fileName + "; skipping the rest");
+ return;
+ }
+ } catch (Throwable t) {
+ if (firstException == null) {
+ firstException = t;
+ } else {
+ firstException.addSuppressed(t);
+ }
+ // nocommit
+ System.out.println(" fail on " + fileName + ":");
+ t.printStackTrace(System.out);
+ throw t;
}
}
}
@@ -381,9 +391,24 @@ public abstract class FSDirectory extends BaseDirectory {
// leave a corrupt commit in the index even in the presense of virus checkers:
for(String fileName : toDelete) {
if (fileName.startsWith(IndexFileNames.SEGMENTS) == false) {
- deleteFile(fileName);
+ try {
+ deleteFile(fileName);
+ } catch (Throwable t) {
+ if (firstException == null) {
+ firstException = t;
+ } else {
+ firstException.addSuppressed(t);
+ }
+ // nocommit
+ System.out.println(" fail on " + fileName + ":");
+ t.printStackTrace(System.out);
+ throw t;
+ }
}
}
+
+ // Does nothing if firstException is null:
+ IOUtils.reThrow(firstException);
}
final class FSIndexOutput extends OutputStreamIndexOutput {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4a2bf2b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
index 2c4f392..2213033 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
@@ -472,7 +472,10 @@ void assertTermDocsCount(String msg,
public void testOpenReaderAfterDelete() throws IOException {
Path dirFile = createTempDir("deletetest");
Directory dir = newFSDirectory(dirFile);
- assumeFalse("test deletes files directly", TestUtil.hasVirusChecker(dir));
+ if (TestUtil.hasVirusChecker(dir)) {
+ dir.close();
+ assumeTrue("test deletes files directly", false);
+ }
if (dir instanceof BaseDirectoryWrapper) {
((BaseDirectoryWrapper)dir).setCheckIndexOnClose(false); // we will hit NoSuchFileException in MDW since we nuked it!
}
@@ -1055,7 +1058,6 @@ void assertTermDocsCount(String msg,
public void testIndexExistsOnNonExistentDirectory() throws Exception {
Path tempDir = createTempDir("testIndexExistsOnNonExistentDirectory");
- IOUtils.rm(tempDir);
Directory dir = newFSDirectory(tempDir);
assertFalse(DirectoryReader.indexExists(dir));
dir.close();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4a2bf2b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
index 7a112cd..726f4f8 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
@@ -38,8 +38,11 @@ import java.util.UUID;
import org.apache.lucene.mockfile.FilterFileSystem;
import org.apache.lucene.mockfile.FilterFileSystemProvider;
import org.apache.lucene.mockfile.FilterPath;
+import org.apache.lucene.mockfile.VirusCheckingFS;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
/** Simple test methods for IOUtils */
+@SuppressFileSystems("VirusCheckingFS")
public class TestIOUtils extends LuceneTestCase {
public void testDeleteFileIgnoringExceptions() throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4a2bf2b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
index 801a688..b30ce94 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -25,6 +25,7 @@ import java.nio.file.Path;
import java.util.Random;
import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.util.LuceneTestCase;
/**
* Acts like Windows, where random programs may open the files you just wrote in an unfriendly
@@ -56,6 +57,9 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
&& Files.exists(path) // important that we NOT delay a NoSuchFileException until later
&& path.getFileName().toString().equals(IndexWriter.WRITE_LOCK_NAME) == false // life is particularly difficult if the virus checker hits our lock file
&& random.nextInt(5) == 1) {
+ if (true || LuceneTestCase.VERBOSE) {
+ System.out.println("NOTE: VirusCheckingFS now refusing to delete " + path);
+ }
throw new AccessDeniedException("VirusCheckingFS is randomly refusing to delete file \"" + path + "\"");
}
super.delete(path);
[15/17] lucene-solr git commit: Merge branch 'master' into lucene-6835
Posted by mi...@apache.org.
Merge branch 'master' into lucene-6835
Conflicts:
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d2a5c103
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d2a5c103
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d2a5c103
Branch: refs/heads/master
Commit: d2a5c103266ed3499c989d653f2c38c9e72e443a
Parents: 24f55ab 4569fd7
Author: Mike McCandless <mi...@apache.org>
Authored: Fri Feb 5 12:38:21 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Fri Feb 5 12:38:21 2016 -0500
----------------------------------------------------------------------
lucene/CHANGES.txt | 3 +
.../lucene/analysis/ar/ArabicAnalyzer.java | 4 +-
.../analysis/ar/ArabicNormalizationFilter.java | 4 +-
.../ar/ArabicNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/ar/ArabicNormalizer.java | 4 +-
.../lucene/analysis/ar/ArabicStemFilter.java | 4 +-
.../analysis/ar/ArabicStemFilterFactory.java | 4 +-
.../lucene/analysis/ar/ArabicStemmer.java | 6 +-
.../lucene/analysis/bg/BulgarianAnalyzer.java | 4 +-
.../lucene/analysis/bg/BulgarianStemFilter.java | 4 +-
.../analysis/bg/BulgarianStemFilterFactory.java | 4 +-
.../lucene/analysis/bg/BulgarianStemmer.java | 4 +-
.../lucene/analysis/br/BrazilianAnalyzer.java | 4 +-
.../lucene/analysis/br/BrazilianStemFilter.java | 4 +-
.../analysis/br/BrazilianStemFilterFactory.java | 4 +-
.../lucene/analysis/br/BrazilianStemmer.java | 8 +-
.../lucene/analysis/ca/CatalanAnalyzer.java | 4 +-
.../analysis/charfilter/BaseCharFilter.java | 1 -
.../charfilter/HTMLStripCharFilter.java | 3 +-
.../charfilter/HTMLStripCharFilter.jflex | 3 +-
.../charfilter/HTMLStripCharFilterFactory.java | 4 +-
.../analysis/charfilter/MappingCharFilter.java | 1 -
.../charfilter/MappingCharFilterFactory.java | 4 +-
.../analysis/charfilter/NormalizeCharMap.java | 1 -
.../apache/lucene/analysis/cjk/CJKAnalyzer.java | 4 +-
.../lucene/analysis/cjk/CJKBigramFilter.java | 4 +-
.../analysis/cjk/CJKBigramFilterFactory.java | 4 +-
.../lucene/analysis/cjk/CJKWidthFilter.java | 4 +-
.../analysis/cjk/CJKWidthFilterFactory.java | 4 +-
.../lucene/analysis/ckb/SoraniAnalyzer.java | 4 +-
.../analysis/ckb/SoraniNormalizationFilter.java | 4 +-
.../ckb/SoraniNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/ckb/SoraniNormalizer.java | 4 +-
.../lucene/analysis/ckb/SoraniStemFilter.java | 4 +-
.../analysis/ckb/SoraniStemFilterFactory.java | 4 +-
.../lucene/analysis/ckb/SoraniStemmer.java | 4 +-
.../analysis/commongrams/CommonGramsFilter.java | 1 -
.../commongrams/CommonGramsFilterFactory.java | 4 +-
.../CommonGramsQueryFilterFactory.java | 4 +-
.../compound/CompoundWordTokenFilterBase.java | 4 +-
.../DictionaryCompoundWordTokenFilter.java | 4 +-
...ictionaryCompoundWordTokenFilterFactory.java | 4 +-
.../HyphenationCompoundWordTokenFilter.java | 4 +-
...phenationCompoundWordTokenFilterFactory.java | 4 +-
.../compound/hyphenation/ByteVector.java | 7 +-
.../compound/hyphenation/CharVector.java | 7 +-
.../analysis/compound/hyphenation/Hyphen.java | 7 +-
.../compound/hyphenation/Hyphenation.java | 7 +-
.../compound/hyphenation/HyphenationTree.java | 7 +-
.../compound/hyphenation/PatternConsumer.java | 7 +-
.../compound/hyphenation/PatternParser.java | 7 +-
.../compound/hyphenation/TernaryTree.java | 7 +-
.../analysis/core/DecimalDigitFilter.java | 4 +-
.../core/DecimalDigitFilterFactory.java | 4 +-
.../lucene/analysis/core/KeywordAnalyzer.java | 4 +-
.../lucene/analysis/core/KeywordTokenizer.java | 4 +-
.../analysis/core/KeywordTokenizerFactory.java | 4 +-
.../lucene/analysis/core/LetterTokenizer.java | 4 +-
.../analysis/core/LetterTokenizerFactory.java | 4 +-
.../lucene/analysis/core/LowerCaseFilter.java | 4 +-
.../analysis/core/LowerCaseFilterFactory.java | 4 +-
.../analysis/core/LowerCaseTokenizer.java | 4 +-
.../core/LowerCaseTokenizerFactory.java | 4 +-
.../lucene/analysis/core/SimpleAnalyzer.java | 4 +-
.../lucene/analysis/core/StopAnalyzer.java | 4 +-
.../apache/lucene/analysis/core/StopFilter.java | 4 +-
.../lucene/analysis/core/StopFilterFactory.java | 4 +-
.../lucene/analysis/core/TypeTokenFilter.java | 4 +-
.../analysis/core/TypeTokenFilterFactory.java | 4 +-
.../core/UnicodeWhitespaceAnalyzer.java | 4 +-
.../core/UnicodeWhitespaceTokenizer.java | 4 +-
.../lucene/analysis/core/UpperCaseFilter.java | 4 +-
.../analysis/core/UpperCaseFilterFactory.java | 4 +-
.../analysis/core/WhitespaceAnalyzer.java | 4 +-
.../analysis/core/WhitespaceTokenizer.java | 4 +-
.../core/WhitespaceTokenizerFactory.java | 4 +-
.../lucene/analysis/custom/CustomAnalyzer.java | 4 +-
.../lucene/analysis/cz/CzechAnalyzer.java | 4 +-
.../lucene/analysis/cz/CzechStemFilter.java | 20 +-
.../analysis/cz/CzechStemFilterFactory.java | 4 +-
.../apache/lucene/analysis/cz/CzechStemmer.java | 4 +-
.../lucene/analysis/da/DanishAnalyzer.java | 4 +-
.../lucene/analysis/de/GermanAnalyzer.java | 6 +-
.../analysis/de/GermanLightStemFilter.java | 4 +-
.../de/GermanLightStemFilterFactory.java | 4 +-
.../lucene/analysis/de/GermanLightStemmer.java | 4 +-
.../analysis/de/GermanMinimalStemFilter.java | 4 +-
.../de/GermanMinimalStemFilterFactory.java | 4 +-
.../analysis/de/GermanMinimalStemmer.java | 4 +-
.../analysis/de/GermanNormalizationFilter.java | 4 +-
.../de/GermanNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/de/GermanStemFilter.java | 4 +-
.../analysis/de/GermanStemFilterFactory.java | 4 +-
.../lucene/analysis/de/GermanStemmer.java | 12 +-
.../lucene/analysis/el/GreekAnalyzer.java | 14 +-
.../analysis/el/GreekLowerCaseFilter.java | 14 +-
.../el/GreekLowerCaseFilterFactory.java | 4 +-
.../lucene/analysis/el/GreekStemFilter.java | 4 +-
.../analysis/el/GreekStemFilterFactory.java | 4 +-
.../apache/lucene/analysis/el/GreekStemmer.java | 12 +-
.../lucene/analysis/en/EnglishAnalyzer.java | 4 +-
.../analysis/en/EnglishMinimalStemFilter.java | 4 +-
.../en/EnglishMinimalStemFilterFactory.java | 4 +-
.../analysis/en/EnglishMinimalStemmer.java | 4 +-
.../analysis/en/EnglishPossessiveFilter.java | 4 +-
.../en/EnglishPossessiveFilterFactory.java | 4 +-
.../apache/lucene/analysis/en/KStemFilter.java | 4 +-
.../lucene/analysis/en/KStemFilterFactory.java | 4 +-
.../org/apache/lucene/analysis/en/KStemmer.java | 1 -
.../lucene/analysis/en/PorterStemFilter.java | 4 +-
.../analysis/en/PorterStemFilterFactory.java | 4 +-
.../lucene/analysis/en/PorterStemmer.java | 4 +-
.../lucene/analysis/es/SpanishAnalyzer.java | 4 +-
.../analysis/es/SpanishLightStemFilter.java | 4 +-
.../es/SpanishLightStemFilterFactory.java | 4 +-
.../lucene/analysis/es/SpanishLightStemmer.java | 4 +-
.../lucene/analysis/eu/BasqueAnalyzer.java | 4 +-
.../lucene/analysis/fa/PersianAnalyzer.java | 4 +-
.../lucene/analysis/fa/PersianCharFilter.java | 4 +-
.../analysis/fa/PersianCharFilterFactory.java | 4 +-
.../analysis/fa/PersianNormalizationFilter.java | 4 +-
.../fa/PersianNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/fa/PersianNormalizer.java | 4 +-
.../lucene/analysis/fi/FinnishAnalyzer.java | 4 +-
.../analysis/fi/FinnishLightStemFilter.java | 4 +-
.../fi/FinnishLightStemFilterFactory.java | 4 +-
.../lucene/analysis/fi/FinnishLightStemmer.java | 4 +-
.../lucene/analysis/fr/FrenchAnalyzer.java | 4 +-
.../analysis/fr/FrenchLightStemFilter.java | 4 +-
.../fr/FrenchLightStemFilterFactory.java | 4 +-
.../lucene/analysis/fr/FrenchLightStemmer.java | 4 +-
.../analysis/fr/FrenchMinimalStemFilter.java | 4 +-
.../fr/FrenchMinimalStemFilterFactory.java | 4 +-
.../analysis/fr/FrenchMinimalStemmer.java | 4 +-
.../lucene/analysis/ga/IrishAnalyzer.java | 4 +-
.../analysis/ga/IrishLowerCaseFilter.java | 4 +-
.../ga/IrishLowerCaseFilterFactory.java | 4 +-
.../lucene/analysis/gl/GalicianAnalyzer.java | 4 +-
.../analysis/gl/GalicianMinimalStemFilter.java | 4 +-
.../gl/GalicianMinimalStemFilterFactory.java | 4 +-
.../analysis/gl/GalicianMinimalStemmer.java | 4 +-
.../lucene/analysis/gl/GalicianStemFilter.java | 4 +-
.../analysis/gl/GalicianStemFilterFactory.java | 4 +-
.../lucene/analysis/gl/GalicianStemmer.java | 4 +-
.../lucene/analysis/hi/HindiAnalyzer.java | 4 +-
.../analysis/hi/HindiNormalizationFilter.java | 4 +-
.../hi/HindiNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/hi/HindiNormalizer.java | 4 +-
.../lucene/analysis/hi/HindiStemFilter.java | 4 +-
.../analysis/hi/HindiStemFilterFactory.java | 4 +-
.../apache/lucene/analysis/hi/HindiStemmer.java | 4 +-
.../lucene/analysis/hu/HungarianAnalyzer.java | 4 +-
.../analysis/hu/HungarianLightStemFilter.java | 4 +-
.../hu/HungarianLightStemFilterFactory.java | 4 +-
.../analysis/hu/HungarianLightStemmer.java | 4 +-
.../lucene/analysis/hunspell/Dictionary.java | 4 +-
.../analysis/hunspell/HunspellStemFilter.java | 4 +-
.../hunspell/HunspellStemFilterFactory.java | 4 +-
.../analysis/hunspell/ISO8859_14Decoder.java | 4 +-
.../lucene/analysis/hunspell/Stemmer.java | 4 +-
.../lucene/analysis/hy/ArmenianAnalyzer.java | 4 +-
.../lucene/analysis/id/IndonesianAnalyzer.java | 4 +-
.../analysis/id/IndonesianStemFilter.java | 4 +-
.../id/IndonesianStemFilterFactory.java | 4 +-
.../lucene/analysis/id/IndonesianStemmer.java | 4 +-
.../analysis/in/IndicNormalizationFilter.java | 4 +-
.../in/IndicNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/in/IndicNormalizer.java | 4 +-
.../lucene/analysis/it/ItalianAnalyzer.java | 4 +-
.../analysis/it/ItalianLightStemFilter.java | 4 +-
.../it/ItalianLightStemFilterFactory.java | 4 +-
.../lucene/analysis/it/ItalianLightStemmer.java | 4 +-
.../lucene/analysis/lt/LithuanianAnalyzer.java | 4 +-
.../lucene/analysis/lv/LatvianAnalyzer.java | 4 +-
.../lucene/analysis/lv/LatvianStemFilter.java | 4 +-
.../analysis/lv/LatvianStemFilterFactory.java | 4 +-
.../lucene/analysis/lv/LatvianStemmer.java | 8 +-
.../miscellaneous/ASCIIFoldingFilter.java | 4 +-
.../ASCIIFoldingFilterFactory.java | 4 +-
.../miscellaneous/CapitalizationFilter.java | 4 +-
.../CapitalizationFilterFactory.java | 4 +-
.../miscellaneous/CodepointCountFilter.java | 4 +-
.../CodepointCountFilterFactory.java | 4 +-
.../miscellaneous/DateRecognizerFilter.java | 4 +-
.../DateRecognizerFilterFactory.java | 4 +-
.../miscellaneous/EmptyTokenStream.java | 4 +-
.../miscellaneous/FingerprintFilter.java | 4 +-
.../miscellaneous/FingerprintFilterFactory.java | 4 +-
.../miscellaneous/HyphenatedWordsFilter.java | 4 +-
.../HyphenatedWordsFilterFactory.java | 4 +-
.../analysis/miscellaneous/KeepWordFilter.java | 1 -
.../miscellaneous/KeepWordFilterFactory.java | 4 +-
.../miscellaneous/KeywordMarkerFilter.java | 4 +-
.../KeywordMarkerFilterFactory.java | 4 +-
.../miscellaneous/KeywordRepeatFilter.java | 4 +-
.../KeywordRepeatFilterFactory.java | 4 +-
.../analysis/miscellaneous/LengthFilter.java | 4 +-
.../miscellaneous/LengthFilterFactory.java | 4 +-
.../miscellaneous/LimitTokenCountAnalyzer.java | 4 +-
.../miscellaneous/LimitTokenCountFilter.java | 4 +-
.../LimitTokenCountFilterFactory.java | 4 +-
.../miscellaneous/LimitTokenOffsetFilter.java | 4 +-
.../LimitTokenOffsetFilterFactory.java | 4 +-
.../miscellaneous/LimitTokenPositionFilter.java | 2 +-
.../LimitTokenPositionFilterFactory.java | 2 +-
.../PatternKeywordMarkerFilter.java | 4 +-
.../miscellaneous/PerFieldAnalyzerWrapper.java | 4 +-
.../PrefixAndSuffixAwareTokenFilter.java | 4 +-
.../miscellaneous/PrefixAwareTokenFilter.java | 4 +-
.../RemoveDuplicatesTokenFilter.java | 1 -
.../RemoveDuplicatesTokenFilterFactory.java | 4 +-
.../ScandinavianFoldingFilter.java | 4 +-
.../ScandinavianFoldingFilterFactory.java | 4 +-
.../ScandinavianNormalizationFilter.java | 4 +-
.../ScandinavianNormalizationFilterFactory.java | 4 +-
.../miscellaneous/SetKeywordMarkerFilter.java | 2 +-
.../miscellaneous/StemmerOverrideFilter.java | 4 +-
.../StemmerOverrideFilterFactory.java | 4 +-
.../analysis/miscellaneous/TrimFilter.java | 1 -
.../miscellaneous/TrimFilterFactory.java | 4 +-
.../miscellaneous/TruncateTokenFilter.java | 4 +-
.../TruncateTokenFilterFactory.java | 4 +-
.../miscellaneous/WordDelimiterFilter.java | 3 +-
.../WordDelimiterFilterFactory.java | 4 +-
.../miscellaneous/WordDelimiterIterator.java | 4 +-
.../analysis/ngram/EdgeNGramFilterFactory.java | 4 +-
.../analysis/ngram/EdgeNGramTokenFilter.java | 4 +-
.../analysis/ngram/EdgeNGramTokenizer.java | 4 +-
.../ngram/EdgeNGramTokenizerFactory.java | 4 +-
.../analysis/ngram/NGramFilterFactory.java | 4 +-
.../lucene/analysis/ngram/NGramTokenFilter.java | 4 +-
.../lucene/analysis/ngram/NGramTokenizer.java | 4 +-
.../analysis/ngram/NGramTokenizerFactory.java | 4 +-
.../lucene/analysis/nl/DutchAnalyzer.java | 4 +-
.../lucene/analysis/no/NorwegianAnalyzer.java | 4 +-
.../analysis/no/NorwegianLightStemFilter.java | 4 +-
.../no/NorwegianLightStemFilterFactory.java | 4 +-
.../analysis/no/NorwegianLightStemmer.java | 4 +-
.../analysis/no/NorwegianMinimalStemFilter.java | 4 +-
.../no/NorwegianMinimalStemFilterFactory.java | 4 +-
.../analysis/no/NorwegianMinimalStemmer.java | 4 +-
.../analysis/path/PathHierarchyTokenizer.java | 2 +-
.../path/PathHierarchyTokenizerFactory.java | 4 +-
.../path/ReversePathHierarchyTokenizer.java | 2 +-
.../PatternCaptureGroupFilterFactory.java | 4 +-
.../pattern/PatternCaptureGroupTokenFilter.java | 4 +-
.../pattern/PatternReplaceCharFilter.java | 1 -
.../PatternReplaceCharFilterFactory.java | 4 +-
.../analysis/pattern/PatternReplaceFilter.java | 1 -
.../pattern/PatternReplaceFilterFactory.java | 4 +-
.../analysis/pattern/PatternTokenizer.java | 1 -
.../pattern/PatternTokenizerFactory.java | 4 +-
.../analysis/payloads/AbstractEncoder.java | 8 +-
.../payloads/DelimitedPayloadTokenFilter.java | 2 +-
.../DelimitedPayloadTokenFilterFactory.java | 4 +-
.../lucene/analysis/payloads/FloatEncoder.java | 8 +-
.../analysis/payloads/IdentityEncoder.java | 2 +-
.../analysis/payloads/IntegerEncoder.java | 2 +-
.../payloads/NumericPayloadTokenFilter.java | 2 +-
.../NumericPayloadTokenFilterFactory.java | 4 +-
.../analysis/payloads/PayloadEncoder.java | 8 +-
.../lucene/analysis/payloads/PayloadHelper.java | 2 +-
.../payloads/TokenOffsetPayloadTokenFilter.java | 2 +-
.../TokenOffsetPayloadTokenFilterFactory.java | 4 +-
.../payloads/TypeAsPayloadTokenFilter.java | 2 +-
.../TypeAsPayloadTokenFilterFactory.java | 4 +-
.../lucene/analysis/pt/PortugueseAnalyzer.java | 4 +-
.../analysis/pt/PortugueseLightStemFilter.java | 4 +-
.../pt/PortugueseLightStemFilterFactory.java | 4 +-
.../analysis/pt/PortugueseLightStemmer.java | 4 +-
.../pt/PortugueseMinimalStemFilter.java | 4 +-
.../pt/PortugueseMinimalStemFilterFactory.java | 4 +-
.../analysis/pt/PortugueseMinimalStemmer.java | 4 +-
.../analysis/pt/PortugueseStemFilter.java | 4 +-
.../pt/PortugueseStemFilterFactory.java | 4 +-
.../lucene/analysis/pt/PortugueseStemmer.java | 4 +-
.../lucene/analysis/pt/RSLPStemmerBase.java | 4 +-
.../query/QueryAutoStopWordAnalyzer.java | 2 +-
.../analysis/reverse/ReverseStringFilter.java | 1 -
.../reverse/ReverseStringFilterFactory.java | 4 +-
.../lucene/analysis/ro/RomanianAnalyzer.java | 4 +-
.../lucene/analysis/ru/RussianAnalyzer.java | 4 +-
.../analysis/ru/RussianLightStemFilter.java | 4 +-
.../ru/RussianLightStemFilterFactory.java | 4 +-
.../lucene/analysis/ru/RussianLightStemmer.java | 4 +-
.../shingle/ShingleAnalyzerWrapper.java | 4 +-
.../lucene/analysis/shingle/ShingleFilter.java | 4 +-
.../analysis/shingle/ShingleFilterFactory.java | 4 +-
.../analysis/sinks/TeeSinkTokenFilter.java | 4 +-
.../analysis/snowball/SnowballFilter.java | 4 +-
.../snowball/SnowballPorterFilterFactory.java | 4 +-
.../analysis/sr/SerbianNormalizationFilter.java | 4 +-
.../sr/SerbianNormalizationFilterFactory.java | 4 +-
.../sr/SerbianNormalizationRegularFilter.java | 4 +-
.../analysis/standard/ClassicAnalyzer.java | 4 +-
.../lucene/analysis/standard/ClassicFilter.java | 4 +-
.../analysis/standard/ClassicFilterFactory.java | 4 +-
.../analysis/standard/ClassicTokenizer.java | 1 -
.../standard/ClassicTokenizerFactory.java | 4 +-
.../analysis/standard/ClassicTokenizerImpl.java | 3 +-
.../standard/ClassicTokenizerImpl.jflex | 3 +-
.../analysis/standard/StandardAnalyzer.java | 4 +-
.../analysis/standard/StandardFilter.java | 4 +-
.../standard/StandardFilterFactory.java | 4 +-
.../analysis/standard/StandardTokenizer.java | 1 -
.../standard/StandardTokenizerFactory.java | 4 +-
.../standard/StandardTokenizerImpl.java | 3 +-
.../standard/StandardTokenizerImpl.jflex | 3 +-
.../standard/UAX29URLEmailAnalyzer.java | 4 +-
.../standard/UAX29URLEmailTokenizer.java | 4 +-
.../standard/UAX29URLEmailTokenizerFactory.java | 4 +-
.../standard/UAX29URLEmailTokenizerImpl.java | 3 +-
.../standard/UAX29URLEmailTokenizerImpl.jflex | 3 +-
.../lucene/analysis/sv/SwedishAnalyzer.java | 4 +-
.../analysis/sv/SwedishLightStemFilter.java | 4 +-
.../sv/SwedishLightStemFilterFactory.java | 4 +-
.../lucene/analysis/sv/SwedishLightStemmer.java | 4 +-
.../analysis/synonym/SolrSynonymParser.java | 4 +-
.../lucene/analysis/synonym/SynonymFilter.java | 4 +-
.../analysis/synonym/SynonymFilterFactory.java | 4 +-
.../lucene/analysis/synonym/SynonymMap.java | 4 +-
.../analysis/synonym/WordnetSynonymParser.java | 4 +-
.../apache/lucene/analysis/th/ThaiAnalyzer.java | 14 +-
.../lucene/analysis/th/ThaiTokenizer.java | 4 +-
.../analysis/th/ThaiTokenizerFactory.java | 4 +-
.../lucene/analysis/tr/ApostropheFilter.java | 4 +-
.../analysis/tr/ApostropheFilterFactory.java | 4 +-
.../lucene/analysis/tr/TurkishAnalyzer.java | 4 +-
.../analysis/tr/TurkishLowerCaseFilter.java | 4 +-
.../tr/TurkishLowerCaseFilterFactory.java | 4 +-
.../analysis/util/AbstractAnalysisFactory.java | 4 +-
.../lucene/analysis/util/AnalysisSPILoader.java | 4 +-
.../lucene/analysis/util/CharArrayIterator.java | 4 +-
.../lucene/analysis/util/CharArrayMap.java | 4 +-
.../lucene/analysis/util/CharArraySet.java | 4 +-
.../lucene/analysis/util/CharFilterFactory.java | 4 +-
.../lucene/analysis/util/CharTokenizer.java | 4 +-
.../lucene/analysis/util/CharacterUtils.java | 4 +-
.../analysis/util/ClasspathResourceLoader.java | 4 +-
.../lucene/analysis/util/ElisionFilter.java | 4 +-
.../analysis/util/ElisionFilterFactory.java | 4 +-
.../analysis/util/FilesystemResourceLoader.java | 4 +-
.../analysis/util/FilteringTokenFilter.java | 4 +-
.../analysis/util/MultiTermAwareComponent.java | 4 +-
.../lucene/analysis/util/OpenStringBuilder.java | 4 +-
.../lucene/analysis/util/ResourceLoader.java | 4 +-
.../analysis/util/ResourceLoaderAware.java | 1 -
.../lucene/analysis/util/RollingCharBuffer.java | 4 +-
.../analysis/util/SegmentingTokenizerBase.java | 4 +-
.../lucene/analysis/util/StemmerUtil.java | 4 +-
.../analysis/util/StopwordAnalyzerBase.java | 1 -
.../analysis/util/TokenFilterFactory.java | 4 +-
.../lucene/analysis/util/TokenizerFactory.java | 4 +-
.../lucene/analysis/util/WordlistLoader.java | 4 +-
.../analysis/wikipedia/WikipediaTokenizer.java | 1 -
.../wikipedia/WikipediaTokenizerFactory.java | 4 +-
.../wikipedia/WikipediaTokenizerImpl.java | 3 +-
.../wikipedia/WikipediaTokenizerImpl.jflex | 3 +-
.../collation/CollationAttributeFactory.java | 4 +-
.../collation/CollationDocValuesField.java | 4 +-
.../lucene/collation/CollationKeyAnalyzer.java | 4 +-
.../CollatedTermAttributeImpl.java | 4 +-
.../lucene/analysis/ar/TestArabicAnalyzer.java | 4 +-
.../lucene/analysis/ar/TestArabicFilters.java | 4 +-
.../ar/TestArabicNormalizationFilter.java | 4 +-
.../analysis/ar/TestArabicStemFilter.java | 4 +-
.../analysis/bg/TestBulgarianAnalyzer.java | 4 +-
.../bg/TestBulgarianStemFilterFactory.java | 4 +-
.../analysis/bg/TestBulgarianStemmer.java | 4 +-
.../analysis/br/TestBrazilianAnalyzer.java | 4 +-
.../br/TestBrazilianStemFilterFactory.java | 4 +-
.../lucene/analysis/ca/TestCatalanAnalyzer.java | 4 +-
.../charfilter/HTMLStripCharFilterTest.java | 4 +-
.../TestHTMLStripCharFilterFactory.java | 4 +-
.../charfilter/TestMappingCharFilter.java | 1 -
.../TestMappingCharFilterFactory.java | 4 +-
.../lucene/analysis/cjk/TestCJKAnalyzer.java | 4 +-
.../analysis/cjk/TestCJKBigramFilter.java | 4 +-
.../cjk/TestCJKBigramFilterFactory.java | 4 +-
.../lucene/analysis/cjk/TestCJKWidthFilter.java | 4 +-
.../analysis/cjk/TestCJKWidthFilterFactory.java | 4 +-
.../lucene/analysis/ckb/TestSoraniAnalyzer.java | 4 +-
.../ckb/TestSoraniNormalizationFilter.java | 4 +-
.../TestSoraniNormalizationFilterFactory.java | 4 +-
.../analysis/ckb/TestSoraniStemFilter.java | 4 +-
.../ckb/TestSoraniStemFilterFactory.java | 4 +-
.../TestCommonGramsFilterFactory.java | 4 +-
.../TestCommonGramsQueryFilterFactory.java | 4 +-
.../compound/TestCompoundWordTokenFilter.java | 4 +-
...ictionaryCompoundWordTokenFilterFactory.java | 4 +-
...phenationCompoundWordTokenFilterFactory.java | 4 +-
.../core/TestAllAnalyzersHaveFactories.java | 4 +-
.../lucene/analysis/core/TestAnalyzers.java | 4 +-
.../analysis/core/TestBugInSomething.java | 32 +--
.../analysis/core/TestDecimalDigitFilter.java | 4 +-
.../core/TestDecimalDigitFilterFactory.java | 4 +-
.../analysis/core/TestDuelingAnalyzers.java | 4 +-
.../lucene/analysis/core/TestFactories.java | 4 +-
.../analysis/core/TestKeywordAnalyzer.java | 4 +-
.../lucene/analysis/core/TestRandomChains.java | 4 +-
.../lucene/analysis/core/TestStopAnalyzer.java | 4 +-
.../lucene/analysis/core/TestStopFilter.java | 15 +-
.../analysis/core/TestStopFilterFactory.java | 4 +-
.../analysis/core/TestTypeTokenFilter.java | 4 +-
.../core/TestTypeTokenFilterFactory.java | 4 +-
.../core/TestUnicodeWhitespaceTokenizer.java | 4 +-
.../analysis/custom/TestCustomAnalyzer.java | 4 +-
.../lucene/analysis/cz/TestCzechAnalyzer.java | 4 +-
.../analysis/cz/TestCzechStemFilterFactory.java | 4 +-
.../lucene/analysis/cz/TestCzechStemmer.java | 4 +-
.../lucene/analysis/da/TestDanishAnalyzer.java | 4 +-
.../lucene/analysis/de/TestGermanAnalyzer.java | 4 +-
.../analysis/de/TestGermanLightStemFilter.java | 4 +-
.../de/TestGermanLightStemFilterFactory.java | 4 +-
.../de/TestGermanMinimalStemFilter.java | 4 +-
.../de/TestGermanMinimalStemFilterFactory.java | 4 +-
.../de/TestGermanNormalizationFilter.java | 4 +-
.../TestGermanNormalizationFilterFactory.java | 4 +-
.../analysis/de/TestGermanStemFilter.java | 4 +-
.../de/TestGermanStemFilterFactory.java | 4 +-
.../lucene/analysis/el/GreekAnalyzerTest.java | 14 +-
.../el/TestGreekLowerCaseFilterFactory.java | 4 +-
.../analysis/el/TestGreekStemFilterFactory.java | 4 +-
.../lucene/analysis/el/TestGreekStemmer.java | 4 +-
.../lucene/analysis/en/TestEnglishAnalyzer.java | 4 +-
.../en/TestEnglishMinimalStemFilter.java | 4 +-
.../en/TestEnglishMinimalStemFilterFactory.java | 4 +-
.../analysis/en/TestKStemFilterFactory.java | 4 +-
.../apache/lucene/analysis/en/TestKStemmer.java | 4 +-
.../analysis/en/TestPorterStemFilter.java | 4 +-
.../en/TestPorterStemFilterFactory.java | 4 +-
.../lucene/analysis/es/TestSpanishAnalyzer.java | 4 +-
.../analysis/es/TestSpanishLightStemFilter.java | 4 +-
.../es/TestSpanishLightStemFilterFactory.java | 4 +-
.../lucene/analysis/eu/TestBasqueAnalyzer.java | 4 +-
.../lucene/analysis/fa/TestPersianAnalyzer.java | 4 +-
.../analysis/fa/TestPersianCharFilter.java | 4 +-
.../fa/TestPersianNormalizationFilter.java | 4 +-
.../TestPersianNormalizationFilterFactory.java | 4 +-
.../lucene/analysis/fi/TestFinnishAnalyzer.java | 4 +-
.../analysis/fi/TestFinnishLightStemFilter.java | 4 +-
.../fi/TestFinnishLightStemFilterFactory.java | 4 +-
.../lucene/analysis/fr/TestFrenchAnalyzer.java | 4 +-
.../analysis/fr/TestFrenchLightStemFilter.java | 4 +-
.../fr/TestFrenchLightStemFilterFactory.java | 4 +-
.../fr/TestFrenchMinimalStemFilter.java | 4 +-
.../fr/TestFrenchMinimalStemFilterFactory.java | 4 +-
.../lucene/analysis/ga/TestIrishAnalyzer.java | 4 +-
.../analysis/ga/TestIrishLowerCaseFilter.java | 4 +-
.../ga/TestIrishLowerCaseFilterFactory.java | 4 +-
.../analysis/gl/TestGalicianAnalyzer.java | 4 +-
.../gl/TestGalicianMinimalStemFilter.java | 4 +-
.../TestGalicianMinimalStemFilterFactory.java | 4 +-
.../analysis/gl/TestGalicianStemFilter.java | 4 +-
.../gl/TestGalicianStemFilterFactory.java | 4 +-
.../lucene/analysis/hi/TestHindiAnalyzer.java | 14 +-
.../lucene/analysis/hi/TestHindiFilters.java | 4 +-
.../lucene/analysis/hi/TestHindiNormalizer.java | 4 +-
.../lucene/analysis/hi/TestHindiStemmer.java | 4 +-
.../analysis/hu/TestHungarianAnalyzer.java | 4 +-
.../hu/TestHungarianLightStemFilter.java | 4 +-
.../hu/TestHungarianLightStemFilterFactory.java | 4 +-
.../analysis/hunspell/StemmerTestBase.java | 4 +-
.../analysis/hunspell/Test64kAffixes.java | 4 +-
.../analysis/hunspell/TestAllDictionaries.java | 4 +-
.../analysis/hunspell/TestAllDictionaries2.java | 4 +-
.../analysis/hunspell/TestAlternateCasing.java | 4 +-
.../analysis/hunspell/TestCaseInsensitive.java | 4 +-
.../analysis/hunspell/TestCaseSensitive.java | 4 +-
.../lucene/analysis/hunspell/TestCircumfix.java | 4 +-
.../analysis/hunspell/TestComplexPrefix.java | 4 +-
.../lucene/analysis/hunspell/TestCondition.java | 4 +-
.../analysis/hunspell/TestCondition2.java | 8 +-
.../lucene/analysis/hunspell/TestConv.java | 8 +-
.../analysis/hunspell/TestDependencies.java | 4 +-
.../analysis/hunspell/TestDictionary.java | 4 +-
.../analysis/hunspell/TestDoubleEscape.java | 4 +-
.../lucene/analysis/hunspell/TestEscaped.java | 4 +-
.../lucene/analysis/hunspell/TestFlagLong.java | 4 +-
.../lucene/analysis/hunspell/TestFlagNum.java | 4 +-
.../lucene/analysis/hunspell/TestFullStrip.java | 4 +-
.../lucene/analysis/hunspell/TestHomonyms.java | 4 +-
.../hunspell/TestHunspellStemFilter.java | 4 +-
.../hunspell/TestHunspellStemFilterFactory.java | 4 +-
.../lucene/analysis/hunspell/TestIgnore.java | 4 +-
.../lucene/analysis/hunspell/TestKeepCase.java | 4 +-
.../lucene/analysis/hunspell/TestMorph.java | 4 +-
.../analysis/hunspell/TestMorphAlias.java | 4 +-
.../lucene/analysis/hunspell/TestMorphData.java | 4 +-
.../lucene/analysis/hunspell/TestNeedAffix.java | 4 +-
.../analysis/hunspell/TestOnlyInCompound.java | 4 +-
.../hunspell/TestOptionalCondition.java | 4 +-
.../lucene/analysis/hunspell/TestSpaces.java | 4 +-
.../lucene/analysis/hunspell/TestStemmer.java | 4 +-
.../hunspell/TestStrangeOvergeneration.java | 4 +-
.../lucene/analysis/hunspell/TestTwoFold.java | 4 +-
.../analysis/hunspell/TestTwoSuffixes.java | 4 +-
.../lucene/analysis/hunspell/TestZeroAffix.java | 4 +-
.../analysis/hunspell/TestZeroAffix2.java | 4 +-
.../analysis/hy/TestArmenianAnalyzer.java | 4 +-
.../analysis/id/TestIndonesianAnalyzer.java | 4 +-
.../id/TestIndonesianStemFilterFactory.java | 4 +-
.../analysis/id/TestIndonesianStemmer.java | 4 +-
.../lucene/analysis/in/TestIndicNormalizer.java | 4 +-
.../lucene/analysis/it/TestItalianAnalyzer.java | 4 +-
.../analysis/it/TestItalianLightStemFilter.java | 4 +-
.../it/TestItalianLightStemFilterFactory.java | 4 +-
.../analysis/lt/TestLithuanianAnalyzer.java | 4 +-
.../analysis/lt/TestLithuanianStemming.java | 4 +-
.../lucene/analysis/lv/TestLatvianAnalyzer.java | 4 +-
.../lv/TestLatvianStemFilterFactory.java | 4 +-
.../lucene/analysis/lv/TestLatvianStemmer.java | 4 +-
.../DateRecognizerFilterFactoryTest.java | 14 +-
.../miscellaneous/DateRecognizerFilterTest.java | 14 +-
.../miscellaneous/TestASCIIFoldingFilter.java | 4 +-
.../miscellaneous/TestCapitalizationFilter.java | 1 -
.../TestCapitalizationFilterFactory.java | 4 +-
.../miscellaneous/TestCodepointCountFilter.java | 4 +-
.../TestCodepointCountFilterFactory.java | 4 +-
.../miscellaneous/TestEmptyTokenStream.java | 4 +-
.../miscellaneous/TestFingerprintFilter.java | 4 +-
.../TestFingerprintFilterFactory.java | 4 +-
.../TestHyphenatedWordsFilter.java | 1 -
.../miscellaneous/TestKeepFilterFactory.java | 4 +-
.../miscellaneous/TestKeepWordFilter.java | 1 -
.../miscellaneous/TestKeywordMarkerFilter.java | 32 +--
.../TestKeywordMarkerFilterFactory.java | 4 +-
.../miscellaneous/TestKeywordRepeatFilter.java | 4 +-
.../miscellaneous/TestLengthFilter.java | 4 +-
.../miscellaneous/TestLengthFilterFactory.java | 4 +-
.../TestLimitTokenCountAnalyzer.java | 4 +-
.../TestLimitTokenCountFilter.java | 4 +-
.../TestLimitTokenCountFilterFactory.java | 4 +-
.../TestLimitTokenOffsetFilter.java | 4 +-
.../TestLimitTokenOffsetFilterFactory.java | 4 +-
.../TestLimitTokenPositionFilter.java | 2 +-
.../TestLimitTokenPositionFilterFactory.java | 2 +-
.../TestPerFieldAnalyzerWrapper.java | 32 +--
.../TestPrefixAndSuffixAwareTokenFilter.java | 4 +-
.../TestPrefixAwareTokenFilter.java | 4 +-
.../TestRemoveDuplicatesTokenFilter.java | 1 -
.../TestRemoveDuplicatesTokenFilterFactory.java | 4 +-
.../TestScandinavianFoldingFilter.java | 4 +-
.../TestScandinavianFoldingFilterFactory.java | 15 +-
.../TestScandinavianNormalizationFilter.java | 4 +-
...tScandinavianNormalizationFilterFactory.java | 18 +-
.../TestStemmerOverrideFilter.java | 2 +-
.../TestStemmerOverrideFilterFactory.java | 4 +-
.../analysis/miscellaneous/TestTrimFilter.java | 1 -
.../miscellaneous/TestTrimFilterFactory.java | 4 +-
.../miscellaneous/TestTruncateTokenFilter.java | 4 +-
.../TestTruncateTokenFilterFactory.java | 4 +-
.../miscellaneous/TestWordDelimiterFilter.java | 1 -
.../ngram/EdgeNGramTokenFilterTest.java | 4 +-
.../analysis/ngram/EdgeNGramTokenizerTest.java | 4 +-
.../analysis/ngram/NGramTokenFilterTest.java | 4 +-
.../analysis/ngram/NGramTokenizerTest.java | 4 +-
.../lucene/analysis/ngram/TestNGramFilters.java | 4 +-
.../lucene/analysis/nl/TestDutchAnalyzer.java | 4 +-
.../analysis/no/TestNorwegianAnalyzer.java | 4 +-
.../no/TestNorwegianLightStemFilter.java | 4 +-
.../no/TestNorwegianLightStemFilterFactory.java | 4 +-
.../no/TestNorwegianMinimalStemFilter.java | 4 +-
.../TestNorwegianMinimalStemFilterFactory.java | 4 +-
.../path/TestPathHierarchyTokenizer.java | 4 +-
.../path/TestReversePathHierarchyTokenizer.java | 4 +-
.../TestPatternCaptureGroupTokenFilter.java | 4 +-
.../pattern/TestPatternReplaceCharFilter.java | 1 -
.../TestPatternReplaceCharFilterFactory.java | 4 +-
.../pattern/TestPatternReplaceFilter.java | 1 -
.../TestPatternReplaceFilterFactory.java | 4 +-
.../analysis/pattern/TestPatternTokenizer.java | 1 -
.../pattern/TestPatternTokenizerFactory.java | 4 +-
.../DelimitedPayloadTokenFilterTest.java | 2 +-
.../payloads/NumericPayloadTokenFilterTest.java | 14 +-
.../TestDelimitedPayloadTokenFilterFactory.java | 4 +-
.../TokenOffsetPayloadTokenFilterTest.java | 15 +-
.../payloads/TypeAsPayloadTokenFilterTest.java | 17 +-
.../analysis/pt/TestPortugueseAnalyzer.java | 4 +-
.../pt/TestPortugueseLightStemFilter.java | 4 +-
.../TestPortugueseLightStemFilterFactory.java | 4 +-
.../pt/TestPortugueseMinimalStemFilter.java | 4 +-
.../TestPortugueseMinimalStemFilterFactory.java | 4 +-
.../analysis/pt/TestPortugueseStemFilter.java | 4 +-
.../pt/TestPortugueseStemFilterFactory.java | 4 +-
.../query/QueryAutoStopWordAnalyzerTest.java | 2 +-
.../reverse/TestReverseStringFilter.java | 1 -
.../reverse/TestReverseStringFilterFactory.java | 4 +-
.../analysis/ro/TestRomanianAnalyzer.java | 4 +-
.../lucene/analysis/ru/TestRussianAnalyzer.java | 4 +-
.../analysis/ru/TestRussianLightStemFilter.java | 4 +-
.../ru/TestRussianLightStemFilterFactory.java | 4 +-
.../shingle/ShingleAnalyzerWrapperTest.java | 4 +-
.../analysis/shingle/ShingleFilterTest.java | 4 +-
.../shingle/TestShingleFilterFactory.java | 4 +-
.../analysis/sinks/TestTeeSinkTokenFilter.java | 14 +-
.../lucene/analysis/snowball/TestSnowball.java | 4 +-
.../TestSnowballPorterFilterFactory.java | 15 +-
.../analysis/snowball/TestSnowballVocab.java | 4 +-
.../sr/TestSerbianNormalizationFilter.java | 4 +-
.../TestSerbianNormalizationFilterFactory.java | 4 +-
.../TestSerbianNormalizationRegularFilter.java | 4 +-
.../analysis/standard/TestClassicAnalyzer.java | 4 +-
.../analysis/standard/TestStandardAnalyzer.java | 4 +-
.../standard/TestStandardFactories.java | 4 +-
.../standard/TestUAX29URLEmailAnalyzer.java | 4 +-
.../standard/TestUAX29URLEmailTokenizer.java | 32 +--
.../TestUAX29URLEmailTokenizerFactory.java | 4 +-
.../standard/WordBreakTestUnicode_6_3_0.java | 4 +-
.../lucene/analysis/sv/TestSwedishAnalyzer.java | 4 +-
.../analysis/sv/TestSwedishLightStemFilter.java | 4 +-
.../sv/TestSwedishLightStemFilterFactory.java | 4 +-
.../synonym/BaseSynonymParserTestCase.java | 4 +-
.../analysis/synonym/TestMultiWordSynonyms.java | 4 +-
.../analysis/synonym/TestSolrSynonymParser.java | 4 +-
.../synonym/TestSynonymFilterFactory.java | 4 +-
.../analysis/synonym/TestSynonymMapFilter.java | 1 -
.../synonym/TestWordnetSynonymParser.java | 1 -
.../lucene/analysis/th/TestThaiAnalyzer.java | 4 +-
.../analysis/th/TestThaiTokenizerFactory.java | 4 +-
.../analysis/tr/TestApostropheFilter.java | 4 +-
.../tr/TestApostropheFilterFactory.java | 4 +-
.../lucene/analysis/tr/TestTurkishAnalyzer.java | 4 +-
.../analysis/tr/TestTurkishLowerCaseFilter.java | 4 +-
.../tr/TestTurkishLowerCaseFilterFactory.java | 4 +-
.../util/BaseTokenStreamFactoryTestCase.java | 4 +-
.../analysis/util/StringMockResourceLoader.java | 4 +-
.../analysis/util/TestAnalysisSPILoader.java | 4 +-
.../analysis/util/TestCharArrayIterator.java | 4 +-
.../lucene/analysis/util/TestCharArrayMap.java | 1 -
.../lucene/analysis/util/TestCharArraySet.java | 4 +-
.../analysis/util/TestCharTokenizers.java | 4 +-
.../analysis/util/TestCharacterUtils.java | 4 +-
.../lucene/analysis/util/TestElision.java | 4 +-
.../analysis/util/TestElisionFilterFactory.java | 4 +-
.../util/TestFilesystemResourceLoader.java | 4 +-
.../analysis/util/TestRollingCharBuffer.java | 4 +-
.../util/TestSegmentingTokenizerBase.java | 4 +-
.../analysis/util/TestWordlistLoader.java | 4 +-
.../TestWikipediaTokenizerFactory.java | 4 +-
.../wikipedia/WikipediaTokenizerTest.java | 1 -
.../collation/TestCollationDocValuesField.java | 4 +-
.../collation/TestCollationKeyAnalyzer.java | 4 +-
.../standard/GenerateJflexTLDMacros.java | 16 +-
.../lucene/analysis/icu/ICUFoldingFilter.java | 4 +-
.../analysis/icu/ICUFoldingFilterFactory.java | 4 +-
.../analysis/icu/ICUNormalizer2CharFilter.java | 4 +-
.../icu/ICUNormalizer2CharFilterFactory.java | 4 +-
.../analysis/icu/ICUNormalizer2Filter.java | 4 +-
.../icu/ICUNormalizer2FilterFactory.java | 4 +-
.../lucene/analysis/icu/ICUTransformFilter.java | 4 +-
.../analysis/icu/ICUTransformFilterFactory.java | 4 +-
.../icu/segmentation/BreakIteratorWrapper.java | 4 +-
.../icu/segmentation/CharArrayIterator.java | 4 +-
.../segmentation/CompositeBreakIterator.java | 4 +-
.../segmentation/DefaultICUTokenizerConfig.java | 4 +-
.../analysis/icu/segmentation/ICUTokenizer.java | 4 +-
.../icu/segmentation/ICUTokenizerConfig.java | 4 +-
.../icu/segmentation/ICUTokenizerFactory.java | 4 +-
.../icu/segmentation/ScriptIterator.java | 3 +-
.../icu/tokenattributes/ScriptAttribute.java | 4 +-
.../tokenattributes/ScriptAttributeImpl.java | 4 +-
.../collation/ICUCollationAttributeFactory.java | 4 +-
.../collation/ICUCollationDocValuesField.java | 4 +-
.../collation/ICUCollationKeyAnalyzer.java | 4 +-
.../ICUCollatedTermAttributeImpl.java | 4 +-
.../analysis/icu/TestICUFoldingFilter.java | 4 +-
.../icu/TestICUFoldingFilterFactory.java | 4 +-
.../icu/TestICUNormalizer2CharFilter.java | 4 +-
.../TestICUNormalizer2CharFilterFactory.java | 4 +-
.../analysis/icu/TestICUNormalizer2Filter.java | 4 +-
.../icu/TestICUNormalizer2FilterFactory.java | 4 +-
.../analysis/icu/TestICUTransformFilter.java | 4 +-
.../icu/TestICUTransformFilterFactory.java | 4 +-
.../icu/segmentation/TestCharArrayIterator.java | 4 +-
.../icu/segmentation/TestICUTokenizer.java | 4 +-
.../icu/segmentation/TestICUTokenizerCJK.java | 4 +-
.../segmentation/TestICUTokenizerFactory.java | 4 +-
.../segmentation/TestWithCJKBigramFilter.java | 4 +-
.../TestICUCollationDocValuesField.java | 4 +-
.../collation/TestICUCollationKeyAnalyzer.java | 4 +-
.../analysis/icu/GenerateUTR30DataFiles.java | 4 +-
.../lucene/analysis/icu/RBBIRuleCompiler.java | 4 +-
.../lucene/analysis/ja/GraphvizFormatter.java | 4 +-
.../lucene/analysis/ja/JapaneseAnalyzer.java | 4 +-
.../analysis/ja/JapaneseBaseFormFilter.java | 4 +-
.../ja/JapaneseBaseFormFilterFactory.java | 4 +-
.../ja/JapaneseIterationMarkCharFilter.java | 4 +-
.../JapaneseIterationMarkCharFilterFactory.java | 4 +-
.../analysis/ja/JapaneseKatakanaStemFilter.java | 4 +-
.../ja/JapaneseKatakanaStemFilterFactory.java | 4 +-
.../analysis/ja/JapaneseNumberFilter.java | 4 +-
.../ja/JapaneseNumberFilterFactory.java | 4 +-
.../ja/JapanesePartOfSpeechStopFilter.java | 4 +-
.../JapanesePartOfSpeechStopFilterFactory.java | 4 +-
.../analysis/ja/JapaneseReadingFormFilter.java | 4 +-
.../ja/JapaneseReadingFormFilterFactory.java | 4 +-
.../lucene/analysis/ja/JapaneseTokenizer.java | 4 +-
.../analysis/ja/JapaneseTokenizerFactory.java | 4 +-
.../org/apache/lucene/analysis/ja/Token.java | 4 +-
.../analysis/ja/dict/BinaryDictionary.java | 4 +-
.../analysis/ja/dict/CharacterDefinition.java | 4 +-
.../analysis/ja/dict/ConnectionCosts.java | 4 +-
.../lucene/analysis/ja/dict/Dictionary.java | 4 +-
.../analysis/ja/dict/TokenInfoDictionary.java | 4 +-
.../lucene/analysis/ja/dict/TokenInfoFST.java | 4 +-
.../analysis/ja/dict/UnknownDictionary.java | 4 +-
.../lucene/analysis/ja/dict/UserDictionary.java | 4 +-
.../ja/tokenattributes/BaseFormAttribute.java | 4 +-
.../tokenattributes/BaseFormAttributeImpl.java | 4 +-
.../ja/tokenattributes/InflectionAttribute.java | 4 +-
.../InflectionAttributeImpl.java | 4 +-
.../tokenattributes/PartOfSpeechAttribute.java | 4 +-
.../PartOfSpeechAttributeImpl.java | 4 +-
.../ja/tokenattributes/ReadingAttribute.java | 4 +-
.../tokenattributes/ReadingAttributeImpl.java | 4 +-
.../apache/lucene/analysis/ja/util/CSVUtil.java | 4 +-
.../lucene/analysis/ja/util/ToStringUtil.java | 4 +-
.../analysis/ja/StringMockResourceLoader.java | 4 +-
.../lucene/analysis/ja/TestExtendedMode.java | 4 +-
.../analysis/ja/TestJapaneseAnalyzer.java | 4 +-
.../analysis/ja/TestJapaneseBaseFormFilter.java | 4 +-
.../ja/TestJapaneseBaseFormFilterFactory.java | 4 +-
.../ja/TestJapaneseIterationMarkCharFilter.java | 4 +-
...tJapaneseIterationMarkCharFilterFactory.java | 4 +-
.../ja/TestJapaneseKatakanaStemFilter.java | 4 +-
.../TestJapaneseKatakanaStemFilterFactory.java | 4 +-
.../analysis/ja/TestJapaneseNumberFilter.java | 4 +-
.../ja/TestJapaneseNumberFilterFactory.java | 4 +-
...stJapanesePartOfSpeechStopFilterFactory.java | 4 +-
.../ja/TestJapaneseReadingFormFilter.java | 4 +-
.../TestJapaneseReadingFormFilterFactory.java | 4 +-
.../analysis/ja/TestJapaneseTokenizer.java | 4 +-
.../ja/TestJapaneseTokenizerFactory.java | 4 +-
.../lucene/analysis/ja/TestSearchMode.java | 4 +-
.../ja/dict/TestTokenInfoDictionary.java | 4 +-
.../analysis/ja/dict/UserDictionaryTest.java | 4 +-
.../analysis/ja/util/TestToStringUtil.java | 4 +-
.../ja/util/BinaryDictionaryWriter.java | 4 +-
.../ja/util/CharacterDefinitionWriter.java | 4 +-
.../ja/util/ConnectionCostsBuilder.java | 4 +-
.../analysis/ja/util/ConnectionCostsWriter.java | 4 +-
.../analysis/ja/util/DictionaryBuilder.java | 4 +-
.../ja/util/TokenInfoDictionaryBuilder.java | 4 +-
.../ja/util/TokenInfoDictionaryWriter.java | 4 +-
.../ja/util/UnknownDictionaryBuilder.java | 4 +-
.../ja/util/UnknownDictionaryWriter.java | 4 +-
.../analysis/ja/dict/UnknownDictionaryTest.java | 4 +-
.../analysis/morfologik/MorfologikAnalyzer.java | 3 +-
.../analysis/morfologik/MorfologikFilter.java | 4 +-
.../morfologik/MorfologikFilterFactory.java | 4 +-
.../MorphosyntacticTagsAttribute.java | 3 +-
.../MorphosyntacticTagsAttributeImpl.java | 3 +-
.../morfologik/TestMorfologikAnalyzer.java | 4 +-
.../morfologik/TestMorfologikFilterFactory.java | 4 +-
.../analysis/phonetic/BeiderMorseFilter.java | 4 +-
.../phonetic/BeiderMorseFilterFactory.java | 4 +-
.../phonetic/DaitchMokotoffSoundexFilter.java | 2 +-
.../DaitchMokotoffSoundexFilterFactory.java | 2 +-
.../phonetic/DoubleMetaphoneFilterFactory.java | 4 +-
.../analysis/phonetic/PhoneticFilter.java | 1 -
.../phonetic/PhoneticFilterFactory.java | 4 +-
.../phonetic/TestBeiderMorseFilter.java | 4 +-
.../phonetic/TestBeiderMorseFilterFactory.java | 4 +-
.../TestDaitchMokotoffSoundexFilter.java | 2 +-
.../TestDaitchMokotoffSoundexFilterFactory.java | 4 +-
.../TestDoubleMetaphoneFilterFactory.java | 4 +-
.../analysis/phonetic/TestPhoneticFilter.java | 1 -
.../phonetic/TestPhoneticFilterFactory.java | 4 +-
.../analysis/cn/smart/AnalyzerProfile.java | 1 -
.../lucene/analysis/cn/smart/CharType.java | 1 -
.../analysis/cn/smart/HMMChineseTokenizer.java | 4 +-
.../cn/smart/HMMChineseTokenizerFactory.java | 1 -
.../analysis/cn/smart/SmartChineseAnalyzer.java | 1 -
.../lucene/analysis/cn/smart/Utility.java | 1 -
.../lucene/analysis/cn/smart/WordSegmenter.java | 1 -
.../lucene/analysis/cn/smart/WordType.java | 1 -
.../cn/smart/hhmm/AbstractDictionary.java | 1 -
.../analysis/cn/smart/hhmm/BiSegGraph.java | 1 -
.../cn/smart/hhmm/BigramDictionary.java | 1 -
.../analysis/cn/smart/hhmm/HHMMSegmenter.java | 1 -
.../lucene/analysis/cn/smart/hhmm/PathNode.java | 1 -
.../lucene/analysis/cn/smart/hhmm/SegGraph.java | 1 -
.../lucene/analysis/cn/smart/hhmm/SegToken.java | 1 -
.../analysis/cn/smart/hhmm/SegTokenFilter.java | 1 -
.../analysis/cn/smart/hhmm/SegTokenPair.java | 1 -
.../analysis/cn/smart/hhmm/WordDictionary.java | 1 -
.../smart/TestHMMChineseTokenizerFactory.java | 4 +-
.../cn/smart/TestSmartChineseAnalyzer.java | 1 -
.../lucene/analysis/pl/PolishAnalyzer.java | 4 +-
.../lucene/analysis/stempel/StempelFilter.java | 26 +--
.../stempel/StempelPolishStemFilterFactory.java | 4 +-
.../lucene/analysis/stempel/StempelStemmer.java | 26 +--
.../lucene/analysis/pl/TestPolishAnalyzer.java | 4 +-
.../TestStempelPolishStemFilterFactory.java | 4 +-
.../lucene/analysis/uima/BaseUIMATokenizer.java | 4 +-
.../analysis/uima/UIMAAnnotationsTokenizer.java | 4 +-
.../uima/UIMAAnnotationsTokenizerFactory.java | 4 +-
.../lucene/analysis/uima/UIMABaseAnalyzer.java | 4 +-
.../analysis/uima/UIMATypeAwareAnalyzer.java | 4 +-
.../uima/UIMATypeAwareAnnotationsTokenizer.java | 4 +-
...IMATypeAwareAnnotationsTokenizerFactory.java | 4 +-
.../lucene/analysis/uima/ae/AEProvider.java | 4 +-
.../analysis/uima/ae/AEProviderFactory.java | 4 +-
.../analysis/uima/ae/BasicAEProvider.java | 4 +-
.../uima/ae/OverridingParamsAEProvider.java | 4 +-
.../analysis/uima/UIMABaseAnalyzerTest.java | 4 +-
.../uima/UIMATypeAwareAnalyzerTest.java | 4 +-
.../analysis/uima/ae/AEProviderFactoryTest.java | 4 +-
.../analysis/uima/ae/BasicAEProviderTest.java | 4 +-
.../uima/ae/OverridingParamsAEProviderTest.java | 4 +-
.../analysis/uima/an/SampleEntityAnnotator.java | 4 +-
.../analysis/uima/an/SamplePoSTagger.java | 4 +-
.../uima/an/SampleWSTokenizerAnnotator.java | 4 +-
.../org/apache/lucene/codecs/Placeholder.java | 4 +-
.../lucene/codecs/lucene50/Lucene50Codec.java | 4 +-
.../lucene50/Lucene50DocValuesConsumer.java | 4 +-
.../lucene50/Lucene50DocValuesFormat.java | 4 +-
.../lucene50/Lucene50DocValuesProducer.java | 4 +-
.../codecs/lucene50/Lucene50NormsFormat.java | 4 +-
.../codecs/lucene50/Lucene50NormsProducer.java | 4 +-
.../lucene/codecs/lucene53/Lucene53Codec.java | 4 +-
.../lucene/codecs/lucene54/Lucene54Codec.java | 4 +-
.../codecs/lucene50/Lucene50NormsConsumer.java | 4 +-
.../lucene/codecs/lucene50/Lucene50RWCodec.java | 4 +-
.../codecs/lucene50/Lucene50RWNormsFormat.java | 4 +-
.../lucene50/TestLucene50DocValuesFormat.java | 4 +-
.../lucene50/TestLucene50NormsFormat.java | 4 +-
.../index/TestBackwardsCompatibility.java | 4 +-
.../lucene/index/TestMaxPositionInOldIndex.java | 4 +-
.../org/apache/lucene/benchmark/Constants.java | 19 +-
.../lucene/benchmark/byTask/Benchmark.java | 4 +-
.../lucene/benchmark/byTask/PerfRunData.java | 4 +-
.../byTask/feeds/AbstractQueryMaker.java | 13 +-
.../byTask/feeds/ContentItemsSource.java | 4 +-
.../benchmark/byTask/feeds/ContentSource.java | 4 +-
.../benchmark/byTask/feeds/DemoHTMLParser.java | 4 +-
.../byTask/feeds/DirContentSource.java | 4 +-
.../lucene/benchmark/byTask/feeds/DocData.java | 4 +-
.../lucene/benchmark/byTask/feeds/DocMaker.java | 4 +-
.../byTask/feeds/EnwikiContentSource.java | 4 +-
.../byTask/feeds/EnwikiQueryMaker.java | 4 +-
.../benchmark/byTask/feeds/FacetSource.java | 4 +-
.../byTask/feeds/FileBasedQueryMaker.java | 18 +-
.../byTask/feeds/GeonamesLineParser.java | 4 +-
.../benchmark/byTask/feeds/HTMLParser.java | 4 +-
.../benchmark/byTask/feeds/LineDocSource.java | 4 +-
.../feeds/LongToEnglishContentSource.java | 4 +-
.../byTask/feeds/LongToEnglishQueryMaker.java | 4 +-
.../byTask/feeds/NoMoreDataException.java | 4 +-
.../benchmark/byTask/feeds/QueryMaker.java | 4 +-
.../byTask/feeds/RandomFacetSource.java | 4 +-
.../byTask/feeds/ReutersContentSource.java | 4 +-
.../byTask/feeds/ReutersQueryMaker.java | 4 +-
.../byTask/feeds/SimpleQueryMaker.java | 4 +-
.../feeds/SimpleSloppyPhraseQueryMaker.java | 4 +-
.../benchmark/byTask/feeds/SingleDocSource.java | 8 +-
.../byTask/feeds/SortableSingleDocSource.java | 4 +-
.../benchmark/byTask/feeds/SpatialDocMaker.java | 4 +-
.../byTask/feeds/SpatialFileQueryMaker.java | 4 +-
.../byTask/feeds/TrecContentSource.java | 4 +-
.../benchmark/byTask/feeds/TrecDocParser.java | 4 +-
.../benchmark/byTask/feeds/TrecFBISParser.java | 4 +-
.../benchmark/byTask/feeds/TrecFR94Parser.java | 4 +-
.../benchmark/byTask/feeds/TrecFTParser.java | 4 +-
.../benchmark/byTask/feeds/TrecGov2Parser.java | 4 +-
.../byTask/feeds/TrecLATimesParser.java | 4 +-
.../byTask/feeds/TrecParserByPath.java | 4 +-
.../benchmark/byTask/programmatic/Sample.java | 15 +-
.../lucene/benchmark/byTask/stats/Points.java | 4 +-
.../lucene/benchmark/byTask/stats/Report.java | 4 +-
.../benchmark/byTask/stats/TaskStats.java | 4 +-
.../benchmark/byTask/tasks/AddDocTask.java | 4 +-
.../byTask/tasks/AddFacetedDocTask.java | 4 +-
.../benchmark/byTask/tasks/AddIndexesTask.java | 4 +-
.../byTask/tasks/AnalyzerFactoryTask.java | 4 +-
.../byTask/tasks/BenchmarkHighlighter.java | 4 +-
.../benchmark/byTask/tasks/ClearStatsTask.java | 8 +-
.../benchmark/byTask/tasks/CloseIndexTask.java | 4 +-
.../benchmark/byTask/tasks/CloseReaderTask.java | 4 +-
.../byTask/tasks/CloseTaxonomyIndexTask.java | 4 +-
.../byTask/tasks/CloseTaxonomyReaderTask.java | 4 +-
.../benchmark/byTask/tasks/CommitIndexTask.java | 4 +-
.../byTask/tasks/CommitTaxonomyIndexTask.java | 2 +-
.../byTask/tasks/ConsumeContentSourceTask.java | 4 +-
.../benchmark/byTask/tasks/CreateIndexTask.java | 4 +-
.../byTask/tasks/CreateTaxonomyIndexTask.java | 4 +-
.../benchmark/byTask/tasks/ForceMergeTask.java | 4 +-
.../byTask/tasks/NearRealtimeReaderTask.java | 4 +-
.../benchmark/byTask/tasks/NewAnalyzerTask.java | 13 +-
.../byTask/tasks/NewCollationAnalyzerTask.java | 4 +-
.../benchmark/byTask/tasks/NewLocaleTask.java | 4 +-
.../benchmark/byTask/tasks/NewRoundTask.java | 8 +-
.../benchmark/byTask/tasks/OpenIndexTask.java | 4 +-
.../benchmark/byTask/tasks/OpenReaderTask.java | 4 +-
.../byTask/tasks/OpenTaxonomyIndexTask.java | 4 +-
.../byTask/tasks/OpenTaxonomyReaderTask.java | 4 +-
.../lucene/benchmark/byTask/tasks/PerfTask.java | 4 +-
.../benchmark/byTask/tasks/PrintReaderTask.java | 4 +-
.../lucene/benchmark/byTask/tasks/ReadTask.java | 4 +-
.../benchmark/byTask/tasks/ReadTokensTask.java | 4 +-
.../byTask/tasks/ReopenReaderTask.java | 2 +-
.../benchmark/byTask/tasks/RepAllTask.java | 4 +-
.../byTask/tasks/RepSelectByPrefTask.java | 4 +-
.../byTask/tasks/RepSumByNameRoundTask.java | 4 +-
.../byTask/tasks/RepSumByNameTask.java | 4 +-
.../byTask/tasks/RepSumByPrefRoundTask.java | 4 +-
.../byTask/tasks/RepSumByPrefTask.java | 4 +-
.../benchmark/byTask/tasks/ReportTask.java | 18 +-
.../benchmark/byTask/tasks/ResetInputsTask.java | 8 +-
.../byTask/tasks/ResetSystemEraseTask.java | 8 +-
.../byTask/tasks/ResetSystemSoftTask.java | 8 +-
.../byTask/tasks/RollbackIndexTask.java | 4 +-
.../benchmark/byTask/tasks/SearchTask.java | 4 +-
.../tasks/SearchTravRetHighlightTask.java | 4 +-
.../SearchTravRetLoadFieldSelectorTask.java | 14 +-
.../byTask/tasks/SearchTravRetTask.java | 4 +-
.../tasks/SearchTravRetVectorHighlightTask.java | 4 +-
.../benchmark/byTask/tasks/SearchTravTask.java | 4 +-
.../byTask/tasks/SearchWithCollectorTask.java | 2 +-
.../byTask/tasks/SearchWithSortTask.java | 2 +-
.../benchmark/byTask/tasks/SetPropTask.java | 8 +-
.../benchmark/byTask/tasks/TaskSequence.java | 4 +-
.../benchmark/byTask/tasks/UpdateDocTask.java | 4 +-
.../lucene/benchmark/byTask/tasks/WaitTask.java | 4 +-
.../lucene/benchmark/byTask/tasks/WarmTask.java | 4 +-
.../byTask/tasks/WriteEnwikiLineDocTask.java | 32 +--
.../byTask/tasks/WriteLineDocTask.java | 4 +-
.../benchmark/byTask/utils/Algorithm.java | 4 +-
.../benchmark/byTask/utils/AnalyzerFactory.java | 4 +-
.../lucene/benchmark/byTask/utils/Config.java | 4 +-
.../lucene/benchmark/byTask/utils/Format.java | 4 +-
.../benchmark/byTask/utils/StreamUtils.java | 4 +-
.../benchmark/quality/trec/QueryDriver.java | 4 +-
.../lucene/benchmark/utils/ExtractReuters.java | 15 +-
.../benchmark/utils/ExtractWikipedia.java | 4 +-
lucene/benchmark/src/test/conf/ConfLoader.java | 3 +-
.../lucene/benchmark/BenchmarkTestCase.java | 4 +-
.../benchmark/byTask/TestPerfTasksLogic.java | 1 -
.../benchmark/byTask/TestPerfTasksParse.java | 1 -
.../benchmark/byTask/feeds/DocMakerTest.java | 4 +-
.../byTask/feeds/EnwikiContentSourceTest.java | 4 +-
.../byTask/feeds/LineDocSourceTest.java | 4 +-
.../benchmark/byTask/feeds/TestHtmlParser.java | 4 +-
.../byTask/feeds/TrecContentSourceTest.java | 4 +-
.../byTask/tasks/AddIndexesTaskTest.java | 4 +-
.../byTask/tasks/CommitIndexTaskTest.java | 4 +-
.../tasks/CountingHighlighterTestTask.java | 1 -
.../byTask/tasks/CountingSearchTestTask.java | 1 -
.../byTask/tasks/CreateIndexTaskTest.java | 4 +-
.../benchmark/byTask/tasks/PerfTaskTest.java | 4 +-
.../byTask/tasks/SearchWithSortTaskTest.java | 4 +-
.../tasks/WriteEnwikiLineDocTaskTest.java | 4 +-
.../byTask/tasks/WriteLineDocTaskTest.java | 4 +-
.../byTask/tasks/alt/AltPackageTaskTest.java | 4 +-
.../benchmark/byTask/tasks/alt/AltTestTask.java | 4 +-
.../benchmark/byTask/utils/StreamUtilsTest.java | 4 +-
.../benchmark/byTask/utils/TestConfig.java | 4 +-
.../benchmark/quality/TestQualityRun.java | 4 +-
.../CachingNaiveBayesClassifier.java | 32 +--
.../document/DocumentClassifier.java | 4 +-
.../KNearestNeighborDocumentClassifier.java | 4 +-
.../SimpleNaiveBayesDocumentClassifier.java | 4 +-
.../utils/ConfusionMatrixGenerator.java | 4 +-
.../classification/utils/DatasetSplitter.java | 4 +-
.../CachingNaiveBayesClassifierTest.java | 4 +-
.../DocumentClassificationTestBase.java | 4 +-
.../KNearestNeighborDocumentClassifierTest.java | 4 +-
.../SimpleNaiveBayesDocumentClassifierTest.java | 4 +-
.../utils/ConfusionMatrixGeneratorTest.java | 4 +-
.../classification/utils/DataSplitterTest.java | 4 +-
.../autoprefix/AutoPrefixPostingsFormat.java | 4 +-
.../codecs/blockterms/BlockTermsReader.java | 4 +-
.../codecs/blockterms/BlockTermsWriter.java | 4 +-
.../blockterms/FixedGapTermsIndexReader.java | 4 +-
.../blockterms/FixedGapTermsIndexWriter.java | 4 +-
.../codecs/blockterms/TermsIndexReaderBase.java | 4 +-
.../codecs/blockterms/TermsIndexWriterBase.java | 4 +-
.../blockterms/VariableGapTermsIndexReader.java | 4 +-
.../blockterms/VariableGapTermsIndexWriter.java | 4 +-
.../BlockTreeOrdsPostingsFormat.java | 4 +-
.../codecs/blocktreeords/FSTOrdsOutputs.java | 4 +-
.../blocktreeords/OrdsBlockTreeTermsReader.java | 4 +-
.../blocktreeords/OrdsBlockTreeTermsWriter.java | 4 +-
.../codecs/blocktreeords/OrdsFieldReader.java | 4 +-
.../blocktreeords/OrdsIntersectTermsEnum.java | 4 +-
.../OrdsIntersectTermsEnumFrame.java | 4 +-
.../blocktreeords/OrdsSegmentTermsEnum.java | 4 +-
.../OrdsSegmentTermsEnumFrame.java | 4 +-
.../lucene/codecs/bloom/BloomFilterFactory.java | 2 +-
.../bloom/BloomFilteringPostingsFormat.java | 4 +-
.../codecs/bloom/DefaultBloomFilterFactory.java | 2 +-
.../apache/lucene/codecs/bloom/FuzzySet.java | 4 +-
.../lucene/codecs/bloom/HashFunction.java | 2 +-
.../apache/lucene/codecs/bloom/MurmurHash2.java | 2 +-
.../codecs/memory/DirectDocValuesConsumer.java | 4 +-
.../codecs/memory/DirectDocValuesFormat.java | 4 +-
.../codecs/memory/DirectDocValuesProducer.java | 4 +-
.../codecs/memory/DirectPostingsFormat.java | 4 +-
.../codecs/memory/FSTOrdPostingsFormat.java | 6 +-
.../lucene/codecs/memory/FSTOrdTermsReader.java | 4 +-
.../lucene/codecs/memory/FSTOrdTermsWriter.java | 4 +-
.../lucene/codecs/memory/FSTPostingsFormat.java | 6 +-
.../lucene/codecs/memory/FSTTermOutputs.java | 4 +-
.../lucene/codecs/memory/FSTTermsReader.java | 4 +-
.../lucene/codecs/memory/FSTTermsWriter.java | 4 +-
.../codecs/memory/MemoryDocValuesConsumer.java | 4 +-
.../codecs/memory/MemoryDocValuesFormat.java | 4 +-
.../codecs/memory/MemoryDocValuesProducer.java | 4 +-
.../codecs/memory/MemoryPostingsFormat.java | 4 +-
.../codecs/simpletext/SimpleTextBKDReader.java | 4 +-
.../codecs/simpletext/SimpleTextCodec.java | 4 +-
.../simpletext/SimpleTextCompoundFormat.java | 4 +-
.../simpletext/SimpleTextDocValuesFormat.java | 4 +-
.../simpletext/SimpleTextDocValuesReader.java | 4 +-
.../simpletext/SimpleTextDocValuesWriter.java | 4 +-
.../simpletext/SimpleTextFieldInfosFormat.java | 4 +-
.../simpletext/SimpleTextFieldsReader.java | 4 +-
.../simpletext/SimpleTextFieldsWriter.java | 4 +-
.../simpletext/SimpleTextLiveDocsFormat.java | 4 +-
.../simpletext/SimpleTextNormsFormat.java | 4 +-
.../simpletext/SimpleTextPointFormat.java | 4 +-
.../simpletext/SimpleTextPointReader.java | 4 +-
.../simpletext/SimpleTextPointWriter.java | 4 +-
.../simpletext/SimpleTextPostingsFormat.java | 4 +-
.../simpletext/SimpleTextSegmentInfoFormat.java | 4 +-
.../SimpleTextStoredFieldsFormat.java | 4 +-
.../SimpleTextStoredFieldsReader.java | 4 +-
.../SimpleTextStoredFieldsWriter.java | 4 +-
.../simpletext/SimpleTextTermVectorsFormat.java | 4 +-
.../simpletext/SimpleTextTermVectorsReader.java | 4 +-
.../simpletext/SimpleTextTermVectorsWriter.java | 4 +-
.../codecs/simpletext/SimpleTextUtil.java | 4 +-
.../TestAutoPrefixPostingsFormat.java | 4 +-
.../codecs/autoprefix/TestAutoPrefixTerms.java | 4 +-
.../blockterms/TestFixedGapPostingsFormat.java | 4 +-
...TestVarGapDocFreqIntervalPostingsFormat.java | 4 +-
.../TestVarGapFixedIntervalPostingsFormat.java | 4 +-
.../codecs/blocktreeords/TestOrdsBlockTree.java | 4 +-
.../codecs/bloom/TestBloomPostingsFormat.java | 4 +-
.../memory/TestDirectDocValuesFormat.java | 4 +-
.../codecs/memory/TestDirectPostingsFormat.java | 4 +-
.../codecs/memory/TestFSTOrdPostingsFormat.java | 4 +-
.../codecs/memory/TestFSTPostingsFormat.java | 4 +-
.../memory/TestMemoryDocValuesFormat.java | 4 +-
.../codecs/memory/TestMemoryPostingsFormat.java | 4 +-
.../TestSimpleTextCompoundFormat.java | 4 +-
.../TestSimpleTextDocValuesFormat.java | 4 +-
.../TestSimpleTextFieldInfoFormat.java | 4 +-
.../simpletext/TestSimpleTextNormsFormat.java | 4 +-
.../simpletext/TestSimpleTextPointFormat.java | 4 +-
.../TestSimpleTextPostingsFormat.java | 4 +-
.../TestSimpleTextSegmentInfoFormat.java | 4 +-
.../TestSimpleTextStoredFieldsFormat.java | 4 +-
.../TestSimpleTextTermVectorsFormat.java | 4 +-
.../java/org/apache/lucene/LucenePackage.java | 4 +-
.../org/apache/lucene/analysis/Analyzer.java | 4 +-
.../apache/lucene/analysis/AnalyzerWrapper.java | 4 +-
.../lucene/analysis/CachingTokenFilter.java | 4 +-
.../org/apache/lucene/analysis/CharFilter.java | 4 +-
.../analysis/DelegatingAnalyzerWrapper.java | 8 +-
.../analysis/LegacyNumericTokenStream.java | 4 +-
.../lucene/analysis/ReusableStringReader.java | 8 +-
.../java/org/apache/lucene/analysis/Token.java | 4 +-
.../org/apache/lucene/analysis/TokenFilter.java | 4 +-
.../org/apache/lucene/analysis/TokenStream.java | 4 +-
.../lucene/analysis/TokenStreamToAutomaton.java | 4 +-
.../org/apache/lucene/analysis/Tokenizer.java | 4 +-
.../tokenattributes/BytesTermAttribute.java | 4 +-
.../tokenattributes/BytesTermAttributeImpl.java | 4 +-
.../tokenattributes/CharTermAttribute.java | 4 +-
.../tokenattributes/CharTermAttributeImpl.java | 4 +-
.../tokenattributes/FlagsAttribute.java | 4 +-
.../tokenattributes/FlagsAttributeImpl.java | 4 +-
.../tokenattributes/KeywordAttribute.java | 4 +-
.../tokenattributes/KeywordAttributeImpl.java | 4 +-
.../tokenattributes/OffsetAttribute.java | 4 +-
.../tokenattributes/OffsetAttributeImpl.java | 4 +-
.../PackedTokenAttributeImpl.java | 4 +-
.../tokenattributes/PayloadAttribute.java | 4 +-
.../tokenattributes/PayloadAttributeImpl.java | 4 +-
.../PositionIncrementAttribute.java | 4 +-
.../PositionIncrementAttributeImpl.java | 4 +-
.../PositionLengthAttribute.java | 4 +-
.../PositionLengthAttributeImpl.java | 4 +-
.../TermToBytesRefAttribute.java | 4 +-
.../analysis/tokenattributes/TypeAttribute.java | 4 +-
.../tokenattributes/TypeAttributeImpl.java | 4 +-
.../apache/lucene/codecs/BlockTermState.java | 2 +-
.../java/org/apache/lucene/codecs/Codec.java | 4 +-
.../org/apache/lucene/codecs/CodecUtil.java | 4 +-
.../apache/lucene/codecs/CompoundFormat.java | 4 +-
.../apache/lucene/codecs/DocValuesConsumer.java | 4 +-
.../apache/lucene/codecs/DocValuesFormat.java | 4 +-
.../apache/lucene/codecs/DocValuesProducer.java | 4 +-
.../apache/lucene/codecs/FieldInfosFormat.java | 4 +-
.../apache/lucene/codecs/FieldsConsumer.java | 4 +-
.../apache/lucene/codecs/FieldsProducer.java | 4 +-
.../org/apache/lucene/codecs/FilterCodec.java | 4 +-
.../apache/lucene/codecs/LiveDocsFormat.java | 4 +-
.../lucene/codecs/MultiLevelSkipListReader.java | 4 +-
.../lucene/codecs/MultiLevelSkipListWriter.java | 4 +-
.../org/apache/lucene/codecs/NormsConsumer.java | 4 +-
.../org/apache/lucene/codecs/NormsFormat.java | 4 +-
.../org/apache/lucene/codecs/NormsProducer.java | 18 +-
.../org/apache/lucene/codecs/PointFormat.java | 4 +-
.../org/apache/lucene/codecs/PointReader.java | 4 +-
.../org/apache/lucene/codecs/PointWriter.java | 4 +-
.../apache/lucene/codecs/PostingsFormat.java | 4 +-
.../lucene/codecs/PostingsReaderBase.java | 4 +-
.../lucene/codecs/PostingsWriterBase.java | 4 +-
.../lucene/codecs/PushPostingsWriterBase.java | 4 +-
.../apache/lucene/codecs/SegmentInfoFormat.java | 4 +-
.../lucene/codecs/StoredFieldsFormat.java | 4 +-
.../lucene/codecs/StoredFieldsReader.java | 24 +--
.../lucene/codecs/StoredFieldsWriter.java | 24 +--
.../org/apache/lucene/codecs/TermStats.java | 4 +-
.../apache/lucene/codecs/TermVectorsFormat.java | 4 +-
.../apache/lucene/codecs/TermVectorsReader.java | 4 +-
.../apache/lucene/codecs/TermVectorsWriter.java | 4 +-
.../codecs/blocktree/AutoPrefixTermsWriter.java | 4 +-
.../codecs/blocktree/BitSetPostingsEnum.java | 4 +-
.../codecs/blocktree/BitSetTermsEnum.java | 4 +-
.../codecs/blocktree/BlockTreeTermsReader.java | 4 +-
.../codecs/blocktree/BlockTreeTermsWriter.java | 4 +-
.../lucene/codecs/blocktree/FieldReader.java | 4 +-
.../codecs/blocktree/IntersectTermsEnum.java | 4 +-
.../blocktree/IntersectTermsEnumFrame.java | 4 +-
.../codecs/blocktree/SegmentTermsEnum.java | 4 +-
.../codecs/blocktree/SegmentTermsEnumFrame.java | 4 +-
.../apache/lucene/codecs/blocktree/Stats.java | 4 +-
.../CompressingStoredFieldsFormat.java | 4 +-
.../CompressingStoredFieldsIndexReader.java | 4 +-
.../CompressingStoredFieldsIndexWriter.java | 4 +-
.../CompressingStoredFieldsReader.java | 4 +-
.../CompressingStoredFieldsWriter.java | 4 +-
.../CompressingTermVectorsFormat.java | 4 +-
.../CompressingTermVectorsReader.java | 4 +-
.../CompressingTermVectorsWriter.java | 4 +-
.../codecs/compressing/CompressionMode.java | 4 +-
.../lucene/codecs/compressing/Compressor.java | 4 +-
.../lucene/codecs/compressing/Decompressor.java | 4 +-
.../GrowableByteArrayDataOutput.java | 4 +-
.../apache/lucene/codecs/compressing/LZ4.java | 4 +-
.../codecs/compressing/MatchingReaders.java | 4 +-
.../apache/lucene/codecs/lucene50/ForUtil.java | 2 +-
.../codecs/lucene50/Lucene50CompoundFormat.java | 4 +-
.../codecs/lucene50/Lucene50CompoundReader.java | 4 +-
.../lucene50/Lucene50FieldInfosFormat.java | 4 +-
.../codecs/lucene50/Lucene50LiveDocsFormat.java | 4 +-
.../codecs/lucene50/Lucene50PostingsFormat.java | 6 +-
.../codecs/lucene50/Lucene50PostingsReader.java | 4 +-
.../codecs/lucene50/Lucene50PostingsWriter.java | 4 +-
.../lucene50/Lucene50SegmentInfoFormat.java | 4 +-
.../codecs/lucene50/Lucene50SkipReader.java | 4 +-
.../codecs/lucene50/Lucene50SkipWriter.java | 4 +-
.../lucene50/Lucene50StoredFieldsFormat.java | 4 +-
.../lucene50/Lucene50TermVectorsFormat.java | 4 +-
.../codecs/lucene53/Lucene53NormsConsumer.java | 4 +-
.../codecs/lucene53/Lucene53NormsFormat.java | 4 +-
.../codecs/lucene53/Lucene53NormsProducer.java | 4 +-
.../lucene54/Lucene54DocValuesConsumer.java | 4 +-
.../lucene54/Lucene54DocValuesFormat.java | 4 +-
.../lucene54/Lucene54DocValuesProducer.java | 4 +-
.../lucene/codecs/lucene60/Lucene60Codec.java | 4 +-
.../lucene60/Lucene60FieldInfosFormat.java | 4 +-
.../codecs/lucene60/Lucene60PointFormat.java | 4 +-
.../codecs/lucene60/Lucene60PointReader.java | 4 +-
.../codecs/lucene60/Lucene60PointWriter.java | 4 +-
.../perfield/PerFieldDocValuesFormat.java | 4 +-
.../codecs/perfield/PerFieldPostingsFormat.java | 4 +-
.../lucene/document/BinaryDocValuesField.java | 4 +-
.../org/apache/lucene/document/BinaryPoint.java | 4 +-
.../lucene/document/CompressionTools.java | 4 +-
.../org/apache/lucene/document/DateTools.java | 4 +-
.../org/apache/lucene/document/Document.java | 4 +-
.../document/DocumentStoredFieldVisitor.java | 4 +-
.../lucene/document/DoubleDocValuesField.java | 4 +-
.../org/apache/lucene/document/DoublePoint.java | 4 +-
.../java/org/apache/lucene/document/Field.java | 4 +-
.../org/apache/lucene/document/FieldType.java | 4 +-
.../lucene/document/FloatDocValuesField.java | 4 +-
.../org/apache/lucene/document/FloatPoint.java | 4 +-
.../org/apache/lucene/document/IntPoint.java | 4 +-
.../lucene/document/LegacyDoubleField.java | 4 +-
.../lucene/document/LegacyFloatField.java | 4 +-
.../apache/lucene/document/LegacyIntField.java | 4 +-
.../apache/lucene/document/LegacyLongField.java | 4 +-
.../org/apache/lucene/document/LongPoint.java | 4 +-
.../lucene/document/NumericDocValuesField.java | 4 +-
.../lucene/document/SortedDocValuesField.java | 4 +-
.../document/SortedNumericDocValuesField.java | 4 +-
.../document/SortedSetDocValuesField.java | 4 +-
.../org/apache/lucene/document/StoredField.java | 4 +-
.../org/apache/lucene/document/StringField.java | 4 +-
.../org/apache/lucene/document/TextField.java | 4 +-
.../apache/lucene/index/AbortingException.java | 4 +-
.../apache/lucene/index/AutomatonTermsEnum.java | 4 +-
.../lucene/index/BaseCompositeReader.java | 4 +-
.../apache/lucene/index/BinaryDocValues.java | 4 +-
.../index/BinaryDocValuesFieldUpdates.java | 4 +-
.../lucene/index/BinaryDocValuesWriter.java | 4 +-
.../java/org/apache/lucene/index/BitsSlice.java | 8 +-
.../apache/lucene/index/BufferedUpdates.java | 4 +-
.../lucene/index/BufferedUpdatesStream.java | 4 +-
.../apache/lucene/index/ByteSliceReader.java | 4 +-
.../apache/lucene/index/ByteSliceWriter.java | 10 +-
.../org/apache/lucene/index/CheckIndex.java | 4 +-
.../apache/lucene/index/CoalescedUpdates.java | 4 +-
.../org/apache/lucene/index/CodecReader.java | 4 +-
.../apache/lucene/index/CompositeReader.java | 4 +-
.../lucene/index/CompositeReaderContext.java | 4 +-
.../lucene/index/ConcurrentMergeScheduler.java | 4 +-
.../lucene/index/CorruptIndexException.java | 4 +-
.../lucene/index/DefaultIndexingChain.java | 4 +-
.../apache/lucene/index/DirectoryReader.java | 4 +-
.../org/apache/lucene/index/DocConsumer.java | 4 +-
.../java/org/apache/lucene/index/DocValues.java | 4 +-
.../lucene/index/DocValuesFieldUpdates.java | 4 +-
.../org/apache/lucene/index/DocValuesType.java | 4 +-
.../apache/lucene/index/DocValuesUpdate.java | 4 +-
.../apache/lucene/index/DocValuesWriter.java | 4 +-
.../apache/lucene/index/DocumentsWriter.java | 4 +-
.../index/DocumentsWriterDeleteQueue.java | 27 ++-
.../index/DocumentsWriterFlushControl.java | 10 +-
.../lucene/index/DocumentsWriterFlushQueue.java | 28 +--
.../lucene/index/DocumentsWriterPerThread.java | 10 +-
.../index/DocumentsWriterPerThreadPool.java | 8 +-
.../index/DocumentsWriterStallControl.java | 10 +-
.../lucene/index/ExitableDirectoryReader.java | 4 +-
.../java/org/apache/lucene/index/FieldInfo.java | 4 +-
.../org/apache/lucene/index/FieldInfos.java | 4 +-
.../apache/lucene/index/FieldTermIterator.java | 4 +-
.../java/org/apache/lucene/index/Fields.java | 4 +-
.../apache/lucene/index/FilterCodecReader.java | 4 +-
.../lucene/index/FilterDirectoryReader.java | 4 +-
.../apache/lucene/index/FilterLeafReader.java | 4 +-
.../apache/lucene/index/FilteredTermsEnum.java | 4 +-
.../lucene/index/FlushByRamOrCountsPolicy.java | 10 +-
.../org/apache/lucene/index/FlushPolicy.java | 10 +-
.../org/apache/lucene/index/FreqProxFields.java | 4 +-
.../lucene/index/FreqProxTermsWriter.java | 4 +-
.../index/FreqProxTermsWriterPerField.java | 4 +-
.../lucene/index/FrozenBufferedUpdates.java | 4 +-
.../org/apache/lucene/index/IndexCommit.java | 5 +-
.../lucene/index/IndexDeletionPolicy.java | 4 +-
.../apache/lucene/index/IndexFileDeleter.java | 4 +-
.../org/apache/lucene/index/IndexFileNames.java | 4 +-
.../index/IndexFormatTooNewException.java | 1 -
.../index/IndexFormatTooOldException.java | 1 -
.../lucene/index/IndexNotFoundException.java | 4 +-
.../org/apache/lucene/index/IndexOptions.java | 4 +-
.../org/apache/lucene/index/IndexReader.java | 4 +-
.../apache/lucene/index/IndexReaderContext.java | 4 +-
.../org/apache/lucene/index/IndexUpgrader.java | 4 +-
.../org/apache/lucene/index/IndexWriter.java | 4 +-
.../apache/lucene/index/IndexWriterConfig.java | 4 +-
.../org/apache/lucene/index/IndexableField.java | 4 +-
.../apache/lucene/index/IndexableFieldType.java | 4 +-
.../index/KeepOnlyLastCommitDeletionPolicy.java | 4 +-
.../org/apache/lucene/index/LeafReader.java | 4 +-
.../apache/lucene/index/LeafReaderContext.java | 4 +-
.../lucene/index/LiveIndexWriterConfig.java | 4 +-
.../lucene/index/LogByteSizeMergePolicy.java | 4 +-
.../apache/lucene/index/LogDocMergePolicy.java | 8 +-
.../org/apache/lucene/index/LogMergePolicy.java | 4 +-
.../apache/lucene/index/MappedMultiFields.java | 4 +-
.../lucene/index/MappingMultiPostingsEnum.java | 4 +-
.../org/apache/lucene/index/MergePolicy.java | 10 +-
.../apache/lucene/index/MergePolicyWrapper.java | 89 +++++++++
.../apache/lucene/index/MergeRateLimiter.java | 4 +-
.../org/apache/lucene/index/MergeScheduler.java | 4 +-
.../org/apache/lucene/index/MergeState.java | 4 +-
.../org/apache/lucene/index/MergeTrigger.java | 4 +-
.../index/MergedPrefixCodedTermsIterator.java | 4 +-
.../java/org/apache/lucene/index/MultiBits.java | 8 +-
.../org/apache/lucene/index/MultiDocValues.java | 4 +-
.../org/apache/lucene/index/MultiFields.java | 4 +-
.../apache/lucene/index/MultiPointValues.java | 4 +-
.../apache/lucene/index/MultiPostingsEnum.java | 4 +-
.../org/apache/lucene/index/MultiReader.java | 4 +-
.../org/apache/lucene/index/MultiTerms.java | 4 +-
.../org/apache/lucene/index/MultiTermsEnum.java | 4 +-
.../apache/lucene/index/NoDeletionPolicy.java | 4 +-
.../org/apache/lucene/index/NoMergePolicy.java | 22 +-
.../apache/lucene/index/NoMergeScheduler.java | 4 +-
.../apache/lucene/index/NormValuesWriter.java | 4 +-
.../apache/lucene/index/NumericDocValues.java | 4 +-
.../index/NumericDocValuesFieldUpdates.java | 18 +-
.../lucene/index/NumericDocValuesWriter.java | 4 +-
.../org/apache/lucene/index/OrdTermState.java | 4 +-
.../lucene/index/ParallelCompositeReader.java | 4 +-
.../apache/lucene/index/ParallelLeafReader.java | 4 +-
.../lucene/index/ParallelPostingsArray.java | 4 +-
.../index/PersistentSnapshotDeletionPolicy.java | 27 ++-
.../org/apache/lucene/index/PointValues.java | 4 +-
.../apache/lucene/index/PointValuesWriter.java | 4 +-
.../org/apache/lucene/index/PostingsEnum.java | 4 +-
.../apache/lucene/index/PrefixCodedTerms.java | 4 +-
.../org/apache/lucene/index/QueryTimeout.java | 4 +-
.../apache/lucene/index/QueryTimeoutImpl.java | 4 +-
.../apache/lucene/index/RandomAccessOrds.java | 4 +-
.../org/apache/lucene/index/ReaderManager.java | 4 +-
.../org/apache/lucene/index/ReaderSlice.java | 4 +-
.../org/apache/lucene/index/ReaderUtil.java | 4 +-
.../apache/lucene/index/ReadersAndUpdates.java | 4 +-
.../apache/lucene/index/SegmentCommitInfo.java | 4 +-
.../apache/lucene/index/SegmentCoreReaders.java | 4 +-
.../apache/lucene/index/SegmentDocValues.java | 4 +-
.../lucene/index/SegmentDocValuesProducer.java | 4 +-
.../org/apache/lucene/index/SegmentInfo.java | 4 +-
.../org/apache/lucene/index/SegmentInfos.java | 4 +-
.../org/apache/lucene/index/SegmentMerger.java | 4 +-
.../apache/lucene/index/SegmentReadState.java | 4 +-
.../org/apache/lucene/index/SegmentReader.java | 4 +-
.../apache/lucene/index/SegmentWriteState.java | 4 +-
.../lucene/index/SerialMergeScheduler.java | 4 +-
.../lucene/index/SimpleMergedSegmentWarmer.java | 4 +-
.../apache/lucene/index/SingleTermsEnum.java | 4 +-
.../index/SingletonSortedNumericDocValues.java | 4 +-
.../index/SingletonSortedSetDocValues.java | 4 +-
.../lucene/index/SlowCodecReaderWrapper.java | 4 +-
.../index/SlowCompositeReaderWrapper.java | 4 +-
.../lucene/index/SnapshotDeletionPolicy.java | 4 +-
.../apache/lucene/index/SortedDocValues.java | 4 +-
.../lucene/index/SortedDocValuesTermsEnum.java | 4 +-
.../lucene/index/SortedDocValuesWriter.java | 4 +-
.../lucene/index/SortedNumericDocValues.java | 4 +-
.../index/SortedNumericDocValuesWriter.java | 4 +-
.../apache/lucene/index/SortedSetDocValues.java | 4 +-
.../index/SortedSetDocValuesTermsEnum.java | 4 +-
.../lucene/index/SortedSetDocValuesWriter.java | 4 +-
.../lucene/index/StandardDirectoryReader.java | 4 +-
.../apache/lucene/index/StoredFieldVisitor.java | 4 +-
.../src/java/org/apache/lucene/index/Term.java | 4 +-
.../org/apache/lucene/index/TermContext.java | 4 +-
.../java/org/apache/lucene/index/TermState.java | 4 +-
.../lucene/index/TermVectorsConsumer.java | 4 +-
.../index/TermVectorsConsumerPerField.java | 4 +-
.../src/java/org/apache/lucene/index/Terms.java | 4 +-
.../java/org/apache/lucene/index/TermsEnum.java | 4 +-
.../java/org/apache/lucene/index/TermsHash.java | 4 +-
.../apache/lucene/index/TermsHashPerField.java | 4 +-
.../apache/lucene/index/TieredMergePolicy.java | 4 +-
.../lucene/index/TrackingIndexWriter.java | 4 +-
.../org/apache/lucene/index/TwoPhaseCommit.java | 8 +-
.../apache/lucene/index/TwoPhaseCommitTool.java | 8 +-
.../lucene/index/UpgradeIndexMergePolicy.java | 34 +---
.../apache/lucene/search/AutomatonQuery.java | 4 +-
.../apache/lucene/search/BlendedTermQuery.java | 4 +-
.../org/apache/lucene/search/BooleanClause.java | 4 +-
.../org/apache/lucene/search/BooleanQuery.java | 4 +-
.../org/apache/lucene/search/BooleanScorer.java | 4 +-
.../lucene/search/BooleanTopLevelScorers.java | 4 +-
.../org/apache/lucene/search/BooleanWeight.java | 4 +-
.../apache/lucene/search/BoostAttribute.java | 4 +-
.../lucene/search/BoostAttributeImpl.java | 4 +-
.../org/apache/lucene/search/BoostQuery.java | 4 +-
.../org/apache/lucene/search/BulkScorer.java | 4 +-
.../apache/lucene/search/CachingCollector.java | 4 +-
.../lucene/search/CollectionStatistics.java | 10 +-
.../search/CollectionTerminatedException.java | 4 +-
.../org/apache/lucene/search/Collector.java | 4 +-
.../apache/lucene/search/CollectorManager.java | 4 +-
.../apache/lucene/search/ConjunctionDISI.java | 4 +-
.../apache/lucene/search/ConjunctionScorer.java | 4 +-
.../lucene/search/ConstantScoreQuery.java | 4 +-
.../lucene/search/ConstantScoreScorer.java | 4 +-
.../lucene/search/ConstantScoreWeight.java | 4 +-
.../search/ControlledRealTimeReopenThread.java | 4 +-
.../apache/lucene/search/DisiPriorityQueue.java | 4 +-
.../org/apache/lucene/search/DisiWrapper.java | 4 +-
.../search/DisjunctionDISIApproximation.java | 2 +-
.../lucene/search/DisjunctionMaxQuery.java | 14 +-
.../lucene/search/DisjunctionMaxScorer.java | 14 +-
.../apache/lucene/search/DisjunctionScorer.java | 4 +-
.../lucene/search/DisjunctionSumScorer.java | 4 +-
.../java/org/apache/lucene/search/DocIdSet.java | 4 +-
.../apache/lucene/search/DocIdSetIterator.java | 4 +-
.../apache/lucene/search/DocValuesDocIdSet.java | 2 +-
.../lucene/search/DocValuesRewriteMethod.java | 4 +-
.../apache/lucene/search/ExactPhraseScorer.java | 4 +-
.../apache/lucene/search/ExactPointQuery.java | 4 +-
.../org/apache/lucene/search/Explanation.java | 4 +-
.../org/apache/lucene/search/FakeScorer.java | 4 +-
.../apache/lucene/search/FieldComparator.java | 4 +-
.../lucene/search/FieldComparatorSource.java | 4 +-
.../java/org/apache/lucene/search/FieldDoc.java | 4 +-
.../lucene/search/FieldValueHitQueue.java | 4 +-
.../apache/lucene/search/FieldValueQuery.java | 4 +-
.../apache/lucene/search/FilterCollector.java | 12 +-
.../lucene/search/FilterLeafCollector.java | 4 +-
.../org/apache/lucene/search/FilterScorer.java | 4 +-
.../lucene/search/FilteredDocIdSetIterator.java | 4 +-
.../org/apache/lucene/search/FuzzyQuery.java | 4 +-
.../apache/lucene/search/FuzzyTermsEnum.java | 4 +-
.../java/org/apache/lucene/search/HitQueue.java | 4 +-
.../org/apache/lucene/search/IndexSearcher.java | 4 +-
.../org/apache/lucene/search/LRUQueryCache.java | 4 +-
.../org/apache/lucene/search/LeafCollector.java | 4 +-
.../lucene/search/LeafFieldComparator.java | 4 +-
.../lucene/search/LegacyNumericRangeQuery.java | 4 +-
.../apache/lucene/search/LiveFieldValues.java | 4 +-
.../apache/lucene/search/MatchAllDocsQuery.java | 4 +-
.../apache/lucene/search/MatchNoDocsQuery.java | 4 +-
.../search/MaxNonCompetitiveBoostAttribute.java | 4 +-
.../MaxNonCompetitiveBoostAttributeImpl.java | 4 +-
.../lucene/search/MinShouldMatchSumScorer.java | 4 +-
.../apache/lucene/search/MultiCollector.java | 4 +-
.../apache/lucene/search/MultiPhraseQuery.java | 4 +-
.../apache/lucene/search/MultiTermQuery.java | 4 +-
.../MultiTermQueryConstantScoreWrapper.java | 4 +-
.../java/org/apache/lucene/search/Multiset.java | 4 +-
.../apache/lucene/search/NGramPhraseQuery.java | 4 +-
.../apache/lucene/search/PhrasePositions.java | 4 +-
.../org/apache/lucene/search/PhraseQuery.java | 4 +-
.../org/apache/lucene/search/PhraseQueue.java | 4 +-
.../apache/lucene/search/PointRangeQuery.java | 4 +-
.../search/PositiveScoresOnlyCollector.java | 4 +-
.../org/apache/lucene/search/PrefixQuery.java | 4 +-
.../java/org/apache/lucene/search/Query.java | 4 +-
.../org/apache/lucene/search/QueryCache.java | 4 +-
.../lucene/search/QueryCachingPolicy.java | 4 +-
.../org/apache/lucene/search/QueryRescorer.java | 4 +-
.../lucene/search/RandomAccessWeight.java | 4 +-
.../apache/lucene/search/ReferenceManager.java | 4 +-
.../org/apache/lucene/search/RegexpQuery.java | 4 +-
.../apache/lucene/search/ReqExclBulkScorer.java | 4 +-
.../org/apache/lucene/search/ReqExclScorer.java | 4 +-
.../apache/lucene/search/ReqOptSumScorer.java | 2 +-
.../java/org/apache/lucene/search/Rescorer.java | 4 +-
.../search/ScoreCachingWrappingScorer.java | 4 +-
.../java/org/apache/lucene/search/ScoreDoc.java | 4 +-
.../java/org/apache/lucene/search/Scorer.java | 4 +-
.../apache/lucene/search/ScoringRewrite.java | 4 +-
.../apache/lucene/search/SearcherFactory.java | 4 +-
.../lucene/search/SearcherLifetimeManager.java | 4 +-
.../apache/lucene/search/SearcherManager.java | 4 +-
.../apache/lucene/search/SimpleCollector.java | 4 +-
.../lucene/search/SimpleFieldComparator.java | 4 +-
.../lucene/search/SloppyPhraseScorer.java | 4 +-
.../src/java/org/apache/lucene/search/Sort.java | 4 +-
.../org/apache/lucene/search/SortField.java | 4 +-
.../org/apache/lucene/search/SortRescorer.java | 4 +-
.../lucene/search/SortedNumericSelector.java | 4 +-
.../lucene/search/SortedNumericSortField.java | 4 +-
.../apache/lucene/search/SortedSetSelector.java | 4 +-
.../lucene/search/SortedSetSortField.java | 4 +-
.../org/apache/lucene/search/SynonymQuery.java | 4 +-
.../lucene/search/TermCollectingRewrite.java | 4 +-
.../org/apache/lucene/search/TermQuery.java | 4 +-
.../apache/lucene/search/TermRangeQuery.java | 4 +-
.../org/apache/lucene/search/TermScorer.java | 4 +-
.../apache/lucene/search/TermStatistics.java | 4 +-
.../lucene/search/TimeLimitingCollector.java | 4 +-
.../java/org/apache/lucene/search/TopDocs.java | 4 +-
.../apache/lucene/search/TopDocsCollector.java | 4 +-
.../apache/lucene/search/TopFieldCollector.java | 4 +-
.../org/apache/lucene/search/TopFieldDocs.java | 4 +-
.../lucene/search/TopScoreDocCollector.java | 4 +-
.../apache/lucene/search/TopTermsRewrite.java | 4 +-
.../lucene/search/TotalHitCountCollector.java | 4 +-
.../apache/lucene/search/TwoPhaseIterator.java | 4 +-
.../search/UsageTrackingQueryCachingPolicy.java | 4 +-
.../java/org/apache/lucene/search/Weight.java | 4 +-
.../org/apache/lucene/search/WildcardQuery.java | 4 +-
.../lucene/search/similarities/AfterEffect.java | 4 +-
.../search/similarities/AfterEffectB.java | 4 +-
.../search/similarities/AfterEffectL.java | 4 +-
.../search/similarities/BM25Similarity.java | 4 +-
.../lucene/search/similarities/BasicModel.java | 4 +-
.../search/similarities/BasicModelBE.java | 4 +-
.../lucene/search/similarities/BasicModelD.java | 4 +-
.../lucene/search/similarities/BasicModelG.java | 4 +-
.../search/similarities/BasicModelIF.java | 4 +-
.../search/similarities/BasicModelIn.java | 4 +-
.../search/similarities/BasicModelIne.java | 4 +-
.../lucene/search/similarities/BasicModelP.java | 4 +-
.../lucene/search/similarities/BasicStats.java | 4 +-
.../search/similarities/ClassicSimilarity.java | 4 +-
.../search/similarities/DFISimilarity.java | 4 +-
.../search/similarities/DFRSimilarity.java | 4 +-
.../search/similarities/Distribution.java | 4 +-
.../search/similarities/DistributionLL.java | 4 +-
.../search/similarities/DistributionSPL.java | 4 +-
.../search/similarities/IBSimilarity.java | 4 +-
.../search/similarities/Independence.java | 4 +-
.../similarities/IndependenceChiSquared.java | 4 +-
.../similarities/IndependenceSaturated.java | 4 +-
.../similarities/IndependenceStandardized.java | 4 +-
.../similarities/LMDirichletSimilarity.java | 4 +-
.../similarities/LMJelinekMercerSimilarity.java | 4 +-
.../search/similarities/LMSimilarity.java | 4 +-
.../lucene/search/similarities/Lambda.java | 4 +-
.../lucene/search/similarities/LambdaDF.java | 4 +-
.../lucene/search/similarities/LambdaTTF.java | 4 +-
.../search/similarities/MultiSimilarity.java | 4 +-
.../search/similarities/Normalization.java | 4 +-
.../search/similarities/NormalizationH1.java | 4 +-
.../search/similarities/NormalizationH2.java | 4 +-
.../search/similarities/NormalizationH3.java | 4 +-
.../search/similarities/NormalizationZ.java | 4 +-
.../similarities/PerFieldSimilarityWrapper.java | 4 +-
.../lucene/search/similarities/Similarity.java | 4 +-
.../search/similarities/SimilarityBase.java | 4 +-
.../search/similarities/TFIDFSimilarity.java | 4 +-
.../lucene/search/spans/ConjunctionSpans.java | 4 +-
.../lucene/search/spans/ContainSpans.java | 4 +-
.../search/spans/FieldMaskingSpanQuery.java | 4 +-
.../apache/lucene/search/spans/FilterSpans.java | 4 +-
.../lucene/search/spans/NearSpansOrdered.java | 4 +-
.../lucene/search/spans/NearSpansUnordered.java | 4 +-
.../search/spans/ScoringWrapperSpans.java | 4 +-
.../lucene/search/spans/SpanBoostQuery.java | 4 +-
.../lucene/search/spans/SpanCollector.java | 4 +-
.../lucene/search/spans/SpanContainQuery.java | 4 +-
.../search/spans/SpanContainingQuery.java | 4 +-
.../lucene/search/spans/SpanFirstQuery.java | 4 +-
.../search/spans/SpanMultiTermQueryWrapper.java | 4 +-
.../lucene/search/spans/SpanNearQuery.java | 4 +-
.../lucene/search/spans/SpanNotQuery.java | 4 +-
.../apache/lucene/search/spans/SpanOrQuery.java | 4 +-
.../search/spans/SpanPositionCheckQuery.java | 2 +-
.../lucene/search/spans/SpanPositionQueue.java | 4 +-
.../search/spans/SpanPositionRangeQuery.java | 2 +-
.../apache/lucene/search/spans/SpanQuery.java | 4 +-
.../apache/lucene/search/spans/SpanScorer.java | 4 +-
.../lucene/search/spans/SpanTermQuery.java | 4 +-
.../apache/lucene/search/spans/SpanWeight.java | 4 +-
.../lucene/search/spans/SpanWithinQuery.java | 4 +-
.../org/apache/lucene/search/spans/Spans.java | 4 +-
.../apache/lucene/search/spans/TermSpans.java | 14 +-
.../lucene/store/AlreadyClosedException.java | 4 +-
.../org/apache/lucene/store/BaseDirectory.java | 4 +-
.../apache/lucene/store/BufferedChecksum.java | 4 +-
.../store/BufferedChecksumIndexInput.java | 4 +-
.../apache/lucene/store/BufferedIndexInput.java | 4 +-
.../apache/lucene/store/ByteArrayDataInput.java | 4 +-
.../lucene/store/ByteArrayDataOutput.java | 4 +-
.../lucene/store/ByteBufferIndexInput.java | 4 +-
.../apache/lucene/store/ChecksumIndexInput.java | 8 +-
.../java/org/apache/lucene/store/DataInput.java | 4 +-
.../org/apache/lucene/store/DataOutput.java | 4 +-
.../java/org/apache/lucene/store/Directory.java | 4 +-
.../org/apache/lucene/store/FSDirectory.java | 4 +-
.../org/apache/lucene/store/FSLockFactory.java | 4 +-
.../lucene/store/FileSwitchDirectory.java | 4 +-
.../apache/lucene/store/FilterDirectory.java | 4 +-
.../java/org/apache/lucene/store/FlushInfo.java | 4 +-
.../java/org/apache/lucene/store/IOContext.java | 4 +-
.../org/apache/lucene/store/IndexInput.java | 4 +-
.../org/apache/lucene/store/IndexOutput.java | 4 +-
.../lucene/store/InputStreamDataInput.java | 4 +-
.../src/java/org/apache/lucene/store/Lock.java | 4 +-
.../org/apache/lucene/store/LockFactory.java | 4 +-
.../lucene/store/LockObtainFailedException.java | 1 -
.../store/LockReleaseFailedException.java | 1 -
.../org/apache/lucene/store/LockStressTest.java | 4 +-
.../store/LockValidatingDirectoryWrapper.java | 4 +-
.../apache/lucene/store/LockVerifyServer.java | 4 +-
.../org/apache/lucene/store/MMapDirectory.java | 4 +-
.../java/org/apache/lucene/store/MergeInfo.java | 2 +-
.../org/apache/lucene/store/NIOFSDirectory.java | 27 ++-
.../lucene/store/NRTCachingDirectory.java | 4 +-
.../lucene/store/NativeFSLockFactory.java | 4 +-
.../org/apache/lucene/store/NoLockFactory.java | 4 +-
.../lucene/store/OutputStreamDataOutput.java | 4 +-
.../lucene/store/OutputStreamIndexOutput.java | 4 +-
.../org/apache/lucene/store/RAMDirectory.java | 4 +-
.../java/org/apache/lucene/store/RAMFile.java | 4 +-
.../org/apache/lucene/store/RAMInputStream.java | 4 +-
.../apache/lucene/store/RAMOutputStream.java | 4 +-
.../apache/lucene/store/RandomAccessInput.java | 4 +-
.../lucene/store/RateLimitedIndexOutput.java | 4 +-
.../org/apache/lucene/store/RateLimiter.java | 4 +-
.../apache/lucene/store/SimpleFSDirectory.java | 4 +-
.../lucene/store/SimpleFSLockFactory.java | 4 +-
.../lucene/store/SingleInstanceLockFactory.java | 4 +-
.../lucene/store/SleepingLockWrapper.java | 4 +-
.../lucene/store/TrackingDirectoryWrapper.java | 4 +-
.../lucene/store/VerifyingLockFactory.java | 4 +-
.../org/apache/lucene/util/Accountable.java | 4 +-
.../org/apache/lucene/util/Accountables.java | 4 +-
.../lucene/util/ArrayInPlaceMergeSorter.java | 4 +-
.../apache/lucene/util/ArrayIntroSorter.java | 4 +-
.../org/apache/lucene/util/ArrayTimSorter.java | 4 +-
.../java/org/apache/lucene/util/ArrayUtil.java | 4 +-
.../java/org/apache/lucene/util/Attribute.java | 4 +-
.../apache/lucene/util/AttributeFactory.java | 4 +-
.../org/apache/lucene/util/AttributeImpl.java | 4 +-
.../apache/lucene/util/AttributeReflector.java | 4 +-
.../org/apache/lucene/util/AttributeSource.java | 4 +-
.../org/apache/lucene/util/BitDocIdSet.java | 4 +-
.../src/java/org/apache/lucene/util/BitSet.java | 4 +-
.../org/apache/lucene/util/BitSetIterator.java | 4 +-
.../java/org/apache/lucene/util/BitUtil.java | 1 -
.../src/java/org/apache/lucene/util/Bits.java | 4 +-
.../org/apache/lucene/util/ByteBlockPool.java | 4 +-
.../java/org/apache/lucene/util/BytesRef.java | 4 +-
.../org/apache/lucene/util/BytesRefArray.java | 27 ++-
.../org/apache/lucene/util/BytesRefBuilder.java | 4 +-
.../org/apache/lucene/util/BytesRefHash.java | 4 +-
.../apache/lucene/util/BytesRefIterator.java | 4 +-
.../java/org/apache/lucene/util/CharsRef.java | 4 +-
.../org/apache/lucene/util/CharsRefBuilder.java | 4 +-
.../lucene/util/CloseableThreadLocal.java | 4 +-
.../org/apache/lucene/util/CollectionUtil.java | 4 +-
.../org/apache/lucene/util/CommandLineUtil.java | 4 +-
.../java/org/apache/lucene/util/Constants.java | 4 +-
.../java/org/apache/lucene/util/Counter.java | 8 +-
.../org/apache/lucene/util/DocIdSetBuilder.java | 4 +-
.../org/apache/lucene/util/FilterIterator.java | 27 ++-
.../org/apache/lucene/util/FixedBitSet.java | 4 +-
.../util/FrequencyTrackingRingBuffer.java | 4 +-
.../java/org/apache/lucene/util/IOUtils.java | 4 +-
.../apache/lucene/util/InPlaceMergeSorter.java | 4 +-
.../java/org/apache/lucene/util/InfoStream.java | 4 +-
.../apache/lucene/util/IntArrayDocIdSet.java | 4 +-
.../org/apache/lucene/util/IntBlockPool.java | 4 +-
.../org/apache/lucene/util/IntroSorter.java | 4 +-
.../java/org/apache/lucene/util/IntsRef.java | 8 +-
.../org/apache/lucene/util/IntsRefBuilder.java | 4 +-
.../org/apache/lucene/util/LSBRadixSorter.java | 4 +-
.../apache/lucene/util/LegacyNumericUtils.java | 4 +-
.../java/org/apache/lucene/util/LongBitSet.java | 4 +-
.../java/org/apache/lucene/util/LongValues.java | 4 +-
.../java/org/apache/lucene/util/LongsRef.java | 8 +-
.../java/org/apache/lucene/util/MapOfSets.java | 4 +-
.../java/org/apache/lucene/util/MathUtil.java | 4 +-
.../org/apache/lucene/util/MergedIterator.java | 4 +-
.../org/apache/lucene/util/MutableBits.java | 4 +-
.../org/apache/lucene/util/NamedSPILoader.java | 4 +-
.../apache/lucene/util/NamedThreadFactory.java | 4 +-
.../org/apache/lucene/util/NotDocIdSet.java | 4 +-
.../org/apache/lucene/util/NumericUtils.java | 4 +-
.../org/apache/lucene/util/OfflineSorter.java | 4 +-
.../java/org/apache/lucene/util/PagedBytes.java | 4 +-
.../lucene/util/PrintStreamInfoStream.java | 4 +-
.../org/apache/lucene/util/PriorityQueue.java | 10 +-
.../org/apache/lucene/util/QueryBuilder.java | 4 +-
.../apache/lucene/util/RamUsageEstimator.java | 4 +-
.../util/RecyclingByteBlockAllocator.java | 8 +-
.../lucene/util/RecyclingIntBlockAllocator.java | 8 +-
.../java/org/apache/lucene/util/RefCount.java | 10 +-
.../org/apache/lucene/util/RoaringDocIdSet.java | 4 +-
.../org/apache/lucene/util/RollingBuffer.java | 4 +-
.../apache/lucene/util/SPIClassIterator.java | 4 +-
.../org/apache/lucene/util/SentinelIntSet.java | 4 +-
.../java/org/apache/lucene/util/SetOnce.java | 8 +-
.../java/org/apache/lucene/util/SloppyMath.java | 4 +-
.../java/org/apache/lucene/util/SmallFloat.java | 14 +-
.../src/java/org/apache/lucene/util/Sorter.java | 4 +-
.../apache/lucene/util/SparseFixedBitSet.java | 4 +-
.../lucene/util/StrictStringTokenizer.java | 4 +-
.../org/apache/lucene/util/StringHelper.java | 4 +-
.../apache/lucene/util/SuppressForbidden.java | 4 +-
.../lucene/util/ThreadInterruptedException.java | 9 +-
.../java/org/apache/lucene/util/TimSorter.java | 4 +-
.../org/apache/lucene/util/ToStringUtils.java | 4 +-
.../org/apache/lucene/util/UnicodeUtil.java | 6 +-
.../java/org/apache/lucene/util/Version.java | 4 +-
.../org/apache/lucene/util/VirtualMethod.java | 4 +-
.../org/apache/lucene/util/WeakIdentityMap.java | 4 +-
.../apache/lucene/util/automaton/Automaton.java | 4 +-
.../lucene/util/automaton/ByteRunAutomaton.java | 4 +-
.../util/automaton/CharacterRunAutomaton.java | 4 +-
.../util/automaton/CompiledAutomaton.java | 4 +-
.../automaton/DaciukMihovAutomatonBuilder.java | 4 +-
.../util/automaton/FiniteStringsIterator.java | 4 +-
.../automaton/Lev1ParametricDescription.java | 3 +-
.../automaton/Lev1TParametricDescription.java | 3 +-
.../automaton/Lev2ParametricDescription.java | 3 +-
.../automaton/Lev2TParametricDescription.java | 3 +-
.../util/automaton/LevenshteinAutomata.java | 4 +-
.../automaton/LimitedFiniteStringsIterator.java | 4 +-
.../lucene/util/automaton/SortedIntSet.java | 4 +-
.../TooComplexToDeterminizeException.java | 4 +-
.../lucene/util/automaton/Transition.java | 4 +-
.../lucene/util/automaton/UTF32ToUTF8.java | 4 +-
.../lucene/util/automaton/createLevAutomata.py | 89 ++++-----
.../org/apache/lucene/util/bkd/BKDReader.java | 4 +-
.../org/apache/lucene/util/bkd/BKDWriter.java | 4 +-
.../apache/lucene/util/bkd/HeapPointReader.java | 4 +-
.../apache/lucene/util/bkd/HeapPointWriter.java | 4 +-
.../lucene/util/bkd/OfflinePointReader.java | 4 +-
.../lucene/util/bkd/OfflinePointWriter.java | 4 +-
.../org/apache/lucene/util/bkd/PointReader.java | 4 +-
.../org/apache/lucene/util/bkd/PointWriter.java | 4 +-
.../org/apache/lucene/util/fst/Builder.java | 4 +-
.../lucene/util/fst/ByteSequenceOutputs.java | 4 +-
.../apache/lucene/util/fst/BytesRefFSTEnum.java | 4 +-
.../org/apache/lucene/util/fst/BytesStore.java | 4 +-
.../lucene/util/fst/CharSequenceOutputs.java | 4 +-
.../java/org/apache/lucene/util/fst/FST.java | 4 +-
.../org/apache/lucene/util/fst/FSTEnum.java | 4 +-
.../lucene/util/fst/ForwardBytesReader.java | 4 +-
.../lucene/util/fst/IntSequenceOutputs.java | 4 +-
.../apache/lucene/util/fst/IntsRefFSTEnum.java | 4 +-
.../org/apache/lucene/util/fst/NoOutputs.java | 4 +-
.../org/apache/lucene/util/fst/NodeHash.java | 4 +-
.../org/apache/lucene/util/fst/Outputs.java | 4 +-
.../org/apache/lucene/util/fst/PairOutputs.java | 4 +-
.../lucene/util/fst/PositiveIntOutputs.java | 4 +-
.../lucene/util/fst/ReverseBytesReader.java | 4 +-
.../java/org/apache/lucene/util/fst/Util.java | 4 +-
.../util/packed/AbstractBlockPackedWriter.java | 4 +-
.../util/packed/AbstractPagedMutable.java | 4 +-
.../lucene/util/packed/BlockPackedReader.java | 4 +-
.../util/packed/BlockPackedReaderIterator.java | 4 +-
.../lucene/util/packed/BlockPackedWriter.java | 4 +-
.../lucene/util/packed/BulkOperation.java | 3 +-
.../lucene/util/packed/BulkOperationPacked.java | 6 +-
.../util/packed/BulkOperationPacked1.java | 3 +-
.../util/packed/BulkOperationPacked10.java | 3 +-
.../util/packed/BulkOperationPacked11.java | 3 +-
.../util/packed/BulkOperationPacked12.java | 3 +-
.../util/packed/BulkOperationPacked13.java | 3 +-
.../util/packed/BulkOperationPacked14.java | 3 +-
.../util/packed/BulkOperationPacked15.java | 3 +-
.../util/packed/BulkOperationPacked16.java | 3 +-
.../util/packed/BulkOperationPacked17.java | 3 +-
.../util/packed/BulkOperationPacked18.java | 3 +-
.../util/packed/BulkOperationPacked19.java | 3 +-
.../util/packed/BulkOperationPacked2.java | 3 +-
.../util/packed/BulkOperationPacked20.java | 3 +-
.../util/packed/BulkOperationPacked21.java | 3 +-
.../util/packed/BulkOperationPacked22.java | 3 +-
.../util/packed/BulkOperationPacked23.java | 3 +-
.../util/packed/BulkOperationPacked24.java | 3 +-
.../util/packed/BulkOperationPacked3.java | 3 +-
.../util/packed/BulkOperationPacked4.java | 3 +-
.../util/packed/BulkOperationPacked5.java | 3 +-
.../util/packed/BulkOperationPacked6.java | 3 +-
.../util/packed/BulkOperationPacked7.java | 3 +-
.../util/packed/BulkOperationPacked8.java | 3 +-
.../util/packed/BulkOperationPacked9.java | 3 +-
.../packed/BulkOperationPackedSingleBlock.java | 4 +-
.../util/packed/DeltaPackedLongValues.java | 4 +-
.../org/apache/lucene/util/packed/Direct16.java | 8 +-
.../org/apache/lucene/util/packed/Direct32.java | 8 +-
.../org/apache/lucene/util/packed/Direct64.java | 3 +-
.../org/apache/lucene/util/packed/Direct8.java | 8 +-
.../util/packed/DirectMonotonicReader.java | 4 +-
.../util/packed/DirectMonotonicWriter.java | 4 +-
.../packed/DirectPacked64SingleBlockReader.java | 4 +-
.../lucene/util/packed/DirectPackedReader.java | 4 +-
.../apache/lucene/util/packed/DirectReader.java | 4 +-
.../apache/lucene/util/packed/DirectWriter.java | 4 +-
.../lucene/util/packed/GrowableWriter.java | 4 +-
.../util/packed/MonotonicBlockPackedReader.java | 4 +-
.../util/packed/MonotonicBlockPackedWriter.java | 4 +-
.../lucene/util/packed/MonotonicLongValues.java | 4 +-
.../lucene/util/packed/Packed16ThreeBlocks.java | 3 +-
.../org/apache/lucene/util/packed/Packed64.java | 4 +-
.../lucene/util/packed/Packed64SingleBlock.java | 3 +-
.../lucene/util/packed/Packed8ThreeBlocks.java | 3 +-
.../lucene/util/packed/PackedDataInput.java | 4 +-
.../lucene/util/packed/PackedDataOutput.java | 4 +-
.../apache/lucene/util/packed/PackedInts.java | 4 +-
.../lucene/util/packed/PackedLongValues.java | 4 +-
.../util/packed/PackedReaderIterator.java | 4 +-
.../apache/lucene/util/packed/PackedWriter.java | 4 +-
.../lucene/util/packed/PagedGrowableWriter.java | 4 +-
.../apache/lucene/util/packed/PagedMutable.java | 4 +-
.../lucene/util/packed/gen_BulkOperation.py | 79 ++++----
.../org/apache/lucene/util/packed/gen_Direct.py | 29 ++-
.../util/packed/gen_Packed64SingleBlock.py | 45 ++---
.../lucene/util/packed/gen_PackedThreeBlocks.py | 27 ++-
.../test/org/apache/lucene/TestAssertions.java | 4 +-
.../src/test/org/apache/lucene/TestDemo.java | 4 +-
.../org/apache/lucene/TestExternalCodecs.java | 4 +-
.../lucene/TestMergeSchedulerExternal.java | 4 +-
.../src/test/org/apache/lucene/TestSearch.java | 4 +-
.../apache/lucene/TestSearchForDuplicates.java | 4 +-
.../lucene/analysis/TestCachingTokenFilter.java | 4 +-
.../apache/lucene/analysis/TestCharFilter.java | 4 +-
.../lucene/analysis/TestNumericTokenStream.java | 4 +-
.../analysis/TestReusableStringReader.java | 12 +-
.../org/apache/lucene/analysis/TestToken.java | 4 +-
.../tokenattributes/TestBytesRefAttImpl.java | 4 +-
.../TestCharTermAttributeImpl.java | 4 +-
.../TestPackedTokenAttributeImpl.java | 4 +-
.../TestSimpleAttributeImpl.java | 4 +-
.../lucene/codecs/TestCodecLoadingDeadlock.java | 4 +-
.../AbstractTestCompressionMode.java | 4 +-
.../AbstractTestLZ4CompressionMode.java | 4 +-
.../compressing/TestFastCompressionMode.java | 4 +-
.../compressing/TestFastDecompressionMode.java | 4 +-
.../TestGrowableByteArrayDataOutput.java | 4 +-
.../compressing/TestHighCompressionMode.java | 4 +-
.../lucene50/TestBlockPostingsFormat.java | 4 +-
.../lucene50/TestBlockPostingsFormat2.java | 4 +-
.../lucene50/TestBlockPostingsFormat3.java | 4 +-
.../lucene/codecs/lucene50/TestForUtil.java | 4 +-
.../lucene50/TestLucene50CompoundFormat.java | 4 +-
.../lucene50/TestLucene50FieldInfoFormat.java | 4 +-
.../lucene50/TestLucene50SegmentInfoFormat.java | 4 +-
.../TestLucene50StoredFieldsFormat.java | 4 +-
...cene50StoredFieldsFormatHighCompression.java | 4 +-
.../lucene50/TestLucene50TermVectorsFormat.java | 4 +-
.../lucene53/TestLucene53NormsFormat.java | 4 +-
.../lucene54/TestLucene54DocValuesFormat.java | 4 +-
.../lucene60/TestLucene60PointFormat.java | 4 +-
.../perfield/TestPerFieldDocValuesFormat.java | 4 +-
.../perfield/TestPerFieldPostingsFormat.java | 4 +-
.../perfield/TestPerFieldPostingsFormat2.java | 4 +-
.../lucene/document/TestBinaryDocument.java | 4 +-
.../apache/lucene/document/TestDateTools.java | 16 +-
.../apache/lucene/document/TestDocument.java | 4 +-
.../org/apache/lucene/document/TestField.java | 4 +-
.../apache/lucene/document/TestFieldType.java | 4 +-
.../lucene/index/Test2BBinaryDocValues.java | 4 +-
.../lucene/index/Test2BNumericDocValues.java | 4 +-
.../apache/lucene/index/Test2BPositions.java | 4 +-
.../org/apache/lucene/index/Test2BPostings.java | 4 +-
.../lucene/index/Test2BPostingsBytes.java | 4 +-
.../index/Test2BSortedDocValuesFixedSorted.java | 4 +-
.../lucene/index/Test2BSortedDocValuesOrds.java | 4 +-
.../org/apache/lucene/index/Test2BTerms.java | 4 +-
.../lucene/index/Test4GBStoredFields.java | 4 +-
.../org/apache/lucene/index/TestAddIndexes.java | 4 +-
.../index/TestAllFilesCheckIndexHeader.java | 4 +-
.../index/TestAllFilesDetectTruncation.java | 4 +-
.../index/TestAllFilesHaveChecksumFooter.java | 4 +-
.../index/TestAllFilesHaveCodecHeader.java | 4 +-
.../apache/lucene/index/TestAtomicUpdate.java | 15 +-
.../apache/lucene/index/TestBagOfPositions.java | 4 +-
.../apache/lucene/index/TestBagOfPostings.java | 4 +-
.../index/TestBinaryDocValuesUpdates.java | 32 +--
.../apache/lucene/index/TestBinaryTerms.java | 4 +-
.../org/apache/lucene/index/TestByteSlices.java | 12 +-
.../org/apache/lucene/index/TestCheckIndex.java | 4 +-
.../lucene/index/TestCodecHoldsOpenFiles.java | 4 +-
.../org/apache/lucene/index/TestCodecUtil.java | 4 +-
.../org/apache/lucene/index/TestCodecs.java | 4 +-
.../index/TestConcurrentMergeScheduler.java | 4 +-
.../index/TestConsistentFieldNumbers.java | 4 +-
.../test/org/apache/lucene/index/TestCrash.java | 4 +-
.../index/TestCrashCausesCorruptIndex.java | 4 +-
.../apache/lucene/index/TestCustomNorms.java | 4 +-
.../apache/lucene/index/TestDeletionPolicy.java | 4 +-
.../index/TestDemoParallelLeafReader.java | 10 +-
.../lucene/index/TestDirectoryReader.java | 4 +-
.../lucene/index/TestDirectoryReaderReopen.java | 4 +-
.../test/org/apache/lucene/index/TestDoc.java | 4 +-
.../org/apache/lucene/index/TestDocCount.java | 4 +-
.../index/TestDocInverterPerFieldErrorInfo.java | 4 +-
.../org/apache/lucene/index/TestDocValues.java | 4 +-
.../lucene/index/TestDocValuesIndexing.java | 4 +-
.../lucene/index/TestDocsAndPositions.java | 4 +-
.../apache/lucene/index/TestDocumentWriter.java | 4 +-
.../index/TestDocumentsWriterDeleteQueue.java | 29 ++-
.../index/TestDocumentsWriterStallControl.java | 27 ++-
.../apache/lucene/index/TestDuelingCodecs.java | 4 +-
.../lucene/index/TestDuelingCodecsAtNight.java | 4 +-
.../lucene/index/TestExceedMaxTermLength.java | 4 +-
.../index/TestExitableDirectoryReader.java | 4 +-
.../org/apache/lucene/index/TestFieldReuse.java | 4 +-
.../apache/lucene/index/TestFieldsReader.java | 4 +-
.../lucene/index/TestFilterDirectoryReader.java | 4 +-
.../lucene/index/TestFilterLeafReader.java | 4 +-
.../test/org/apache/lucene/index/TestFlex.java | 4 +-
.../index/TestFlushByRamOrCountsPolicy.java | 4 +-
.../lucene/index/TestForTooMuchCloning.java | 4 +-
.../lucene/index/TestForceMergeForever.java | 4 +-
.../apache/lucene/index/TestIndexCommit.java | 4 +-
.../lucene/index/TestIndexFileDeleter.java | 4 +-
.../org/apache/lucene/index/TestIndexInput.java | 4 +-
.../lucene/index/TestIndexReaderClose.java | 4 +-
.../apache/lucene/index/TestIndexWriter.java | 4 +-
.../lucene/index/TestIndexWriterCommit.java | 4 +-
.../lucene/index/TestIndexWriterConfig.java | 4 +-
.../lucene/index/TestIndexWriterDelete.java | 4 +-
.../index/TestIndexWriterDeleteByQuery.java | 4 +-
.../lucene/index/TestIndexWriterExceptions.java | 4 +-
.../index/TestIndexWriterExceptions2.java | 4 +-
.../lucene/index/TestIndexWriterForceMerge.java | 4 +-
.../lucene/index/TestIndexWriterFromReader.java | 4 +-
.../index/TestIndexWriterLockRelease.java | 4 +-
.../lucene/index/TestIndexWriterMaxDocs.java | 4 +-
.../index/TestIndexWriterMergePolicy.java | 4 +-
.../lucene/index/TestIndexWriterMerging.java | 17 +-
.../index/TestIndexWriterNRTIsCurrent.java | 28 +--
.../lucene/index/TestIndexWriterOnDiskFull.java | 4 +-
.../lucene/index/TestIndexWriterOnJRECrash.java | 28 ++-
.../lucene/index/TestIndexWriterOnVMError.java | 4 +-
.../TestIndexWriterOutOfFileDescriptors.java | 4 +-
.../lucene/index/TestIndexWriterReader.java | 14 +-
.../index/TestIndexWriterThreadsToSegments.java | 4 +-
.../lucene/index/TestIndexWriterUnicode.java | 4 +-
.../index/TestIndexWriterWithThreads.java | 4 +-
.../apache/lucene/index/TestIndexableField.java | 4 +-
.../org/apache/lucene/index/TestInfoStream.java | 4 +-
.../apache/lucene/index/TestIntBlockPool.java | 4 +-
.../org/apache/lucene/index/TestIsCurrent.java | 4 +-
.../lucene/index/TestLazyProxSkipping.java | 4 +-
.../apache/lucene/index/TestLogMergePolicy.java | 4 +-
.../apache/lucene/index/TestLongPostings.java | 4 +-
.../org/apache/lucene/index/TestManyFields.java | 4 +-
.../apache/lucene/index/TestMaxPosition.java | 4 +-
.../lucene/index/TestMaxTermFrequency.java | 4 +-
.../lucene/index/TestMergePolicyWrapper.java | 37 ++++
.../lucene/index/TestMergeRateLimiter.java | 4 +-
.../apache/lucene/index/TestMixedCodecs.java | 4 +-
.../lucene/index/TestMixedDocValuesUpdates.java | 32 +--
.../apache/lucene/index/TestMultiDocValues.java | 4 +-
.../apache/lucene/index/TestMultiFields.java | 4 +-
.../lucene/index/TestMultiLevelSkipList.java | 4 +-
.../apache/lucene/index/TestMultiTermsEnum.java | 4 +-
.../lucene/index/TestNRTReaderCleanup.java | 4 +-
.../lucene/index/TestNRTReaderWithThreads.java | 4 +-
.../org/apache/lucene/index/TestNRTThreads.java | 4 +-
.../apache/lucene/index/TestNeverDelete.java | 4 +-
.../apache/lucene/index/TestNewestSegment.java | 4 +-
.../lucene/index/TestNoDeletionPolicy.java | 4 +-
.../apache/lucene/index/TestNoMergePolicy.java | 4 +-
.../lucene/index/TestNoMergeScheduler.java | 4 +-
.../test/org/apache/lucene/index/TestNorms.java | 4 +-
.../index/TestNumericDocValuesUpdates.java | 32 +--
.../org/apache/lucene/index/TestOmitNorms.java | 4 +-
.../apache/lucene/index/TestOmitPositions.java | 4 +-
.../org/apache/lucene/index/TestOmitTf.java | 4 +-
.../org/apache/lucene/index/TestOrdinalMap.java | 4 +-
.../index/TestParallelCompositeReader.java | 4 +-
.../lucene/index/TestParallelLeafReader.java | 4 +-
.../index/TestParallelReaderEmptyIndex.java | 4 +-
.../lucene/index/TestParallelTermEnum.java | 4 +-
.../org/apache/lucene/index/TestPayloads.java | 4 +-
.../lucene/index/TestPayloadsOnVectors.java | 4 +-
.../lucene/index/TestPerSegmentDeletes.java | 4 +-
.../TestPersistentSnapshotDeletionPolicy.java | 27 ++-
.../apache/lucene/index/TestPointValues.java | 4 +-
.../lucene/index/TestPostingsOffsets.java | 4 +-
.../lucene/index/TestPrefixCodedTerms.java | 4 +-
.../apache/lucene/index/TestReadOnlyIndex.java | 4 +-
.../apache/lucene/index/TestReaderClosed.java | 4 +-
.../index/TestReaderWrapperDVTypeCheck.java | 1 -
.../org/apache/lucene/index/TestRollback.java | 4 +-
.../apache/lucene/index/TestRollingUpdates.java | 4 +-
.../lucene/index/TestSameTokenSamePosition.java | 4 +-
.../apache/lucene/index/TestSegmentInfos.java | 4 +-
.../apache/lucene/index/TestSegmentMerger.java | 4 +-
.../apache/lucene/index/TestSegmentReader.java | 4 +-
.../lucene/index/TestSegmentTermDocs.java | 4 +-
.../lucene/index/TestSegmentTermEnum.java | 4 +-
.../lucene/index/TestSizeBoundedForceMerge.java | 4 +-
.../index/TestSnapshotDeletionPolicy.java | 4 +-
.../apache/lucene/index/TestStressAdvance.java | 4 +-
.../apache/lucene/index/TestStressDeletes.java | 14 +-
.../apache/lucene/index/TestStressIndexing.java | 14 +-
.../lucene/index/TestStressIndexing2.java | 12 +-
.../org/apache/lucene/index/TestStressNRT.java | 4 +-
.../org/apache/lucene/index/TestSumDocFreq.java | 4 +-
.../lucene/index/TestSwappedIndexFiles.java | 4 +-
.../test/org/apache/lucene/index/TestTerm.java | 4 +-
.../apache/lucene/index/TestTermVectors.java | 4 +-
.../lucene/index/TestTermVectorsReader.java | 4 +-
.../lucene/index/TestTermVectorsWriter.java | 4 +-
.../apache/lucene/index/TestTermdocPerf.java | 15 +-
.../test/org/apache/lucene/index/TestTerms.java | 4 +-
.../org/apache/lucene/index/TestTermsEnum.java | 4 +-
.../org/apache/lucene/index/TestTermsEnum2.java | 4 +-
.../lucene/index/TestThreadedForceMerge.java | 4 +-
.../lucene/index/TestTieredMergePolicy.java | 4 +-
.../index/TestTragicIndexWriterDeadlock.java | 4 +-
.../lucene/index/TestTransactionRollback.java | 4 +-
.../apache/lucene/index/TestTransactions.java | 4 +-
.../org/apache/lucene/index/TestTryDelete.java | 4 +-
.../lucene/index/TestTwoPhaseCommitTool.java | 4 +-
.../lucene/index/TestUniqueTermCount.java | 4 +-
.../index/TestUpgradeIndexMergePolicy.java | 4 +-
.../lucene/search/BaseTestRangeFilter.java | 4 +-
.../apache/lucene/search/JustCompileSearch.java | 4 +-
.../lucene/search/MultiCollectorTest.java | 4 +-
.../TestApproximationSearchEquivalence.java | 4 +-
.../lucene/search/TestAutomatonQuery.java | 4 +-
.../search/TestAutomatonQueryUnicode.java | 4 +-
.../lucene/search/TestBlendedTermQuery.java | 4 +-
.../org/apache/lucene/search/TestBoolean2.java | 4 +-
.../apache/lucene/search/TestBooleanCoord.java | 4 +-
.../search/TestBooleanMinShouldMatch.java | 4 +-
.../org/apache/lucene/search/TestBooleanOr.java | 2 +-
.../apache/lucene/search/TestBooleanQuery.java | 4 +-
.../search/TestBooleanQueryVisitSubscorers.java | 4 +-
.../lucene/search/TestBooleanRewrites.java | 4 +-
.../apache/lucene/search/TestBooleanScorer.java | 4 +-
.../apache/lucene/search/TestBoostQuery.java | 4 +-
.../lucene/search/TestCachingCollector.java | 4 +-
.../lucene/search/TestComplexExplanations.java | 4 +-
.../TestComplexExplanationsOfNonMatches.java | 4 +-
.../lucene/search/TestConjunctionDISI.java | 4 +-
.../apache/lucene/search/TestConjunctions.java | 4 +-
.../lucene/search/TestConstantScoreQuery.java | 4 +-
.../TestControlledRealTimeReopenThread.java | 4 +-
.../lucene/search/TestCustomSearcherSort.java | 14 +-
.../org/apache/lucene/search/TestDateSort.java | 4 +-
.../lucene/search/TestDisjunctionMaxQuery.java | 4 +-
.../org/apache/lucene/search/TestDocBoost.java | 4 +-
.../search/TestDocValuesRewriteMethod.java | 4 +-
.../lucene/search/TestDocValuesScoring.java | 4 +-
.../lucene/search/TestEarlyTermination.java | 4 +-
.../lucene/search/TestElevationComparator.java | 4 +-
.../search/TestFieldCacheRewriteMethod.java | 4 +-
.../lucene/search/TestFieldValueQuery.java | 4 +-
.../apache/lucene/search/TestFuzzyQuery.java | 4 +-
.../apache/lucene/search/TestIndexSearcher.java | 4 +-
.../apache/lucene/search/TestLRUQueryCache.java | 4 +-
.../lucene/search/TestLiveFieldValues.java | 4 +-
.../lucene/search/TestMinShouldMatch2.java | 4 +-
.../lucene/search/TestMultiCollector.java | 4 +-
.../lucene/search/TestMultiPhraseEnum.java | 4 +-
.../lucene/search/TestMultiPhraseQuery.java | 4 +-
.../search/TestMultiTermConstantScore.java | 4 +-
.../search/TestMultiTermQueryRewrites.java | 4 +-
.../search/TestMultiThreadTermVectors.java | 4 +-
.../TestMultiValuedNumericRangeQuery.java | 4 +-
.../org/apache/lucene/search/TestMultiset.java | 4 +-
.../lucene/search/TestNGramPhraseQuery.java | 4 +-
.../apache/lucene/search/TestNeedsScores.java | 4 +-
.../test/org/apache/lucene/search/TestNot.java | 4 +-
.../lucene/search/TestNumericRangeQuery32.java | 4 +-
.../lucene/search/TestNumericRangeQuery64.java | 4 +-
.../lucene/search/TestPhrasePrefixQuery.java | 4 +-
.../apache/lucene/search/TestPhraseQuery.java | 4 +-
.../apache/lucene/search/TestPointQueries.java | 4 +-
.../lucene/search/TestPositionIncrement.java | 4 +-
.../search/TestPositiveScoresOnlyCollector.java | 4 +-
.../lucene/search/TestPrefixInBooleanQuery.java | 4 +-
.../apache/lucene/search/TestPrefixQuery.java | 4 +-
.../apache/lucene/search/TestPrefixRandom.java | 4 +-
.../lucene/search/TestQueryCachingPolicy.java | 4 +-
.../apache/lucene/search/TestQueryRescorer.java | 4 +-
.../apache/lucene/search/TestRegexpQuery.java | 4 +-
.../apache/lucene/search/TestRegexpRandom.java | 4 +-
.../apache/lucene/search/TestRegexpRandom2.java | 4 +-
.../lucene/search/TestReqExclBulkScorer.java | 4 +-
.../search/TestSameScoresWithThreads.java | 4 +-
.../search/TestScoreCachingWrappingScorer.java | 4 +-
.../apache/lucene/search/TestScorerPerf.java | 32 +--
.../apache/lucene/search/TestSearchAfter.java | 4 +-
.../lucene/search/TestSearchWithThreads.java | 4 +-
.../lucene/search/TestSearcherManager.java | 4 +-
.../lucene/search/TestShardSearching.java | 4 +-
.../apache/lucene/search/TestSimilarity.java | 4 +-
.../lucene/search/TestSimilarityProvider.java | 4 +-
.../lucene/search/TestSimpleExplanations.java | 4 +-
.../TestSimpleExplanationsOfNonMatches.java | 4 +-
.../search/TestSimpleSearchEquivalence.java | 14 +-
.../lucene/search/TestSloppyPhraseQuery.java | 4 +-
.../lucene/search/TestSloppyPhraseQuery2.java | 4 +-
.../test/org/apache/lucene/search/TestSort.java | 4 +-
.../apache/lucene/search/TestSortRandom.java | 4 +-
.../apache/lucene/search/TestSortRescorer.java | 4 +-
.../search/TestSortedNumericSortField.java | 4 +-
.../lucene/search/TestSortedSetSelector.java | 4 +-
.../lucene/search/TestSortedSetSortField.java | 4 +-
.../lucene/search/TestSubScorerFreqs.java | 4 +-
.../apache/lucene/search/TestSynonymQuery.java | 4 +-
.../lucene/search/TestTermRangeQuery.java | 4 +-
.../apache/lucene/search/TestTermScorer.java | 4 +-
.../search/TestTimeLimitingCollector.java | 4 +-
.../lucene/search/TestTopDocsCollector.java | 4 +-
.../apache/lucene/search/TestTopDocsMerge.java | 4 +-
.../lucene/search/TestTopFieldCollector.java | 4 +-
.../search/TestTotalHitCountCollector.java | 4 +-
.../TestUsageTrackingFilterCachingPolicy.java | 4 +-
.../org/apache/lucene/search/TestWildcard.java | 4 +-
.../lucene/search/TestWildcardRandom.java | 4 +-
.../search/similarities/TestBM25Similarity.java | 4 +-
.../similarities/TestClassicSimilarity.java | 4 +-
.../search/similarities/TestSimilarity2.java | 4 +-
.../search/similarities/TestSimilarityBase.java | 4 +-
.../search/spans/JustCompileSearchSpans.java | 4 +-
.../apache/lucene/search/spans/TestBasics.java | 4 +-
.../search/spans/TestFieldMaskingSpanQuery.java | 4 +-
.../lucene/search/spans/TestFilterSpans.java | 27 ++-
.../search/spans/TestNearSpansOrdered.java | 4 +-
.../lucene/search/spans/TestSpanBoostQuery.java | 10 +-
.../lucene/search/spans/TestSpanCollection.java | 4 +-
.../search/spans/TestSpanContainQuery.java | 4 +-
.../search/spans/TestSpanExplanations.java | 4 +-
.../spans/TestSpanExplanationsOfNonMatches.java | 4 +-
.../lucene/search/spans/TestSpanFirstQuery.java | 4 +-
.../spans/TestSpanMultiTermQueryWrapper.java | 4 +-
.../lucene/search/spans/TestSpanNearQuery.java | 4 +-
.../lucene/search/spans/TestSpanNotQuery.java | 4 +-
.../lucene/search/spans/TestSpanOrQuery.java | 4 +-
.../search/spans/TestSpanSearchEquivalence.java | 4 +-
.../lucene/search/spans/TestSpanTermQuery.java | 4 +-
.../apache/lucene/search/spans/TestSpans.java | 4 +-
.../lucene/search/spans/TestSpansEnum.java | 4 +-
.../lucene/store/TestBufferedChecksum.java | 4 +-
.../lucene/store/TestBufferedIndexInput.java | 4 +-
.../lucene/store/TestByteArrayDataInput.java | 4 +-
.../org/apache/lucene/store/TestDirectory.java | 4 +-
.../lucene/store/TestFileSwitchDirectory.java | 4 +-
.../lucene/store/TestFilterDirectory.java | 4 +-
.../apache/lucene/store/TestHugeRamFile.java | 4 +-
.../apache/lucene/store/TestLockFactory.java | 4 +-
.../apache/lucene/store/TestMmapDirectory.java | 4 +-
.../org/apache/lucene/store/TestMultiMMap.java | 4 +-
.../apache/lucene/store/TestNIOFSDirectory.java | 4 +-
.../lucene/store/TestNRTCachingDirectory.java | 4 +-
.../lucene/store/TestNativeFSLockFactory.java | 4 +-
.../apache/lucene/store/TestRAMDirectory.java | 4 +-
.../apache/lucene/store/TestRateLimiter.java | 4 +-
.../lucene/store/TestSimpleFSDirectory.java | 4 +-
.../lucene/store/TestSimpleFSLockFactory.java | 4 +-
.../store/TestSingleInstanceLockFactory.java | 4 +-
.../lucene/store/TestSleepingLockWrapper.java | 4 +-
.../store/TestTrackingDirectoryWrapper.java | 4 +-
.../apache/lucene/store/TestWindowsMMap.java | 4 +-
.../apache/lucene/util/BaseSortTestCase.java | 4 +-
.../lucene/util/StressRamUsageEstimator.java | 4 +-
.../apache/lucene/util/Test2BPagedBytes.java | 4 +-
.../org/apache/lucene/util/TestArrayUtil.java | 4 +-
.../apache/lucene/util/TestAttributeSource.java | 4 +-
.../apache/lucene/util/TestByteBlockPool.java | 32 +--
.../org/apache/lucene/util/TestBytesRef.java | 4 +-
.../apache/lucene/util/TestBytesRefArray.java | 27 ++-
.../apache/lucene/util/TestBytesRefHash.java | 4 +-
.../org/apache/lucene/util/TestCharsRef.java | 8 +-
.../apache/lucene/util/TestCharsRefBuilder.java | 4 +-
.../lucene/util/TestCloseableThreadLocal.java | 1 -
.../apache/lucene/util/TestCollectionUtil.java | 4 +-
.../apache/lucene/util/TestDocIdSetBuilder.java | 4 +-
.../apache/lucene/util/TestFilterIterator.java | 1 -
.../lucene/util/TestFixedBitDocIdSet.java | 1 -
.../org/apache/lucene/util/TestFixedBitSet.java | 4 +-
.../util/TestFrequencyTrackingRingBuffer.java | 4 +-
.../org/apache/lucene/util/TestIOUtils.java | 4 +-
.../lucene/util/TestInPlaceMergeSorter.java | 4 +-
.../lucene/util/TestIntArrayDocIdSet.java | 4 +-
.../org/apache/lucene/util/TestIntroSorter.java | 4 +-
.../org/apache/lucene/util/TestIntsRef.java | 4 +-
.../apache/lucene/util/TestLSBRadixSorter.java | 4 +-
.../lucene/util/TestLegacyNumericUtils.java | 4 +-
.../org/apache/lucene/util/TestLongBitSet.java | 4 +-
.../org/apache/lucene/util/TestMathUtil.java | 4 +-
.../apache/lucene/util/TestMergedIterator.java | 4 +-
.../apache/lucene/util/TestNamedSPILoader.java | 12 +-
.../org/apache/lucene/util/TestNotDocIdSet.java | 4 +-
.../apache/lucene/util/TestOfflineSorter.java | 4 +-
.../org/apache/lucene/util/TestPagedBytes.java | 1 -
.../apache/lucene/util/TestPriorityQueue.java | 4 +-
.../apache/lucene/util/TestQueryBuilder.java | 4 +-
.../lucene/util/TestRamUsageEstimator.java | 4 +-
.../util/TestRecyclingByteBlockAllocator.java | 18 +-
.../util/TestRecyclingIntBlockAllocator.java | 18 +-
.../apache/lucene/util/TestRoaringDocIdSet.java | 4 +-
.../apache/lucene/util/TestRollingBuffer.java | 8 +-
.../lucene/util/TestSPIClassIterator.java | 4 +-
.../apache/lucene/util/TestSentinelIntSet.java | 6 +-
.../org/apache/lucene/util/TestSetOnce.java | 4 +-
.../org/apache/lucene/util/TestSloppyMath.java | 4 +-
.../org/apache/lucene/util/TestSmallFloat.java | 14 +-
.../lucene/util/TestSparseFixedBitDocIdSet.java | 4 +-
.../lucene/util/TestSparseFixedBitSet.java | 4 +-
.../apache/lucene/util/TestStringHelper.java | 4 +-
.../org/apache/lucene/util/TestTimSorter.java | 4 +-
.../lucene/util/TestTimSorterWorstCase.java | 4 +-
.../org/apache/lucene/util/TestUnicodeUtil.java | 4 +-
.../org/apache/lucene/util/TestVersion.java | 4 +-
.../apache/lucene/util/TestVirtualMethod.java | 4 +-
.../apache/lucene/util/TestWeakIdentityMap.java | 1 -
.../automaton/FiniteStringsIteratorTest.java | 4 +-
.../LimitedFiniteStringsIteratorTest.java | 4 +-
.../lucene/util/automaton/TestAutomaton.java | 4 +-
.../util/automaton/TestCompiledAutomaton.java | 4 +-
.../lucene/util/automaton/TestDeterminism.java | 4 +-
.../util/automaton/TestDeterminizeLexicon.java | 4 +-
.../util/automaton/TestLevenshteinAutomata.java | 4 +-
.../lucene/util/automaton/TestMinimize.java | 4 +-
.../lucene/util/automaton/TestOperations.java | 4 +-
.../lucene/util/automaton/TestRegExp.java | 4 +-
.../lucene/util/automaton/TestUTF32ToUTF8.java | 4 +-
.../org/apache/lucene/util/bkd/TestBKD.java | 4 +-
.../org/apache/lucene/util/fst/Test2BFST.java | 4 +-
.../apache/lucene/util/fst/TestBytesStore.java | 4 +-
.../org/apache/lucene/util/fst/TestFSTs.java | 4 +-
.../lucene/util/packed/TestDirectMonotonic.java | 4 +-
.../lucene/util/packed/TestDirectPacked.java | 4 +-
.../lucene/util/packed/TestPackedInts.java | 4 +-
.../java/org/apache/lucene/demo/IndexFiles.java | 4 +-
.../org/apache/lucene/demo/SearchFiles.java | 4 +-
.../demo/facet/AssociationsFacetsExample.java | 4 +-
.../demo/facet/DistanceFacetsExample.java | 4 +-
.../ExpressionAggregationFacetsExample.java | 32 +--
.../facet/MultiCategoryListsFacetsExample.java | 4 +-
.../lucene/demo/facet/RangeFacetsExample.java | 4 +-
.../lucene/demo/facet/SimpleFacetsExample.java | 4 +-
.../facet/SimpleSortedSetFacetsExample.java | 4 +-
.../demo/xmlparser/FormBasedXmlQueryDemo.java | 1 -
.../test/org/apache/lucene/demo/TestDemo.java | 4 +-
.../facet/TestAssociationsFacetsExample.java | 4 +-
.../demo/facet/TestDistanceFacetsExample.java | 4 +-
.../TestExpressionAggregationFacetsExample.java | 4 +-
.../TestMultiCategoryListsFacetsExample.java | 4 +-
.../demo/facet/TestRangeFacetsExample.java | 4 +-
.../demo/facet/TestSimpleFacetsExample.java | 4 +-
.../facet/TestSimpleSortedSetFacetsExample.java | 4 +-
.../org/apache/lucene/expressions/Bindings.java | 2 +-
.../apache/lucene/expressions/Expression.java | 2 +-
.../expressions/ExpressionComparator.java | 2 +-
.../expressions/ExpressionFunctionValues.java | 2 +-
.../lucene/expressions/ExpressionRescorer.java | 4 +-
.../lucene/expressions/ExpressionSortField.java | 2 +-
.../expressions/ExpressionValueSource.java | 2 +-
.../apache/lucene/expressions/FakeScorer.java | 4 +-
.../lucene/expressions/ScoreFunctionValues.java | 2 +-
.../lucene/expressions/ScoreValueSource.java | 4 +-
.../lucene/expressions/SimpleBindings.java | 4 +-
.../expressions/js/JavascriptCompiler.java | 2 +-
.../js/JavascriptErrorHandlingLexer.java | 4 +-
.../js/JavascriptParserErrorStrategy.java | 4 +-
.../lucene/expressions/js/VariableContext.java | 4 +-
.../lucene/expressions/TestDemoExpressions.java | 32 +--
.../expressions/TestExpressionRescorer.java | 4 +-
.../expressions/TestExpressionSortField.java | 4 +-
.../lucene/expressions/TestExpressionSorts.java | 4 +-
.../expressions/TestExpressionValidation.java | 4 +-
.../expressions/TestExpressionValueSource.java | 4 +-
.../expressions/js/TestCustomFunctions.java | 4 +-
.../expressions/js/TestJavascriptCompiler.java | 2 +-
.../expressions/js/TestJavascriptFunction.java | 2 +-
.../js/TestJavascriptOperations.java | 2 +-
.../expressions/js/TestVariableContext.java | 4 +-
.../org/apache/lucene/facet/DrillDownQuery.java | 3 +-
.../org/apache/lucene/facet/DrillSideways.java | 3 +-
.../apache/lucene/facet/DrillSidewaysQuery.java | 4 +-
.../lucene/facet/DrillSidewaysScorer.java | 3 +-
.../org/apache/lucene/facet/FacetField.java | 3 +-
.../org/apache/lucene/facet/FacetResult.java | 3 +-
.../java/org/apache/lucene/facet/Facets.java | 3 +-
.../apache/lucene/facet/FacetsCollector.java | 3 +-
.../org/apache/lucene/facet/FacetsConfig.java | 4 +-
.../org/apache/lucene/facet/LabelAndValue.java | 3 +-
.../org/apache/lucene/facet/MultiFacets.java | 3 +-
.../facet/RandomSamplingFacetsCollector.java | 3 +-
.../lucene/facet/TopOrdAndFloatQueue.java | 3 +-
.../apache/lucene/facet/TopOrdAndIntQueue.java | 3 +-
.../apache/lucene/facet/range/DoubleRange.java | 3 +-
.../facet/range/DoubleRangeFacetCounts.java | 3 +-
.../apache/lucene/facet/range/LongRange.java | 3 +-
.../lucene/facet/range/LongRangeCounter.java | 3 +-
.../facet/range/LongRangeFacetCounts.java | 3 +-
.../org/apache/lucene/facet/range/Range.java | 3 +-
.../lucene/facet/range/RangeFacetCounts.java | 3 +-
.../DefaultSortedSetDocValuesReaderState.java | 3 +-
.../SortedSetDocValuesFacetCounts.java | 3 +-
.../sortedset/SortedSetDocValuesFacetField.java | 3 +-
.../SortedSetDocValuesReaderState.java | 3 +-
.../facet/taxonomy/AssociationFacetField.java | 3 +-
.../facet/taxonomy/CachedOrdinalsReader.java | 3 +-
.../facet/taxonomy/DocValuesOrdinalsReader.java | 4 +-
.../lucene/facet/taxonomy/FacetLabel.java | 3 +-
.../lucene/facet/taxonomy/FakeScorer.java | 3 +-
.../facet/taxonomy/FastTaxonomyFacetCounts.java | 3 +-
.../taxonomy/FloatAssociationFacetField.java | 3 +-
.../facet/taxonomy/FloatTaxonomyFacets.java | 3 +-
.../taxonomy/IntAssociationFacetField.java | 3 +-
.../facet/taxonomy/IntTaxonomyFacets.java | 3 +-
.../lucene/facet/taxonomy/LRUHashMap.java | 3 +-
.../taxonomy/OrdinalMappingLeafReader.java | 3 +-
.../lucene/facet/taxonomy/OrdinalsReader.java | 3 +-
.../facet/taxonomy/ParallelTaxonomyArrays.java | 4 +-
.../facet/taxonomy/PrintTaxonomyStats.java | 3 +-
.../facet/taxonomy/SearcherTaxonomyManager.java | 3 +-
.../facet/taxonomy/TaxonomyFacetCounts.java | 3 +-
.../TaxonomyFacetSumFloatAssociations.java | 3 +-
.../TaxonomyFacetSumIntAssociations.java | 3 +-
.../taxonomy/TaxonomyFacetSumValueSource.java | 3 +-
.../lucene/facet/taxonomy/TaxonomyFacets.java | 3 +-
.../facet/taxonomy/TaxonomyMergeUtils.java | 31 ++-
.../lucene/facet/taxonomy/TaxonomyReader.java | 17 +-
.../lucene/facet/taxonomy/TaxonomyWriter.java | 15 +-
.../lucene/facet/taxonomy/directory/Consts.java | 7 +-
.../directory/DirectoryTaxonomyReader.java | 33 ++-
.../directory/DirectoryTaxonomyWriter.java | 33 ++-
.../taxonomy/directory/TaxonomyIndexArrays.java | 25 ++-
.../taxonomy/writercache/CategoryPathUtils.java | 7 +-
.../taxonomy/writercache/CharBlockArray.java | 21 +-
.../writercache/Cl2oTaxonomyWriterCache.java | 15 +-
.../taxonomy/writercache/CollisionMap.java | 13 +-
.../writercache/CompactLabelToOrdinal.java | 3 +-
.../taxonomy/writercache/LabelToOrdinal.java | 7 +-
.../writercache/LruTaxonomyWriterCache.java | 9 +-
.../writercache/NameHashIntCacheLRU.java | 7 +-
.../taxonomy/writercache/NameIntCacheLRU.java | 13 +-
.../writercache/TaxonomyWriterCache.java | 9 +-
.../facet/AssertingSubDocsAtOnceCollector.java | 3 +-
.../org/apache/lucene/facet/FacetTestCase.java | 3 +-
.../apache/lucene/facet/SlowRAMDirectory.java | 3 +-
.../apache/lucene/facet/TestDrillDownQuery.java | 3 +-
.../apache/lucene/facet/TestDrillSideways.java | 3 +-
.../apache/lucene/facet/TestFacetsConfig.java | 3 +-
.../lucene/facet/TestMultipleIndexFields.java | 3 +-
.../TestRandomSamplingFacetsCollector.java | 33 ++-
.../facet/range/TestRangeFacetCounts.java | 3 +-
.../sortedset/TestSortedSetDocValuesFacets.java | 3 +-
.../taxonomy/TestCachedOrdinalsReader.java | 3 +-
.../lucene/facet/taxonomy/TestFacetLabel.java | 21 +-
.../lucene/facet/taxonomy/TestLRUHashMap.java | 3 +-
.../taxonomy/TestOrdinalMappingLeafReader.java | 33 ++-
.../taxonomy/TestSearcherTaxonomyManager.java | 3 +-
.../facet/taxonomy/TestTaxonomyCombined.java | 33 ++-
.../taxonomy/TestTaxonomyFacetAssociations.java | 4 +-
.../facet/taxonomy/TestTaxonomyFacetCounts.java | 3 +-
.../taxonomy/TestTaxonomyFacetCounts2.java | 3 +-
.../TestTaxonomyFacetSumValueSource.java | 3 +-
.../taxonomy/directory/TestAddTaxonomy.java | 14 ++
.../TestConcurrentFacetedIndexing.java | 33 ++-
.../directory/TestDirectoryTaxonomyReader.java | 33 ++-
.../directory/TestDirectoryTaxonomyWriter.java | 32 +--
.../writercache/TestCharBlockArray.java | 30 ++-
.../writercache/TestCompactLabelToOrdinal.java | 4 +-
.../AbstractAllGroupHeadsCollector.java | 3 +-
.../grouping/AbstractAllGroupsCollector.java | 3 +-
.../AbstractDistinctValuesCollector.java | 3 +-
.../AbstractFirstPassGroupingCollector.java | 3 +-
.../grouping/AbstractGroupFacetCollector.java | 3 +-
.../AbstractSecondPassGroupingCollector.java | 3 +-
.../search/grouping/BlockGroupingCollector.java | 3 +-
.../search/grouping/CollectedSearchGroup.java | 1 -
.../lucene/search/grouping/FakeScorer.java | 3 +-
.../lucene/search/grouping/GroupDocs.java | 3 +-
.../lucene/search/grouping/GroupingSearch.java | 3 +-
.../lucene/search/grouping/SearchGroup.java | 3 +-
.../lucene/search/grouping/TopGroups.java | 3 +-
.../FunctionAllGroupHeadsCollector.java | 3 +-
.../function/FunctionAllGroupsCollector.java | 3 +-
.../FunctionDistinctValuesCollector.java | 3 +-
.../FunctionFirstPassGroupingCollector.java | 3 +-
.../FunctionSecondPassGroupingCollector.java | 3 +-
.../term/TermAllGroupHeadsCollector.java | 3 +-
.../grouping/term/TermAllGroupsCollector.java | 3 +-
.../term/TermDistinctValuesCollector.java | 3 +-
.../term/TermFirstPassGroupingCollector.java | 3 +-
.../grouping/term/TermGroupFacetCollector.java | 3 +-
.../term/TermSecondPassGroupingCollector.java | 3 +-
.../grouping/AbstractGroupingTestCase.java | 3 +-
.../grouping/AllGroupHeadsCollectorTest.java | 3 +-
.../search/grouping/AllGroupsCollectorTest.java | 5 +-
.../grouping/DistinctValuesCollectorTest.java | 3 +-
.../grouping/GroupFacetCollectorTest.java | 3 +-
.../search/grouping/GroupingSearchTest.java | 3 +-
.../lucene/search/grouping/TestGrouping.java | 1 -
.../lucene/search/highlight/DefaultEncoder.java | 22 +-
.../apache/lucene/search/highlight/Encoder.java | 17 +-
.../lucene/search/highlight/Formatter.java | 4 +-
.../lucene/search/highlight/Fragmenter.java | 3 +-
.../search/highlight/GradientFormatter.java | 3 +-
.../lucene/search/highlight/Highlighter.java | 3 +-
.../highlight/InvalidTokenOffsetsException.java | 3 +-
.../lucene/search/highlight/NullFragmenter.java | 3 +-
.../highlight/OffsetLimitTokenFilter.java | 3 +-
.../lucene/search/highlight/PositionSpan.java | 3 +-
.../lucene/search/highlight/QueryScorer.java | 3 +-
.../search/highlight/QueryTermExtractor.java | 3 +-
.../search/highlight/QueryTermScorer.java | 3 +-
.../apache/lucene/search/highlight/Scorer.java | 3 +-
.../search/highlight/SimpleFragmenter.java | 3 +-
.../search/highlight/SimpleHTMLEncoder.java | 19 +-
.../search/highlight/SimpleHTMLFormatter.java | 3 +-
.../search/highlight/SimpleSpanFragmenter.java | 6 +-
.../search/highlight/SpanGradientFormatter.java | 3 +-
.../search/highlight/TermVectorLeafReader.java | 3 +-
.../lucene/search/highlight/TextFragment.java | 4 +-
.../lucene/search/highlight/TokenGroup.java | 3 +-
.../lucene/search/highlight/TokenSources.java | 3 +-
.../highlight/TokenStreamFromTermVector.java | 3 +-
.../search/highlight/WeightedSpanTerm.java | 6 +-
.../highlight/WeightedSpanTermExtractor.java | 3 +-
.../lucene/search/highlight/WeightedTerm.java | 3 +-
.../CustomSeparatorBreakIterator.java | 9 +-
.../DefaultPassageFormatter.java | 3 +-
.../MultiTermHighlighting.java | 3 +-
.../search/postingshighlight/Passage.java | 3 +-
.../postingshighlight/PassageFormatter.java | 3 +-
.../search/postingshighlight/PassageScorer.java | 3 +-
.../postingshighlight/PostingsHighlighter.java | 3 +-
.../postingshighlight/WholeBreakIterator.java | 3 +-
.../vectorhighlight/BaseFragListBuilder.java | 3 +-
.../vectorhighlight/BaseFragmentsBuilder.java | 3 +-
.../search/vectorhighlight/BoundaryScanner.java | 3 +-
.../BreakIteratorBoundaryScanner.java | 3 +-
.../vectorhighlight/FastVectorHighlighter.java | 3 +-
.../search/vectorhighlight/FieldFragList.java | 3 +-
.../search/vectorhighlight/FieldPhraseList.java | 3 +-
.../search/vectorhighlight/FieldQuery.java | 3 +-
.../search/vectorhighlight/FieldTermStack.java | 3 +-
.../search/vectorhighlight/FragListBuilder.java | 3 +-
.../vectorhighlight/FragmentsBuilder.java | 3 +-
.../ScoreOrderFragmentsBuilder.java | 3 +-
.../vectorhighlight/SimpleBoundaryScanner.java | 3 +-
.../vectorhighlight/SimpleFieldFragList.java | 3 +-
.../vectorhighlight/SimpleFragListBuilder.java | 4 +-
.../vectorhighlight/SimpleFragmentsBuilder.java | 3 +-
.../vectorhighlight/SingleFragListBuilder.java | 3 +-
.../vectorhighlight/WeightedFieldFragList.java | 3 +-
.../WeightedFragListBuilder.java | 3 +-
.../search/highlight/HighlighterPhraseTest.java | 3 +-
.../search/highlight/HighlighterTest.java | 3 +-
.../lucene/search/highlight/MissesTest.java | 3 +-
.../highlight/OffsetLimitTokenFilterTest.java | 3 +-
.../search/highlight/TokenSourcesTest.java | 3 +-
.../custom/HighlightCustomQueryTest.java | 4 +-
.../TestCustomSeparatorBreakIterator.java | 3 +-
.../TestMultiTermHighlighting.java | 3 +-
.../TestPostingsHighlighter.java | 3 +-
.../TestPostingsHighlighterRanking.java | 3 +-
.../TestWholeBreakIterator.java | 3 +-
.../vectorhighlight/AbstractTestCase.java | 3 +-
.../BreakIteratorBoundaryScannerTest.java | 3 +-
.../FastVectorHighlighterTest.java | 2 +-
.../vectorhighlight/FieldPhraseListTest.java | 3 +-
.../search/vectorhighlight/FieldQueryTest.java | 3 +-
.../vectorhighlight/FieldTermStackTest.java | 3 +-
.../vectorhighlight/IndexTimeSynonymTest.java | 3 +-
.../ScoreOrderFragmentsBuilderTest.java | 3 +-
.../SimpleBoundaryScannerTest.java | 3 +-
.../SimpleFragListBuilderTest.java | 3 +-
.../SimpleFragmentsBuilderTest.java | 3 +-
.../SingleFragListBuilderTest.java | 11 +-
.../WeightedFragListBuilderTest.java | 3 +-
.../search/join/BaseGlobalOrdinalScorer.java | 3 +-
.../lucene/search/join/BitSetProducer.java | 3 +-
.../lucene/search/join/BlockJoinSelector.java | 3 +-
.../lucene/search/join/CheckJoinIndex.java | 3 +-
.../search/join/DocValuesTermsCollector.java | 33 ++-
.../apache/lucene/search/join/FakeScorer.java | 3 +-
.../search/join/GenericTermsCollector.java | 31 ++-
.../search/join/GlobalOrdinalsCollector.java | 3 +-
.../lucene/search/join/GlobalOrdinalsQuery.java | 3 +-
.../join/GlobalOrdinalsWithScoreCollector.java | 3 +-
.../join/GlobalOrdinalsWithScoreQuery.java | 3 +-
.../org/apache/lucene/search/join/JoinUtil.java | 17 +-
.../lucene/search/join/QueryBitSetProducer.java | 3 +-
.../apache/lucene/search/join/ScoreMode.java | 3 +-
.../lucene/search/join/TermsCollector.java | 3 +-
.../search/join/TermsIncludingScoreQuery.java | 3 +-
.../apache/lucene/search/join/TermsQuery.java | 3 +-
.../search/join/TermsWithScoreCollector.java | 9 +-
.../search/join/ToChildBlockJoinQuery.java | 3 +-
.../search/join/ToParentBlockJoinCollector.java | 3 +-
.../join/ToParentBlockJoinIndexSearcher.java | 3 +-
.../search/join/ToParentBlockJoinQuery.java | 3 +-
.../search/join/ToParentBlockJoinSortField.java | 3 +-
.../lucene/search/join/TestBlockJoin.java | 3 +-
.../search/join/TestBlockJoinSelector.java | 4 +-
.../search/join/TestBlockJoinSorting.java | 3 +-
.../search/join/TestBlockJoinValidation.java | 3 +-
.../lucene/search/join/TestCheckJoinIndex.java | 3 +-
.../apache/lucene/search/join/TestJoinUtil.java | 33 ++-
.../apache/lucene/index/memory/MemoryIndex.java | 3 +-
.../lucene/index/memory/TestMemoryIndex.java | 3 +-
.../memory/TestMemoryIndexAgainstRAMDir.java | 3 +-
.../apache/lucene/document/LazyDocument.java | 15 +-
.../apache/lucene/index/MergeReaderWrapper.java | 3 +-
.../lucene/index/MultiPassIndexSplitter.java | 3 +-
.../apache/lucene/index/PKIndexSplitter.java | 3 +-
.../java/org/apache/lucene/index/Sorter.java | 3 +-
.../apache/lucene/index/SortingLeafReader.java | 3 +-
.../apache/lucene/index/SortingMergePolicy.java | 20 +-
.../org/apache/lucene/misc/GetTermInfo.java | 3 +-
.../org/apache/lucene/misc/HighFreqTerms.java | 3 +-
.../org/apache/lucene/misc/IndexMergeTool.java | 14 +-
.../apache/lucene/misc/SweetSpotSimilarity.java | 1 -
.../java/org/apache/lucene/misc/TermStats.java | 3 +-
.../search/BlockJoinComparatorSource.java | 3 +-
.../search/DiversifiedTopDocsCollector.java | 4 +-
.../EarlyTerminatingSortingCollector.java | 3 +-
.../apache/lucene/store/NativePosixUtil.java | 3 +-
.../lucene/store/NativeUnixDirectory.java | 27 ++-
.../org/apache/lucene/store/RAFDirectory.java | 3 +-
.../apache/lucene/store/WindowsDirectory.java | 27 ++-
.../apache/lucene/uninverting/DocTermOrds.java | 1 -
.../apache/lucene/uninverting/FieldCache.java | 3 +-
.../lucene/uninverting/FieldCacheImpl.java | 3 +-
.../uninverting/FieldCacheSanityChecker.java | 13 +-
.../lucene/uninverting/UninvertingReader.java | 3 +-
.../apache/lucene/util/fst/ListOfOutputs.java | 3 +-
.../util/fst/UpToTwoPositiveIntOutputs.java | 3 +-
.../apache/lucene/index/IndexSortingTest.java | 3 +-
.../org/apache/lucene/index/SorterTestBase.java | 3 +-
.../lucene/index/SortingLeafReaderTest.java | 3 +-
.../lucene/index/TestBlockJoinSorter.java | 3 +-
.../index/TestMultiPassIndexSplitter.java | 3 +-
.../lucene/index/TestPKIndexSplitter.java | 27 ++-
.../lucene/index/TestSortingMergePolicy.java | 20 +-
.../lucene/misc/SweetSpotSimilarityTest.java | 3 -
.../apache/lucene/misc/TestHighFreqTerms.java | 3 +-
.../search/TestDiversifiedTopDocsCollector.java | 3 +-
.../TestEarlyTerminatingSortingCollector.java | 3 +-
.../apache/lucene/store/TestRAFDirectory.java | 3 +-
.../lucene/uninverting/TestDocTermOrds.java | 3 +-
.../lucene/uninverting/TestFieldCache.java | 14 +-
.../uninverting/TestFieldCacheReopen.java | 3 +-
.../TestFieldCacheSanityChecker.java | 14 +-
.../lucene/uninverting/TestFieldCacheSort.java | 3 +-
.../uninverting/TestFieldCacheSortRandom.java | 3 +-
.../uninverting/TestFieldCacheVsDocValues.java | 3 +-
.../uninverting/TestFieldCacheWithThreads.java | 3 +-
.../lucene/uninverting/TestNumericTerms32.java | 3 +-
.../lucene/uninverting/TestNumericTerms64.java | 3 +-
.../uninverting/TestUninvertingReader.java | 3 +-
.../apache/lucene/util/fst/TestFSTsMisc.java | 3 +-
.../apache/lucene/queries/BoostingQuery.java | 3 +-
.../apache/lucene/queries/CommonTermsQuery.java | 4 +-
.../lucene/queries/CustomScoreProvider.java | 3 +-
.../apache/lucene/queries/CustomScoreQuery.java | 3 +-
.../org/apache/lucene/queries/TermsQuery.java | 3 +-
.../lucene/queries/function/BoostedQuery.java | 3 +-
.../lucene/queries/function/FunctionQuery.java | 3 +-
.../queries/function/FunctionRangeQuery.java | 3 +-
.../lucene/queries/function/FunctionValues.java | 3 +-
.../lucene/queries/function/ValueSource.java | 3 +-
.../queries/function/ValueSourceScorer.java | 3 +-
.../function/docvalues/BoolDocValues.java | 3 +-
.../docvalues/DocTermsIndexDocValues.java | 1 -
.../function/docvalues/DoubleDocValues.java | 3 +-
.../function/docvalues/FloatDocValues.java | 3 +-
.../function/docvalues/IntDocValues.java | 3 +-
.../function/docvalues/LongDocValues.java | 3 +-
.../function/docvalues/StrDocValues.java | 3 +-
.../function/valuesource/BoolFunction.java | 1 -
.../valuesource/BytesRefFieldSource.java | 3 +-
.../function/valuesource/ConstNumberSource.java | 1 -
.../function/valuesource/ConstValueSource.java | 1 -
.../function/valuesource/DefFunction.java | 3 +-
.../function/valuesource/DivFloatFunction.java | 1 -
.../valuesource/DocFreqValueSource.java | 1 -
.../valuesource/DoubleConstValueSource.java | 1 -
.../function/valuesource/DoubleFieldSource.java | 1 -
.../function/valuesource/DualFloatFunction.java | 1 -
.../function/valuesource/EnumFieldSource.java | 3 +-
.../function/valuesource/FieldCacheSource.java | 1 -
.../function/valuesource/FloatFieldSource.java | 1 -
.../function/valuesource/IDFValueSource.java | 1 -
.../function/valuesource/IfFunction.java | 1 -
.../function/valuesource/IntFieldSource.java | 1 -
.../valuesource/JoinDocFreqValueSource.java | 1 -
.../valuesource/LinearFloatFunction.java | 1 -
.../valuesource/LiteralValueSource.java | 3 +-
.../function/valuesource/LongFieldSource.java | 1 -
.../function/valuesource/MaxFloatFunction.java | 1 -
.../function/valuesource/MinFloatFunction.java | 1 -
.../function/valuesource/MultiBoolFunction.java | 1 -
.../valuesource/MultiFloatFunction.java | 3 +-
.../function/valuesource/MultiFunction.java | 3 +-
.../function/valuesource/MultiValueSource.java | 3 +-
.../function/valuesource/NormValueSource.java | 1 -
.../function/valuesource/PowFloatFunction.java | 1 -
.../valuesource/ProductFloatFunction.java | 1 -
.../function/valuesource/QueryValueSource.java | 1 -
.../valuesource/RangeMapFloatFunction.java | 1 -
.../valuesource/ReciprocalFloatFunction.java | 1 -
.../valuesource/ScaleFloatFunction.java | 1 -
.../valuesource/SimpleBoolFunction.java | 1 -
.../valuesource/SimpleFloatFunction.java | 1 -
.../function/valuesource/SingleFunction.java | 1 -
.../valuesource/SortedSetFieldSource.java | 3 +-
.../function/valuesource/SumFloatFunction.java | 1 -
.../SumTotalTermFreqValueSource.java | 1 -
.../function/valuesource/TFValueSource.java | 3 +-
.../valuesource/TermFreqValueSource.java | 1 -
.../valuesource/TotalTermFreqValueSource.java | 1 -
.../function/valuesource/VectorValueSource.java | 3 +-
.../apache/lucene/queries/mlt/MoreLikeThis.java | 14 +-
.../lucene/queries/mlt/MoreLikeThisQuery.java | 6 +-
.../payloads/AveragePayloadFunction.java | 4 +-
.../queries/payloads/MaxPayloadFunction.java | 4 +-
.../queries/payloads/MinPayloadFunction.java | 3 +-
.../queries/payloads/PayloadFunction.java | 3 +-
.../queries/payloads/PayloadScoreQuery.java | 3 +-
.../queries/payloads/SpanPayloadCheckQuery.java | 3 +-
.../lucene/queries/BoostingQueryTest.java | 3 +-
.../lucene/queries/CommonTermsQueryTest.java | 3 +-
.../apache/lucene/queries/TermsQueryTest.java | 3 +-
.../queries/TestCustomScoreExplanations.java | 3 +-
.../lucene/queries/TestCustomScoreQuery.java | 3 +-
.../queries/function/FunctionTestSetup.java | 32 +--
.../queries/function/TestBoostedQuery.java | 33 ++-
.../function/TestDocValuesFieldSources.java | 3 +-
.../queries/function/TestFieldScoreQuery.java | 3 +-
.../function/TestFunctionQueryExplanations.java | 3 +-
.../queries/function/TestFunctionQuerySort.java | 3 +-
.../function/TestFunctionRangeQuery.java | 3 +-
.../function/TestLongNormValueSource.java | 3 +-
.../function/TestSortedSetFieldSource.java | 3 +-
.../queries/function/TestValueSources.java | 3 +-
.../lucene/queries/mlt/TestMoreLikeThis.java | 3 +-
.../lucene/queries/payloads/PayloadHelper.java | 3 +-
.../queries/payloads/TestPayloadCheckQuery.java | 3 +-
.../payloads/TestPayloadExplanations.java | 3 +-
.../queries/payloads/TestPayloadScoreQuery.java | 3 +-
.../queries/payloads/TestPayloadSpans.java | 14 +-
.../queries/payloads/TestPayloadTermQuery.java | 3 +-
.../analyzing/AnalyzingQueryParser.java | 3 +-
.../queryparser/classic/FastCharStream.java | 5 +-
.../classic/MultiFieldQueryParser.java | 3 +-
.../queryparser/classic/QueryParserBase.java | 1 -
.../complexPhrase/ComplexPhraseQueryParser.java | 3 +-
.../queryparser/ext/ExtendableQueryParser.java | 3 +-
.../lucene/queryparser/ext/ExtensionQuery.java | 7 +-
.../lucene/queryparser/ext/Extensions.java | 4 +-
.../lucene/queryparser/ext/ParserExtension.java | 3 +-
.../flexible/core/QueryNodeError.java | 3 +-
.../flexible/core/QueryNodeException.java | 3 +-
.../flexible/core/QueryNodeParseException.java | 3 +-
.../flexible/core/QueryParserHelper.java | 16 +-
.../flexible/core/builders/QueryBuilder.java | 8 +-
.../core/builders/QueryTreeBuilder.java | 3 +-
.../core/config/AbstractQueryConfig.java | 3 +-
.../flexible/core/config/ConfigurationKey.java | 3 +-
.../flexible/core/config/FieldConfig.java | 3 +-
.../core/config/FieldConfigListener.java | 3 +-
.../core/config/QueryConfigHandler.java | 3 +-
.../core/messages/QueryParserMessages.java | 3 +-
.../flexible/core/nodes/AndQueryNode.java | 3 +-
.../flexible/core/nodes/AnyQueryNode.java | 3 +-
.../flexible/core/nodes/BooleanQueryNode.java | 3 +-
.../flexible/core/nodes/BoostQueryNode.java | 3 +-
.../flexible/core/nodes/DeletedQueryNode.java | 7 +-
.../flexible/core/nodes/FieldQueryNode.java | 3 +-
.../core/nodes/FieldValuePairQueryNode.java | 3 +-
.../flexible/core/nodes/FieldableNode.java | 3 +-
.../flexible/core/nodes/FuzzyQueryNode.java | 3 +-
.../flexible/core/nodes/GroupQueryNode.java | 3 +-
.../core/nodes/MatchAllDocsQueryNode.java | 3 +-
.../core/nodes/MatchNoDocsQueryNode.java | 3 +-
.../flexible/core/nodes/ModifierQueryNode.java | 3 +-
.../core/nodes/NoTokenFoundQueryNode.java | 3 +-
.../flexible/core/nodes/OpaqueQueryNode.java | 3 +-
.../flexible/core/nodes/OrQueryNode.java | 3 +-
.../flexible/core/nodes/PathQueryNode.java | 3 +-
.../core/nodes/PhraseSlopQueryNode.java | 3 +-
.../flexible/core/nodes/ProximityQueryNode.java | 3 +-
.../flexible/core/nodes/QueryNode.java | 3 +-
.../flexible/core/nodes/QueryNodeImpl.java | 3 +-
.../core/nodes/QuotedFieldQueryNode.java | 3 +-
.../flexible/core/nodes/RangeQueryNode.java | 7 +-
.../flexible/core/nodes/SlopQueryNode.java | 3 +-
.../flexible/core/nodes/TextableQueryNode.java | 27 ++-
.../core/nodes/TokenizedPhraseQueryNode.java | 3 +-
.../flexible/core/nodes/ValueQueryNode.java | 27 ++-
.../flexible/core/parser/EscapeQuerySyntax.java | 3 +-
.../flexible/core/parser/SyntaxParser.java | 3 +-
.../NoChildOptimizationQueryNodeProcessor.java | 3 +-
.../core/processors/QueryNodeProcessor.java | 3 +-
.../core/processors/QueryNodeProcessorImpl.java | 3 +-
.../processors/QueryNodeProcessorPipeline.java | 3 +-
.../RemoveDeletedQueryNodesProcessor.java | 3 +-
.../flexible/core/util/QueryNodeOperation.java | 3 +-
.../flexible/core/util/StringUtils.java | 3 +-
.../core/util/UnescapedCharSequence.java | 7 +-
.../queryparser/flexible/messages/Message.java | 3 +-
.../flexible/messages/MessageImpl.java | 3 +-
.../queryparser/flexible/messages/NLS.java | 3 +-
.../flexible/messages/NLSException.java | 3 +-
.../precedence/PrecedenceQueryParser.java | 3 +-
.../BooleanModifiersQueryNodeProcessor.java | 3 +-
.../PrecedenceQueryNodeProcessorPipeline.java | 3 +-
.../CommonQueryParserConfiguration.java | 23 +--
.../flexible/standard/QueryParserUtil.java | 3 +-
.../flexible/standard/StandardQueryParser.java | 3 +-
.../standard/builders/AnyQueryNodeBuilder.java | 3 +-
.../builders/BooleanQueryNodeBuilder.java | 3 +-
.../builders/BoostQueryNodeBuilder.java | 3 +-
.../builders/DummyQueryNodeBuilder.java | 3 +-
.../builders/FieldQueryNodeBuilder.java | 3 +-
.../builders/FuzzyQueryNodeBuilder.java | 3 +-
.../builders/GroupQueryNodeBuilder.java | 3 +-
.../builders/MatchAllDocsQueryNodeBuilder.java | 3 +-
.../builders/MatchNoDocsQueryNodeBuilder.java | 3 +-
.../builders/ModifierQueryNodeBuilder.java | 3 +-
.../builders/MultiPhraseQueryNodeBuilder.java | 3 +-
.../builders/NumericRangeQueryNodeBuilder.java | 3 +-
.../builders/PhraseQueryNodeBuilder.java | 3 +-
.../PrefixWildcardQueryNodeBuilder.java | 3 +-
.../builders/RegexpQueryNodeBuilder.java | 3 +-
.../standard/builders/SlopQueryNodeBuilder.java | 3 +-
.../StandardBooleanQueryNodeBuilder.java | 3 +-
.../standard/builders/StandardQueryBuilder.java | 3 +-
.../builders/StandardQueryTreeBuilder.java | 3 +-
.../builders/TermRangeQueryNodeBuilder.java | 3 +-
.../builders/WildcardQueryNodeBuilder.java | 3 +-
.../config/FieldBoostMapFCListener.java | 3 +-
.../config/FieldDateResolutionFCListener.java | 3 +-
.../flexible/standard/config/FuzzyConfig.java | 3 +-
.../standard/config/NumberDateFormat.java | 3 +-
.../flexible/standard/config/NumericConfig.java | 3 +-
.../config/NumericFieldConfigListener.java | 3 +-
.../config/StandardQueryConfigHandler.java | 3 +-
.../standard/nodes/AbstractRangeQueryNode.java | 3 +-
.../standard/nodes/BooleanModifierNode.java | 3 +-
.../standard/nodes/MultiPhraseQueryNode.java | 3 +-
.../standard/nodes/NumericQueryNode.java | 3 +-
.../standard/nodes/NumericRangeQueryNode.java | 27 ++-
.../standard/nodes/PrefixWildcardQueryNode.java | 7 +-
.../standard/nodes/RegexpQueryNode.java | 3 +-
.../nodes/StandardBooleanQueryNode.java | 3 +-
.../standard/nodes/TermRangeQueryNode.java | 3 +-
.../standard/nodes/WildcardQueryNode.java | 3 +-
.../standard/parser/EscapeQuerySyntaxImpl.java | 3 +-
.../standard/parser/FastCharStream.java | 5 +-
.../AllowLeadingWildcardProcessor.java | 3 +-
.../processors/AnalyzerQueryNodeProcessor.java | 3 +-
.../BooleanQuery2ModifierNodeProcessor.java | 3 +-
...ngleChildOptimizationQueryNodeProcessor.java | 3 +-
.../processors/BoostQueryNodeProcessor.java | 3 +-
.../DefaultPhraseSlopQueryNodeProcessor.java | 3 +-
.../processors/FuzzyQueryNodeProcessor.java | 3 +-
...owercaseExpandedTermsQueryNodeProcessor.java | 3 +-
.../MatchAllDocsQueryNodeProcessor.java | 3 +-
.../MultiFieldQueryNodeProcessor.java | 3 +-
.../MultiTermRewriteMethodProcessor.java | 3 +-
.../processors/NumericQueryNodeProcessor.java | 3 +-
.../NumericRangeQueryNodeProcessor.java | 3 +-
.../processors/OpenRangeQueryNodeProcessor.java | 3 +-
.../PhraseSlopQueryNodeProcessor.java | 3 +-
.../RemoveEmptyNonLeafQueryNodeProcessor.java | 3 +-
.../StandardQueryNodeProcessorPipeline.java | 3 +-
.../processors/TermRangeQueryNodeProcessor.java | 3 +-
.../processors/WildcardQueryNodeProcessor.java | 3 +-
.../queryparser/simple/SimpleQueryParser.java | 3 +-
.../surround/parser/FastCharStream.java | 3 +-
.../queryparser/surround/query/AndQuery.java | 4 +-
.../surround/query/BasicQueryFactory.java | 3 +-
.../surround/query/ComposedQuery.java | 3 +-
.../surround/query/DistanceQuery.java | 3 +-
.../surround/query/DistanceRewriteQuery.java | 3 +-
.../surround/query/DistanceSubQuery.java | 3 +-
.../queryparser/surround/query/FieldsQuery.java | 3 +-
.../queryparser/surround/query/NotQuery.java | 3 +-
.../queryparser/surround/query/OrQuery.java | 3 +-
.../surround/query/RewriteQuery.java | 2 +-
.../queryparser/surround/query/SimpleTerm.java | 3 +-
.../surround/query/SimpleTermRewriteQuery.java | 2 +-
.../surround/query/SpanNearClauseFactory.java | 3 +-
.../surround/query/SrndBooleanQuery.java | 3 +-
.../surround/query/SrndPrefixQuery.java | 3 +-
.../queryparser/surround/query/SrndQuery.java | 3 +-
.../surround/query/SrndTermQuery.java | 3 +-
.../surround/query/SrndTruncQuery.java | 3 +-
.../surround/query/TooManyBasicQueries.java | 3 +-
.../lucene/queryparser/xml/CoreParser.java | 27 ++-
.../xml/CorePlusExtensionsParser.java | 11 +-
.../queryparser/xml/CorePlusQueriesParser.java | 13 +-
.../apache/lucene/queryparser/xml/DOMUtils.java | 19 +-
.../lucene/queryparser/xml/ParserException.java | 5 +-
.../lucene/queryparser/xml/QueryBuilder.java | 8 +-
.../queryparser/xml/QueryBuilderFactory.java | 15 +-
.../queryparser/xml/QueryTemplateManager.java | 33 ++-
.../xml/builders/BooleanQueryBuilder.java | 27 ++-
.../xml/builders/BoostingQueryBuilder.java | 17 +-
.../xml/builders/BoostingTermBuilder.java | 23 +--
.../xml/builders/ConstantScoreQueryBuilder.java | 19 +-
.../builders/DisjunctionMaxQueryBuilder.java | 3 +-
.../xml/builders/FuzzyLikeThisQueryBuilder.java | 25 ++-
.../LegacyNumericRangeQueryBuilder.java | 3 +-
.../xml/builders/LikeThisQueryBuilder.java | 31 ++-
.../xml/builders/MatchAllDocsQueryBuilder.java | 13 +-
.../xml/builders/RangeQueryBuilder.java | 6 +-
.../xml/builders/SpanBuilderBase.java | 11 +-
.../xml/builders/SpanFirstBuilder.java | 15 +-
.../xml/builders/SpanNearBuilder.java | 23 +--
.../xml/builders/SpanNotBuilder.java | 15 +-
.../queryparser/xml/builders/SpanOrBuilder.java | 23 +--
.../xml/builders/SpanOrTermsBuilder.java | 33 ++-
.../xml/builders/SpanQueryBuilder.java | 3 +-
.../xml/builders/SpanQueryBuilderFactory.java | 17 +-
.../xml/builders/SpanTermBuilder.java | 17 +-
.../xml/builders/TermQueryBuilder.java | 19 +-
.../xml/builders/TermsQueryBuilder.java | 33 ++-
.../xml/builders/UserInputQueryBuilder.java | 23 +--
.../analyzing/TestAnalyzingQueryParser.java | 3 +-
.../queryparser/classic/TestMultiAnalyzer.java | 3 +-
.../classic/TestMultiFieldQueryParser.java | 3 +-
.../classic/TestMultiPhraseQueryParsing.java | 3 +-
.../queryparser/classic/TestQueryParser.java | 3 +-
.../complexPhrase/TestComplexPhraseQuery.java | 3 +-
.../lucene/queryparser/ext/ExtensionStub.java | 13 +-
.../ext/TestExtendableQueryParser.java | 3 +-
.../lucene/queryparser/ext/TestExtensions.java | 3 +-
.../core/builders/TestQueryTreeBuilder.java | 3 +-
.../flexible/core/nodes/TestQueryNode.java | 3 +-
.../flexible/messages/MessagesTestBundle.java | 27 ++-
.../queryparser/flexible/messages/TestNLS.java | 3 +-
.../precedence/TestPrecedenceQueryParser.java | 3 +-
.../flexible/spans/SpanOrQueryNodeBuilder.java | 3 +-
.../spans/SpanTermQueryNodeBuilder.java | 3 +-
.../flexible/spans/SpansQueryConfigHandler.java | 3 +-
.../flexible/spans/SpansQueryTreeBuilder.java | 3 +-
.../spans/SpansValidatorQueryNodeProcessor.java | 3 +-
.../flexible/spans/TestSpanQueryParser.java | 3 +-
.../spans/TestSpanQueryParserSimpleSample.java | 3 +-
.../flexible/spans/UniqueFieldAttribute.java | 3 +-
.../spans/UniqueFieldAttributeImpl.java | 3 +-
.../spans/UniqueFieldQueryNodeProcessor.java | 3 +-
.../standard/TestMultiAnalyzerQPHelper.java | 3 +-
.../standard/TestMultiFieldQPHelper.java | 3 +-
.../standard/TestNumericQueryParser.java | 3 +-
.../flexible/standard/TestQPHelper.java | 3 +-
.../flexible/standard/TestStandardQP.java | 3 +-
.../simple/TestSimpleQueryParser.java | 3 +-
.../surround/query/BooleanQueryTst.java | 3 +-
.../surround/query/ExceptionQueryTst.java | 3 +-
.../surround/query/SingleFieldTestDb.java | 3 +-
.../surround/query/SrndQueryTest.java | 3 +-
.../surround/query/Test01Exceptions.java | 3 +-
.../surround/query/Test02Boolean.java | 3 +-
.../surround/query/Test03Distance.java | 3 +-
.../queryparser/util/QueryParserTestBase.java | 3 +-
.../lucene/queryparser/xml/TestCoreParser.java | 9 +-
.../xml/TestCorePlusExtensionsParser.java | 9 +-
.../xml/TestCorePlusQueriesParser.java | 9 +-
.../xml/TestQueryTemplateManager.java | 3 +-
.../builders/TestNumericRangeQueryBuilder.java | 3 +-
.../IndexAndTaxonomyReplicationHandler.java | 3 +-
.../replicator/IndexAndTaxonomyRevision.java | 3 +-
.../replicator/IndexInputInputStream.java | 3 +-
.../replicator/IndexReplicationHandler.java | 3 +-
.../apache/lucene/replicator/IndexRevision.java | 3 +-
.../lucene/replicator/LocalReplicator.java | 3 +-
.../replicator/PerSessionDirectoryFactory.java | 3 +-
.../lucene/replicator/ReplicationClient.java | 3 +-
.../apache/lucene/replicator/Replicator.java | 3 +-
.../org/apache/lucene/replicator/Revision.java | 3 +-
.../apache/lucene/replicator/RevisionFile.java | 3 +-
.../replicator/SessionExpiredException.java | 3 +-
.../apache/lucene/replicator/SessionToken.java | 3 +-
.../lucene/replicator/http/HttpClientBase.java | 3 +-
.../lucene/replicator/http/HttpReplicator.java | 3 +-
.../replicator/http/ReplicationService.java | 3 +-
.../IndexAndTaxonomyReplicationClientTest.java | 3 +-
.../IndexAndTaxonomyRevisionTest.java | 3 +-
.../replicator/IndexReplicationClientTest.java | 3 +-
.../lucene/replicator/IndexRevisionTest.java | 3 +-
.../lucene/replicator/LocalReplicatorTest.java | 3 +-
.../lucene/replicator/ReplicatorTestCase.java | 3 +-
.../lucene/replicator/SessionTokenTest.java | 3 +-
.../replicator/http/HttpReplicatorTest.java | 3 +-
.../replicator/http/ReplicationServlet.java | 3 +-
.../idversion/IDVersionPostingsFormat.java | 3 +-
.../idversion/IDVersionPostingsReader.java | 3 +-
.../idversion/IDVersionPostingsWriter.java | 3 +-
.../idversion/IDVersionSegmentTermsEnum.java | 3 +-
.../IDVersionSegmentTermsEnumFrame.java | 3 +-
.../codecs/idversion/IDVersionTermState.java | 3 +-
.../lucene/codecs/idversion/SingleDocsEnum.java | 3 +-
.../codecs/idversion/SinglePostingsEnum.java | 3 +-
.../idversion/VersionBlockTreeTermsReader.java | 3 +-
.../idversion/VersionBlockTreeTermsWriter.java | 3 +-
.../codecs/idversion/VersionFieldReader.java | 3 +-
.../apache/lucene/document/GeoPointField.java | 3 +-
.../org/apache/lucene/document/LatLonPoint.java | 3 +-
.../lucene/payloads/PayloadSpanCollector.java | 3 +-
.../apache/lucene/payloads/PayloadSpanUtil.java | 3 +-
.../sandbox/queries/FuzzyLikeThisQuery.java | 3 +-
.../lucene/sandbox/queries/SlowFuzzyQuery.java | 3 +-
.../sandbox/queries/SlowFuzzyTermsEnum.java | 3 +-
.../lucene/search/DocValuesNumbersQuery.java | 3 +-
.../lucene/search/DocValuesRangeQuery.java | 3 +-
.../lucene/search/DocValuesTermsQuery.java | 3 +-
.../apache/lucene/search/GeoBoundingBox.java | 3 +-
.../lucene/search/GeoPointDistanceQuery.java | 3 +-
.../search/GeoPointDistanceQueryImpl.java | 3 +-
.../search/GeoPointDistanceRangeQuery.java | 3 +-
.../lucene/search/GeoPointInBBoxQuery.java | 3 +-
.../lucene/search/GeoPointInBBoxQueryImpl.java | 3 +-
.../lucene/search/GeoPointInPolygonQuery.java | 3 +-
.../apache/lucene/search/GeoPointTermQuery.java | 3 +-
.../GeoPointTermQueryConstantScoreWrapper.java | 3 +-
.../apache/lucene/search/GeoPointTermsEnum.java | 3 +-
.../lucene/search/PointInPolygonQuery.java | 3 +-
.../apache/lucene/search/PointInRectQuery.java | 3 +-
.../lucene/search/TermAutomatonQuery.java | 3 +-
.../lucene/search/TermAutomatonScorer.java | 3 +-
.../search/TokenStreamToTermAutomatonQuery.java | 3 +-
.../apache/lucene/util/GeoDistanceUtils.java | 3 +-
.../org/apache/lucene/util/GeoHashUtils.java | 3 +-
.../apache/lucene/util/GeoProjectionUtils.java | 3 +-
.../java/org/apache/lucene/util/GeoRect.java | 3 +-
.../apache/lucene/util/GeoRelationUtils.java | 7 +-
.../java/org/apache/lucene/util/GeoUtils.java | 6 +-
.../codecs/idversion/StringAndPayloadField.java | 3 +-
.../idversion/TestIDVersionPostingsFormat.java | 3 +-
.../lucene/payloads/TestPayloadSpanUtil.java | 3 +-
.../sandbox/queries/FuzzyLikeThisQueryTest.java | 3 +-
.../sandbox/queries/TestSlowFuzzyQuery.java | 3 +-
.../sandbox/queries/TestSlowFuzzyQuery2.java | 3 +-
.../search/TestDocValuesNumbersQuery.java | 3 +-
.../lucene/search/TestDocValuesRangeQuery.java | 3 +-
.../lucene/search/TestDocValuesTermsQuery.java | 3 +-
.../search/TestFieldCacheTermsFilter.java | 3 +-
.../apache/lucene/search/TestGeoPointQuery.java | 6 +-
.../lucene/search/TestLatLonPointQueries.java | 3 +-
.../lucene/search/TestTermAutomatonQuery.java | 3 +-
.../lucene/util/BaseGeoPointTestCase.java | 3 +-
.../org/apache/lucene/util/TestGeoUtils.java | 3 +-
.../apache/lucene/spatial/SpatialStrategy.java | 3 +-
.../spatial/bbox/BBoxSimilarityValueSource.java | 3 +-
.../lucene/spatial/bbox/BBoxStrategy.java | 3 +-
.../lucene/spatial/bbox/BBoxValueSource.java | 3 +-
.../composite/CompositeSpatialStrategy.java | 3 +-
.../spatial/composite/CompositeVerifyQuery.java | 3 +-
.../composite/IntersectsRPTVerifyQuery.java | 3 +-
.../spatial/prefix/AbstractPrefixTreeQuery.java | 3 +-
.../prefix/AbstractVisitingPrefixTreeQuery.java | 3 +-
.../prefix/BytesRefIteratorTokenStream.java | 3 +-
.../spatial/prefix/CellToBytesRefIterator.java | 3 +-
.../spatial/prefix/ContainsPrefixTreeQuery.java | 3 +-
.../spatial/prefix/HeatmapFacetCounter.java | 3 +-
.../prefix/IntersectsPrefixTreeQuery.java | 3 +-
.../prefix/NumberRangePrefixTreeStrategy.java | 3 +-
.../PointPrefixTreeFieldCacheProvider.java | 3 +-
.../spatial/prefix/PrefixTreeFacetCounter.java | 3 +-
.../spatial/prefix/PrefixTreeStrategy.java | 3 +-
.../prefix/RecursivePrefixTreeStrategy.java | 3 +-
.../prefix/TermQueryPrefixTreeStrategy.java | 3 +-
.../spatial/prefix/WithinPrefixTreeQuery.java | 3 +-
.../apache/lucene/spatial/prefix/tree/Cell.java | 3 +-
.../spatial/prefix/tree/CellIterator.java | 3 +-
.../prefix/tree/DateRangePrefixTree.java | 3 +-
.../spatial/prefix/tree/FilterCellIterator.java | 3 +-
.../spatial/prefix/tree/GeohashPrefixTree.java | 3 +-
.../lucene/spatial/prefix/tree/LegacyCell.java | 3 +-
.../spatial/prefix/tree/LegacyPrefixTree.java | 3 +-
.../prefix/tree/NumberRangePrefixTree.java | 3 +-
.../prefix/tree/PackedQuadPrefixTree.java | 3 +-
.../spatial/prefix/tree/QuadPrefixTree.java | 3 +-
.../prefix/tree/SingletonCellIterator.java | 3 +-
.../spatial/prefix/tree/SpatialPrefixTree.java | 3 +-
.../prefix/tree/SpatialPrefixTreeFactory.java | 1 -
.../spatial/prefix/tree/TreeCellIterator.java | 3 +-
.../lucene/spatial/query/SpatialArgs.java | 3 +-
.../lucene/spatial/query/SpatialArgsParser.java | 3 +-
.../lucene/spatial/query/SpatialOperation.java | 3 +-
.../query/UnsupportedSpatialOperation.java | 3 +-
.../serialized/SerializedDVStrategy.java | 3 +-
.../lucene/spatial/spatial4j/Geo3dShape.java | 3 +-
.../spatial/util/CachingDoubleValueSource.java | 1 -
.../util/DistanceToShapeValueSource.java | 3 +-
.../spatial/util/ShapeAreaValueSource.java | 3 +-
.../lucene/spatial/util/ShapeFieldCache.java | 1 -
.../ShapeFieldCacheDistanceValueSource.java | 3 +-
.../spatial/util/ShapeFieldCacheProvider.java | 1 -
.../spatial/util/ShapePredicateValueSource.java | 3 +-
.../spatial/vector/DistanceValueSource.java | 3 +-
.../spatial/vector/PointVectorStrategy.java | 3 +-
.../lucene/spatial/DistanceStrategyTest.java | 3 +-
.../apache/lucene/spatial/PortedSolr3Test.java | 3 +-
.../lucene/spatial/QueryEqualsHashCodeTest.java | 3 +-
.../apache/lucene/spatial/SpatialArgsTest.java | 3 +-
.../apache/lucene/spatial/SpatialExample.java | 3 +-
.../lucene/spatial/SpatialMatchConcern.java | 1 -
.../apache/lucene/spatial/SpatialTestCase.java | 3 +-
.../apache/lucene/spatial/SpatialTestData.java | 3 +-
.../apache/lucene/spatial/SpatialTestQuery.java | 3 +-
.../apache/lucene/spatial/StrategyTestCase.java | 5 +-
.../lucene/spatial/TestTestFramework.java | 3 +-
.../lucene/spatial/bbox/TestBBoxStrategy.java | 3 +-
.../composite/CompositeStrategyTest.java | 3 +-
.../prefix/CellToBytesRefIterator50.java | 3 +-
.../spatial/prefix/DateNRStrategyTest.java | 3 +-
.../spatial/prefix/HeatmapFacetCounterTest.java | 3 +-
.../lucene/spatial/prefix/JtsPolygonTest.java | 3 +-
.../spatial/prefix/NumberRangeFacetsTest.java | 3 +-
.../RandomSpatialOpFuzzyPrefixTree50Test.java | 3 +-
.../RandomSpatialOpFuzzyPrefixTreeTest.java | 3 +-
.../prefix/RandomSpatialOpStrategyTestCase.java | 3 +-
.../prefix/TestRecursivePrefixTreeStrategy.java | 3 +-
.../prefix/TestTermQueryPrefixGridStrategy.java | 3 +-
.../prefix/tree/DateRangePrefixTreeTest.java | 3 +-
.../prefix/tree/SpatialPrefixTreeTest.java | 3 +-
.../spatial/query/SpatialArgsParserTest.java | 3 +-
.../serialized/SerializedStrategyTest.java | 3 +-
.../lucene/spatial/spatial4j/Geo3dRptTest.java | 3 +-
.../Geo3dShapeRectRelationTestCase.java | 3 +-
.../Geo3dShapeSphereModelRectRelationTest.java | 3 +-
.../Geo3dShapeWGS84ModelRectRelationTest.java | 3 +-
.../spatial4j/RandomizedShapeTestCase.java | 4 +-
.../spatial/spatial4j/geo3d/GeoPointTest.java | 3 +-
.../spatial/vector/TestPointVectorStrategy.java | 3 +-
.../org/apache/lucene/geo3d/ArcDistance.java | 3 +-
.../apache/lucene/geo3d/BasePlanetObject.java | 3 +-
.../org/apache/lucene/geo3d/BaseXYZSolid.java | 3 +-
.../java/org/apache/lucene/geo3d/Bounds.java | 3 +-
.../org/apache/lucene/geo3d/DistanceStyle.java | 3 +-
.../org/apache/lucene/geo3d/Geo3DPoint.java | 3 +-
.../java/org/apache/lucene/geo3d/Geo3DUtil.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoArea.java | 3 +-
.../org/apache/lucene/geo3d/GeoAreaFactory.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoBBox.java | 3 +-
.../org/apache/lucene/geo3d/GeoBBoxFactory.java | 3 +-
.../org/apache/lucene/geo3d/GeoBaseBBox.java | 3 +-
.../org/apache/lucene/geo3d/GeoBaseCircle.java | 3 +-
.../lucene/geo3d/GeoBaseDistanceShape.java | 3 +-
.../lucene/geo3d/GeoBaseMembershipShape.java | 3 +-
.../org/apache/lucene/geo3d/GeoBasePolygon.java | 3 +-
.../org/apache/lucene/geo3d/GeoBaseShape.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoCircle.java | 3 +-
.../apache/lucene/geo3d/GeoCircleFactory.java | 3 +-
.../geo3d/GeoCompositeMembershipShape.java | 3 +-
.../lucene/geo3d/GeoCompositePolygon.java | 3 +-
.../apache/lucene/geo3d/GeoConvexPolygon.java | 3 +-
.../geo3d/GeoDegenerateHorizontalLine.java | 3 +-
.../lucene/geo3d/GeoDegenerateLatitudeZone.java | 3 +-
.../geo3d/GeoDegenerateLongitudeSlice.java | 3 +-
.../apache/lucene/geo3d/GeoDegeneratePoint.java | 5 +-
.../lucene/geo3d/GeoDegenerateVerticalLine.java | 3 +-
.../org/apache/lucene/geo3d/GeoDistance.java | 3 +-
.../apache/lucene/geo3d/GeoDistanceShape.java | 3 +-
.../apache/lucene/geo3d/GeoLatitudeZone.java | 3 +-
.../apache/lucene/geo3d/GeoLongitudeSlice.java | 3 +-
.../apache/lucene/geo3d/GeoMembershipShape.java | 3 +-
.../lucene/geo3d/GeoNorthLatitudeZone.java | 3 +-
.../apache/lucene/geo3d/GeoNorthRectangle.java | 3 +-
.../apache/lucene/geo3d/GeoOutsideDistance.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoPath.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoPoint.java | 5 +-
.../org/apache/lucene/geo3d/GeoPolygon.java | 3 +-
.../apache/lucene/geo3d/GeoPolygonFactory.java | 3 +-
.../org/apache/lucene/geo3d/GeoRectangle.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoShape.java | 3 +-
.../org/apache/lucene/geo3d/GeoSizeable.java | 3 +-
.../lucene/geo3d/GeoSouthLatitudeZone.java | 3 +-
.../apache/lucene/geo3d/GeoSouthRectangle.java | 3 +-
.../apache/lucene/geo3d/GeoStandardCircle.java | 3 +-
.../geo3d/GeoWideDegenerateHorizontalLine.java | 3 +-
.../lucene/geo3d/GeoWideLongitudeSlice.java | 3 +-
.../lucene/geo3d/GeoWideNorthRectangle.java | 3 +-
.../apache/lucene/geo3d/GeoWideRectangle.java | 3 +-
.../lucene/geo3d/GeoWideSouthRectangle.java | 3 +-
.../java/org/apache/lucene/geo3d/GeoWorld.java | 3 +-
.../org/apache/lucene/geo3d/LatLonBounds.java | 3 +-
.../org/apache/lucene/geo3d/LinearDistance.java | 3 +-
.../lucene/geo3d/LinearSquaredDistance.java | 3 +-
.../org/apache/lucene/geo3d/Membership.java | 3 +-
.../org/apache/lucene/geo3d/NormalDistance.java | 3 +-
.../lucene/geo3d/NormalSquaredDistance.java | 3 +-
.../src/java/org/apache/lucene/geo3d/Plane.java | 3 +-
.../org/apache/lucene/geo3d/PlanetModel.java | 3 +-
.../lucene/geo3d/PointInGeo3DShapeQuery.java | 3 +-
.../org/apache/lucene/geo3d/SidedPlane.java | 3 +-
.../apache/lucene/geo3d/StandardXYZSolid.java | 3 +-
.../src/java/org/apache/lucene/geo3d/Tools.java | 3 +-
.../java/org/apache/lucene/geo3d/Vector.java | 3 +-
.../java/org/apache/lucene/geo3d/XYZBounds.java | 3 +-
.../java/org/apache/lucene/geo3d/XYZSolid.java | 3 +-
.../apache/lucene/geo3d/XYZSolidFactory.java | 3 +-
.../java/org/apache/lucene/geo3d/XYdZSolid.java | 3 +-
.../java/org/apache/lucene/geo3d/XdYZSolid.java | 3 +-
.../org/apache/lucene/geo3d/XdYdZSolid.java | 3 +-
.../java/org/apache/lucene/geo3d/dXYZSolid.java | 3 +-
.../org/apache/lucene/geo3d/dXYdZSolid.java | 3 +-
.../org/apache/lucene/geo3d/dXdYZSolid.java | 3 +-
.../org/apache/lucene/geo3d/dXdYdZSolid.java | 3 +-
.../org/apache/lucene/geo3d/GeoBBoxTest.java | 3 +-
.../org/apache/lucene/geo3d/GeoCircleTest.java | 3 +-
.../lucene/geo3d/GeoConvexPolygonTest.java | 3 +-
.../org/apache/lucene/geo3d/GeoModelTest.java | 3 +-
.../org/apache/lucene/geo3d/GeoPathTest.java | 3 +-
.../org/apache/lucene/geo3d/GeoPolygonTest.java | 3 +-
.../test/org/apache/lucene/geo3d/PlaneTest.java | 3 +-
.../org/apache/lucene/geo3d/TestGeo3DPoint.java | 3 +-
.../org/apache/lucene/geo3d/XYZSolidTest.java | 3 +-
.../lucene/search/spell/CombineSuggestion.java | 3 +-
.../apache/lucene/search/spell/Dictionary.java | 3 +-
.../lucene/search/spell/DirectSpellChecker.java | 3 +-
.../search/spell/HighFrequencyDictionary.java | 1 -
.../search/spell/JaroWinklerDistance.java | 3 +-
.../lucene/search/spell/LevensteinDistance.java | 3 +-
.../lucene/search/spell/LuceneDictionary.java | 3 +-
.../search/spell/LuceneLevenshteinDistance.java | 3 +-
.../lucene/search/spell/NGramDistance.java | 33 ++-
.../search/spell/PlainTextDictionary.java | 3 +-
.../lucene/search/spell/SpellChecker.java | 3 +-
.../lucene/search/spell/StringDistance.java | 3 +-
.../apache/lucene/search/spell/SuggestMode.java | 3 +-
.../apache/lucene/search/spell/SuggestWord.java | 5 +-
.../spell/SuggestWordFrequencyComparator.java | 6 +-
.../lucene/search/spell/SuggestWordQueue.java | 5 +-
.../spell/SuggestWordScoreComparator.java | 3 +-
.../search/spell/WordBreakSpellChecker.java | 3 +-
.../lucene/search/suggest/BitsProducer.java | 3 +-
.../search/suggest/BufferedInputIterator.java | 3 +-
.../search/suggest/DocumentDictionary.java | 3 +-
.../suggest/DocumentValueSourceDictionary.java | 3 +-
.../lucene/search/suggest/FileDictionary.java | 4 +-
.../lucene/search/suggest/InMemorySorter.java | 3 +-
.../lucene/search/suggest/InputIterator.java | 3 +-
.../apache/lucene/search/suggest/Lookup.java | 3 +-
.../search/suggest/SortedInputIterator.java | 3 +-
.../search/suggest/UnsortedInputIterator.java | 3 +-
.../analyzing/AnalyzingInfixSuggester.java | 3 +-
.../suggest/analyzing/AnalyzingSuggester.java | 3 +-
.../analyzing/BlendedInfixSuggester.java | 3 +-
.../search/suggest/analyzing/FSTUtil.java | 3 +-
.../suggest/analyzing/FreeTextSuggester.java | 3 +-
.../suggest/analyzing/FuzzySuggester.java | 3 +-
.../suggest/analyzing/SuggestStopFilter.java | 3 +-
.../analyzing/SuggestStopFilterFactory.java | 3 +-
.../document/Completion50PostingsFormat.java | 4 +-
.../suggest/document/CompletionAnalyzer.java | 3 +-
.../document/CompletionFieldsConsumer.java | 3 +-
.../document/CompletionFieldsProducer.java | 3 +-
.../document/CompletionPostingsFormat.java | 3 +-
.../suggest/document/CompletionQuery.java | 3 +-
.../suggest/document/CompletionScorer.java | 3 +-
.../suggest/document/CompletionTerms.java | 3 +-
.../suggest/document/CompletionTokenStream.java | 3 +-
.../suggest/document/CompletionWeight.java | 3 +-
.../document/CompletionsTermsReader.java | 3 +-
.../search/suggest/document/ContextQuery.java | 3 +-
.../suggest/document/ContextSuggestField.java | 3 +-
.../suggest/document/FuzzyCompletionQuery.java | 3 +-
.../search/suggest/document/NRTSuggester.java | 3 +-
.../suggest/document/NRTSuggesterBuilder.java | 3 +-
.../suggest/document/PrefixCompletionQuery.java | 3 +-
.../suggest/document/RegexCompletionQuery.java | 3 +-
.../search/suggest/document/SuggestField.java | 3 +-
.../suggest/document/SuggestIndexSearcher.java | 3 +-
.../document/SuggestScoreDocPriorityQueue.java | 3 +-
.../search/suggest/document/TopSuggestDocs.java | 3 +-
.../document/TopSuggestDocsCollector.java | 3 +-
.../search/suggest/fst/BytesRefSorter.java | 3 +-
.../search/suggest/fst/ExternalRefSorter.java | 3 +-
.../search/suggest/fst/FSTCompletion.java | 3 +-
.../suggest/fst/FSTCompletionBuilder.java | 3 +-
.../search/suggest/fst/FSTCompletionLookup.java | 3 +-
.../suggest/fst/WFSTCompletionLookup.java | 3 +-
.../search/suggest/jaspell/JaspellLookup.java | 3 +-
.../jaspell/JaspellTernarySearchTrie.java | 3 +-
.../search/suggest/tst/TSTAutocomplete.java | 3 +-
.../lucene/search/suggest/tst/TSTLookup.java | 3 +-
.../search/suggest/tst/TernaryTreeNode.java | 7 +-
.../search/spell/TestDirectSpellChecker.java | 3 +-
.../search/spell/TestJaroWinklerDistance.java | 3 +-
.../search/spell/TestLevenshteinDistance.java | 3 +-
.../search/spell/TestLuceneDictionary.java | 3 +-
.../lucene/search/spell/TestNGramDistance.java | 3 +-
.../search/spell/TestPlainTextDictionary.java | 3 +-
.../lucene/search/spell/TestSpellChecker.java | 3 +-
.../search/spell/TestWordBreakSpellChecker.java | 3 +-
.../apache/lucene/search/suggest/Average.java | 5 +-
.../search/suggest/DocumentDictionaryTest.java | 33 ++-
.../DocumentValueSourceDictionaryTest.java | 3 +-
.../search/suggest/FileDictionaryTest.java | 33 ++-
.../org/apache/lucene/search/suggest/Input.java | 3 +-
.../search/suggest/InputArrayIterator.java | 3 +-
.../search/suggest/LookupBenchmarkTest.java | 3 +-
.../suggest/TestHighFrequencyDictionary.java | 27 ++-
.../search/suggest/TestInputIterator.java | 27 ++-
.../analyzing/AnalyzingInfixSuggesterTest.java | 3 +-
.../analyzing/AnalyzingSuggesterTest.java | 3 +-
.../analyzing/BlendedInfixSuggesterTest.java | 3 +-
.../suggest/analyzing/FuzzySuggesterTest.java | 3 +-
.../analyzing/TestFreeTextSuggester.java | 3 +-
.../analyzing/TestSuggestStopFilter.java | 3 +-
.../analyzing/TestSuggestStopFilterFactory.java | 3 +-
.../document/CompletionTokenStreamTest.java | 3 +-
.../suggest/document/TestContextQuery.java | 3 +-
.../document/TestContextSuggestField.java | 3 +-
.../document/TestFuzzyCompletionQuery.java | 3 +-
.../document/TestPrefixCompletionQuery.java | 3 +-
.../document/TestRegexCompletionQuery.java | 3 +-
.../suggest/document/TestSuggestField.java | 3 +-
.../search/suggest/fst/BytesRefSortersTest.java | 3 +-
.../search/suggest/fst/FSTCompletionTest.java | 3 +-
.../search/suggest/fst/WFSTCompletionTest.java | 3 +-
.../analysis/BaseTokenStreamTestCase.java | 3 +-
.../analysis/CannedBinaryTokenStream.java | 3 +-
.../lucene/analysis/CannedTokenStream.java | 3 +-
.../lucene/analysis/CollationTestBase.java | 4 +-
.../lucene/analysis/CrankyTokenFilter.java | 3 +-
.../lucene/analysis/LookaheadTokenFilter.java | 3 +-
.../apache/lucene/analysis/MockAnalyzer.java | 3 +-
.../lucene/analysis/MockBytesAnalyzer.java | 3 +-
.../apache/lucene/analysis/MockCharFilter.java | 3 +-
.../analysis/MockFixedLengthPayloadFilter.java | 3 +-
.../lucene/analysis/MockGraphTokenFilter.java | 3 +-
.../analysis/MockHoleInjectingTokenFilter.java | 4 +-
.../lucene/analysis/MockPayloadAnalyzer.java | 4 +-
.../MockRandomLookaheadTokenFilter.java | 3 +-
.../lucene/analysis/MockReaderWrapper.java | 3 +-
.../apache/lucene/analysis/MockTokenFilter.java | 3 +-
.../apache/lucene/analysis/MockTokenizer.java | 3 +-
.../analysis/MockUTF16TermAttributeImpl.java | 3 +-
.../MockVariableLengthPayloadFilter.java | 3 +-
.../lucene/analysis/SimplePayloadFilter.java | 3 +-
.../lucene/analysis/TokenStreamToDot.java | 3 +-
.../lucene/analysis/ValidatingTokenFilter.java | 3 +-
.../lucene/analysis/VocabularyAssert.java | 3 +-
.../lucene/codecs/MissingOrdRemapper.java | 11 +-
.../lucene/codecs/asserting/AssertingCodec.java | 3 +-
.../asserting/AssertingDocValuesFormat.java | 3 +-
.../asserting/AssertingLiveDocsFormat.java | 3 +-
.../codecs/asserting/AssertingNormsFormat.java | 3 +-
.../codecs/asserting/AssertingPointFormat.java | 3 +-
.../asserting/AssertingPostingsFormat.java | 3 +-
.../asserting/AssertingStoredFieldsFormat.java | 3 +-
.../asserting/AssertingTermVectorsFormat.java | 3 +-
.../codecs/blockterms/LuceneFixedGap.java | 3 +-
.../blockterms/LuceneVarGapDocFreqInterval.java | 3 +-
.../blockterms/LuceneVarGapFixedInterval.java | 3 +-
.../bloom/TestBloomFilteredLucenePostings.java | 3 +-
.../codecs/cheapbastard/CheapBastardCodec.java | 3 +-
.../codecs/compressing/CompressingCodec.java | 3 +-
.../compressing/FastCompressingCodec.java | 3 +-
.../FastDecompressionCompressingCodec.java | 3 +-
.../HighCompressionCompressingCodec.java | 3 +-
.../dummy/DummyCompressingCodec.java | 3 +-
.../lucene/codecs/cranky/CrankyCodec.java | 3 +-
.../codecs/cranky/CrankyCompoundFormat.java | 3 +-
.../codecs/cranky/CrankyDocValuesFormat.java | 3 +-
.../codecs/cranky/CrankyFieldInfosFormat.java | 3 +-
.../codecs/cranky/CrankyLiveDocsFormat.java | 3 +-
.../lucene/codecs/cranky/CrankyNormsFormat.java | 3 +-
.../lucene/codecs/cranky/CrankyPointFormat.java | 3 +-
.../codecs/cranky/CrankyPostingsFormat.java | 3 +-
.../codecs/cranky/CrankySegmentInfoFormat.java | 3 +-
.../codecs/cranky/CrankyStoredFieldsFormat.java | 3 +-
.../codecs/cranky/CrankyTermVectorsFormat.java | 3 +-
.../mockrandom/MockRandomPostingsFormat.java | 3 +-
.../codecs/ramonly/RAMOnlyPostingsFormat.java | 3 +-
.../lucene/index/AlcoholicMergePolicy.java | 3 +-
.../lucene/index/AllDeletedFilterReader.java | 7 +-
.../lucene/index/AssertingDirectoryReader.java | 3 +-
.../lucene/index/AssertingLeafReader.java | 21 +-
.../index/BaseCompoundFormatTestCase.java | 3 +-
.../BaseCompressingDocValuesFormatTestCase.java | 3 +-
.../index/BaseDocValuesFormatTestCase.java | 3 +-
.../index/BaseFieldInfoFormatTestCase.java | 3 +-
.../index/BaseIndexFileFormatTestCase.java | 3 +-
.../lucene/index/BaseMergePolicyTestCase.java | 3 +-
.../lucene/index/BaseNormsFormatTestCase.java | 3 +-
.../lucene/index/BasePointFormatTestCase.java | 3 +-
.../index/BasePostingsFormatTestCase.java | 3 +-
.../index/BaseSegmentInfoFormatTestCase.java | 3 +-
.../index/BaseStoredFieldsFormatTestCase.java | 3 +-
.../index/BaseTermVectorsFormatTestCase.java | 3 +-
.../apache/lucene/index/BaseTestCheckIndex.java | 4 +-
.../java/org/apache/lucene/index/DocHelper.java | 3 +-
.../lucene/index/FieldFilterLeafReader.java | 3 +-
.../apache/lucene/index/ForceMergePolicy.java | 48 +----
.../lucene/index/IndexWriterMaxDocsChanger.java | 7 +-
.../lucene/index/MismatchedDirectoryReader.java | 3 +-
.../lucene/index/MismatchedLeafReader.java | 3 +-
.../lucene/index/MockRandomMergePolicy.java | 3 +-
.../apache/lucene/index/PerThreadPKLookup.java | 3 +-
.../org/apache/lucene/index/RandomCodec.java | 3 +-
.../apache/lucene/index/RandomIndexWriter.java | 3 +-
.../lucene/index/RandomPostingsTester.java | 3 +-
.../SuppressingConcurrentMergeScheduler.java | 7 +-
.../ThreadedIndexingAndSearchingTestCase.java | 3 +-
.../apache/lucene/mockfile/DisableFsyncFS.java | 23 +--
.../org/apache/lucene/mockfile/ExtrasFS.java | 3 +-
.../mockfile/FilterAsynchronousFileChannel.java | 3 +-
.../lucene/mockfile/FilterDirectoryStream.java | 3 +-
.../lucene/mockfile/FilterFileChannel.java | 3 +-
.../apache/lucene/mockfile/FilterFileStore.java | 3 +-
.../lucene/mockfile/FilterFileSystem.java | 3 +-
.../mockfile/FilterFileSystemProvider.java | 3 +-
.../lucene/mockfile/FilterInputStream2.java | 3 +-
.../lucene/mockfile/FilterOutputStream2.java | 3 +-
.../org/apache/lucene/mockfile/FilterPath.java | 3 +-
.../mockfile/FilterSeekableByteChannel.java | 3 +-
.../apache/lucene/mockfile/HandleLimitFS.java | 3 +-
.../lucene/mockfile/HandleTrackingFS.java | 3 +-
.../java/org/apache/lucene/mockfile/LeakFS.java | 3 +-
.../lucene/mockfile/MockFileSystemTestCase.java | 3 +-
.../org/apache/lucene/mockfile/ShuffleFS.java | 3 +-
.../org/apache/lucene/mockfile/VerboseFS.java | 3 +-
.../org/apache/lucene/mockfile/WindowsFS.java | 3 +-
.../lucene/search/AssertingBulkScorer.java | 3 +-
.../lucene/search/AssertingCollector.java | 3 +-
.../lucene/search/AssertingIndexSearcher.java | 3 +-
.../lucene/search/AssertingLeafCollector.java | 3 +-
.../apache/lucene/search/AssertingQuery.java | 3 +-
.../apache/lucene/search/AssertingScorer.java | 3 +-
.../apache/lucene/search/AssertingWeight.java | 3 +-
.../lucene/search/BaseExplanationTestCase.java | 3 +-
.../lucene/search/BulkScorerWrapperScorer.java | 3 +-
.../org/apache/lucene/search/CheckHits.java | 3 +-
.../org/apache/lucene/search/QueryUtils.java | 3 +-
.../lucene/search/RandomApproximationQuery.java | 3 +-
.../lucene/search/ScorerIndexSearcher.java | 3 +-
.../search/SearchEquivalenceTestBase.java | 3 +-
.../lucene/search/ShardSearchingTestBase.java | 3 +-
.../search/similarities/RandomSimilarity.java | 3 +-
.../lucene/search/spans/AssertingSpanQuery.java | 3 +-
.../search/spans/AssertingSpanWeight.java | 3 +-
.../lucene/search/spans/AssertingSpans.java | 3 +-
.../lucene/search/spans/MultiSpansWrapper.java | 3 +-
.../lucene/search/spans/SpanTestUtil.java | 3 +-
.../lucene/store/BaseDirectoryTestCase.java | 3 +-
.../lucene/store/BaseDirectoryWrapper.java | 3 +-
.../lucene/store/BaseLockFactoryTestCase.java | 3 +-
.../lucene/store/MockDirectoryWrapper.java | 3 +-
.../lucene/store/MockIndexInputWrapper.java | 13 +-
.../lucene/store/MockIndexOutputWrapper.java | 3 +-
.../lucene/store/RawDirectoryWrapper.java | 3 +-
.../store/SlowClosingMockIndexInputWrapper.java | 3 +-
.../store/SlowOpeningMockIndexInputWrapper.java | 3 +-
.../lucene/util/AbstractBeforeAfterRule.java | 23 +--
.../apache/lucene/util/BaseBitSetTestCase.java | 3 +-
.../lucene/util/BaseDocIdSetTestCase.java | 3 +-
.../apache/lucene/util/CloseableDirectory.java | 15 +-
.../java/org/apache/lucene/util/English.java | 9 +-
.../util/FailOnNonBulkMergesInfoStream.java | 3 +-
.../org/apache/lucene/util/FailureMarker.java | 13 +-
.../org/apache/lucene/util/LineFileDocs.java | 3 +-
.../lucene/util/LuceneJUnit3MethodProvider.java | 3 +-
.../org/apache/lucene/util/LuceneTestCase.java | 3 +-
.../org/apache/lucene/util/NullInfoStream.java | 3 +-
.../lucene/util/QuickPatchThreadsFilter.java | 7 +-
.../org/apache/lucene/util/RamUsageTester.java | 3 +-
.../org/apache/lucene/util/RemoveUponClose.java | 19 +-
.../java/org/apache/lucene/util/Rethrow.java | 3 +-
.../util/RunListenerPrintReproduceInfo.java | 33 ++-
.../lucene/util/TestRuleAssertionsRequired.java | 3 +-
.../apache/lucene/util/TestRuleDelegate.java | 15 +-
.../util/TestRuleIgnoreAfterMaxFailures.java | 21 +-
.../lucene/util/TestRuleIgnoreTestSuites.java | 11 +-
.../lucene/util/TestRuleLimitSysouts.java | 33 ++-
.../apache/lucene/util/TestRuleMarkFailure.java | 19 +-
.../util/TestRuleRestoreSystemProperties.java | 17 +-
.../util/TestRuleSetupAndRestoreClassEnv.java | 3 +-
.../TestRuleSetupAndRestoreInstanceEnv.java | 7 +-
.../util/TestRuleSetupTeardownChained.java | 13 +-
.../lucene/util/TestRuleStoreClassName.java | 3 +-
.../util/TestRuleTemporaryFilesCleanup.java | 3 +-
.../lucene/util/TestRuleThreadAndTestName.java | 11 +-
.../apache/lucene/util/TestSecurityManager.java | 9 +-
.../java/org/apache/lucene/util/TestUtil.java | 3 +-
.../lucene/util/ThrottledIndexOutput.java | 9 +-
.../java/org/apache/lucene/util/TimeUnits.java | 3 +-
.../util/automaton/AutomatonTestUtil.java | 3 +-
.../org/apache/lucene/util/fst/FSTTester.java | 9 +-
.../lucene/analysis/TestGraphTokenizers.java | 3 +-
.../analysis/TestLookaheadTokenFilter.java | 3 +-
.../lucene/analysis/TestMockAnalyzer.java | 3 +-
.../lucene/analysis/TestMockCharFilter.java | 9 +-
.../apache/lucene/analysis/TestPosition.java | 5 +-
.../lucene/analysis/TrivialLookaheadFilter.java | 3 +-
.../asserting/TestAssertingDocValuesFormat.java | 3 +-
.../asserting/TestAssertingNormsFormat.java | 3 +-
.../asserting/TestAssertingPointFormat.java | 3 +-
.../asserting/TestAssertingPostingsFormat.java | 3 +-
.../TestAssertingStoredFieldsFormat.java | 3 +-
.../TestAssertingTermVectorsFormat.java | 3 +-
.../TestCompressingStoredFieldsFormat.java | 3 +-
.../TestCompressingTermVectorsFormat.java | 33 ++-
.../lucene/index/TestAssertingLeafReader.java | 3 +-
.../lucene/index/TestForceMergePolicy.java | 3 +-
.../lucene/mockfile/TestDisableFsyncFS.java | 3 +-
.../apache/lucene/mockfile/TestExtrasFS.java | 3 +-
.../lucene/mockfile/TestHandleLimitFS.java | 3 +-
.../lucene/mockfile/TestHandleTrackingFS.java | 3 +-
.../org/apache/lucene/mockfile/TestLeakFS.java | 3 +-
.../apache/lucene/mockfile/TestShuffleFS.java | 3 +-
.../apache/lucene/mockfile/TestVerboseFS.java | 3 +-
.../apache/lucene/mockfile/TestWindowsFS.java | 3 +-
.../lucene/store/TestMockDirectoryWrapper.java | 3 +-
.../test/org/apache/lucene/util/SorePoint.java | 3 +-
.../test/org/apache/lucene/util/SoreType.java | 3 +-
.../lucene/util/TestBeforeAfterOverrides.java | 17 +-
.../apache/lucene/util/TestCodecReported.java | 15 +-
.../util/TestExceptionInBeforeClassHooks.java | 3 +-
.../util/TestFailIfDirectoryNotClosed.java | 3 +-
.../util/TestFailIfUnreferencedFiles.java | 3 +-
.../apache/lucene/util/TestGroupFiltering.java | 21 +-
.../apache/lucene/util/TestJUnitRuleOrder.java | 3 +-
.../apache/lucene/util/TestMaxFailuresRule.java | 3 +-
.../util/TestRamUsageTesterOnWildAnimals.java | 3 +-
.../lucene/util/TestReproduceMessage.java | 3 +-
.../util/TestReproduceMessageWithRepeated.java | 3 +-
.../util/TestRunWithRestrictedPermissions.java | 3 +-
.../lucene/util/TestSeedFromUncaught.java | 3 +-
.../lucene/util/TestSetupTeardownChaining.java | 3 +-
.../lucene/util/TestWorstCaseTestBehavior.java | 15 +-
.../org/apache/lucene/util/WithNestedTests.java | 3 +-
.../dependencies/GetMavenDependenciesTask.java | 3 +-
.../dependencies/InterpolatedProperties.java | 3 +-
.../lucene/validation/LibVersionsCheckTask.java | 3 +-
.../lucene/validation/LicenseCheckTask.java | 3 +-
.../apache/lucene/validation/LicenseType.java | 5 +-
.../lucene/validation/ivyde/IvyNodeElement.java | 28 ++-
.../validation/ivyde/IvyNodeElementAdapter.java | 28 ++-
solr/CHANGES.txt | 11 +
.../apache/solr/schema/ICUCollationField.java | 3 +-
.../TestFoldingMultitermExtrasQuery.java | 3 +-
.../solr/schema/TestICUCollationField.java | 1 -
.../schema/TestICUCollationFieldDocValues.java | 1 -
.../schema/TestICUCollationFieldOptions.java | 3 +-
.../analytics/accumulator/BasicAccumulator.java | 1 -
.../accumulator/FacetingAccumulator.java | 1 -
.../analytics/accumulator/ValueAccumulator.java | 1 -
.../facet/FacetValueAccumulator.java | 1 -
.../facet/FieldFacetAccumulator.java | 1 -
.../facet/QueryFacetAccumulator.java | 1 -
.../facet/RangeFacetAccumulator.java | 1 -
.../analytics/expression/BaseExpression.java | 1 -
.../expression/DualDelegateExpression.java | 1 -
.../solr/analytics/expression/Expression.java | 1 -
.../analytics/expression/ExpressionFactory.java | 1 -
.../expression/MultiDelegateExpression.java | 1 -
.../expression/SingleDelegateExpression.java | 1 -
.../plugin/AnalyticsStatisticsCollector.java | 1 -
.../request/AbstractFieldFacetRequest.java | 1 -
.../request/AnalyticsContentHandler.java | 1 -
.../analytics/request/AnalyticsRequest.java | 1 -
.../request/AnalyticsRequestFactory.java | 1 -
.../solr/analytics/request/AnalyticsStats.java | 1 -
.../analytics/request/ExpressionRequest.java | 1 -
.../solr/analytics/request/FacetRequest.java | 1 -
.../analytics/request/FieldFacetRequest.java | 1 -
.../analytics/request/QueryFacetRequest.java | 1 -
.../analytics/request/RangeFacetRequest.java | 1 -
.../AbstractDelegatingStatsCollector.java | 1 -
.../statistics/MedianStatsCollector.java | 1 -
.../statistics/MinMaxStatsCollector.java | 1 -
.../statistics/NumericStatsCollector.java | 1 -
.../statistics/PercentileStatsCollector.java | 1 -
.../analytics/statistics/StatsCollector.java | 1 -
.../StatsCollectorSupplierFactory.java | 1 -
.../statistics/UniqueStatsCollector.java | 1 -
.../solr/analytics/util/AnalyticsParams.java | 1 -
.../solr/analytics/util/AnalyticsParsers.java | 1 -
.../solr/analytics/util/MedianCalculator.java | 1 -
.../analytics/util/PercentileCalculator.java | 1 -
.../analytics/util/RangeEndpointCalculator.java | 1 -
.../AbsoluteValueDoubleFunction.java | 1 -
.../util/valuesource/AddDoubleFunction.java | 1 -
.../util/valuesource/ConcatStringFunction.java | 1 -
.../util/valuesource/ConstDateSource.java | 1 -
.../util/valuesource/ConstDoubleSource.java | 1 -
.../util/valuesource/ConstStringSource.java | 1 -
.../util/valuesource/DateFieldSource.java | 1 -
.../util/valuesource/DateMathFunction.java | 1 -
.../util/valuesource/DivDoubleFunction.java | 1 -
.../util/valuesource/DualDoubleFunction.java | 1 -
.../util/valuesource/FilterFieldSource.java | 1 -
.../util/valuesource/LogDoubleFunction.java | 1 -
.../util/valuesource/MultiDateFunction.java | 1 -
.../util/valuesource/MultiDoubleFunction.java | 1 -
.../util/valuesource/MultiStringFunction.java | 1 -
.../valuesource/MultiplyDoubleFunction.java | 1 -
.../util/valuesource/NegateDoubleFunction.java | 1 -
.../util/valuesource/PowDoubleFunction.java | 1 -
.../util/valuesource/ReverseStringFunction.java | 1 -
.../util/valuesource/SingleDoubleFunction.java | 1 -
.../util/valuesource/SingleStringFunction.java | 1 -
.../handler/component/AnalyticsComponent.java | 1 -
.../analytics/AbstractAnalyticsStatsTest.java | 1 -
.../org/apache/solr/analytics/NoFacetTest.java | 1 -
.../analytics/expression/ExpressionTest.java | 1 -
.../facet/AbstractAnalyticsFacetTest.java | 1 -
.../analytics/facet/FieldFacetExtrasTest.java | 1 -
.../solr/analytics/facet/FieldFacetTest.java | 1 -
.../solr/analytics/facet/QueryFacetTest.java | 1 -
.../solr/analytics/facet/RangeFacetTest.java | 1 -
.../util/valuesource/FunctionTest.java | 1 -
.../handler/clustering/ClusteringComponent.java | 3 +-
.../handler/clustering/ClusteringEngine.java | 2 +-
.../handler/clustering/ClusteringParams.java | 3 +-
.../clustering/DocumentClusteringEngine.java | 3 +-
.../clustering/SearchClusteringEngine.java | 3 +-
.../carrot2/CarrotClusteringEngine.java | 3 +-
.../clustering/carrot2/CarrotParams.java | 10 +-
.../carrot2/LuceneCarrot2StemmerFactory.java | 7 +-
.../carrot2/LuceneCarrot2TokenizerFactory.java | 3 +-
.../clustering/carrot2/SolrResourceLocator.java | 1 -
.../SolrStopwordsCarrot2LexicalDataFactory.java | 3 +-
.../clustering/AbstractClusteringTestCase.java | 3 +-
.../clustering/ClusteringComponentTest.java | 3 +-
.../DistributedClusteringComponentTest.java | 3 +-
.../MockDocumentClusteringEngine.java | 2 +-
.../carrot2/CarrotClusteringEngineTest.java | 3 +-
.../carrot2/DuplicatingStemmerFactory.java | 3 +-
.../carrot2/DuplicatingTokenizerFactory.java | 3 +-
.../carrot2/EchoClusteringAlgorithm.java | 2 +-
.../carrot2/EchoStemsClusteringAlgorithm.java | 4 +-
.../carrot2/EchoTokensClusteringAlgorithm.java | 4 +-
...exicalResourcesCheckClusteringAlgorithm.java | 4 +-
.../carrot2/MockClusteringAlgorithm.java | 2 +-
.../handler/dataimport/CachePropertyUtil.java | 3 +-
.../apache/solr/handler/dataimport/Context.java | 1 -
.../solr/handler/dataimport/ContextImpl.java | 4 +-
.../solr/handler/dataimport/DIHCache.java | 3 +-
.../handler/dataimport/DIHCacheSupport.java | 3 +-
.../solr/handler/dataimport/DIHLogLevels.java | 3 +-
.../solr/handler/dataimport/DIHProperties.java | 5 +-
.../solr/handler/dataimport/DIHWriter.java | 2 +-
.../solr/handler/dataimport/DIHWriterBase.java | 3 +-
.../dataimport/DataImportHandlerException.java | 1 -
.../solr/handler/dataimport/DataImporter.java | 1 -
.../solr/handler/dataimport/DataSource.java | 1 -
.../handler/dataimport/DateFormatEvaluator.java | 33 ++-
.../dataimport/DateFormatTransformer.java | 1 -
.../solr/handler/dataimport/DebugLogger.java | 3 +-
.../solr/handler/dataimport/DocBuilder.java | 1 -
.../dataimport/NumberFormatTransformer.java | 3 +-
.../dataimport/SimplePropertiesWriter.java | 3 +-
.../handler/dataimport/SolrEntityProcessor.java | 3 +-
.../dataimport/SolrQueryEscapingEvaluator.java | 15 +-
.../dataimport/SortedMapBackedCache.java | 3 +-
.../dataimport/SqlEscapingEvaluator.java | 11 +-
.../solr/handler/dataimport/UrlEvaluator.java | 17 +-
.../apache/solr/handler/dataimport/Zipper.java | 27 ++-
.../dataimport/config/DIHConfiguration.java | 33 ++-
.../solr/handler/dataimport/config/Entity.java | 26 ++-
.../handler/dataimport/config/EntityField.java | 1 -
.../solr/handler/dataimport/config/Field.java | 1 -
.../dataimport/config/PropertyWriter.java | 9 +-
.../solr/handler/dataimport/config/Script.java | 25 ++-
.../dataimport/AbstractDIHCacheTestCase.java | 3 +-
.../dataimport/AbstractDIHJdbcTestCase.java | 30 ++-
.../AbstractSqlEntityProcessorTestCase.java | 33 ++-
.../dataimport/AddAColumnTransformer.java | 7 +-
.../handler/dataimport/DestroyCountCache.java | 3 +-
.../dataimport/MockSolrEntityProcessor.java | 3 +-
.../handler/dataimport/TestEphemeralCache.java | 3 +-
.../handler/dataimport/TestErrorHandling.java | 3 +-
.../dataimport/TestFileListEntityProcessor.java | 3 +-
.../TestFileListWithLineEntityProcessor.java | 19 +-
.../dataimport/TestHierarchicalDocBuilder.java | 3 +-
.../TestJdbcDataSourceConvertType.java | 3 +-
.../dataimport/TestLineEntityProcessor.java | 3 +-
.../handler/dataimport/TestNestedChildren.java | 15 +-
.../dataimport/TestSimplePropertiesWriter.java | 33 ++-
.../TestSolrEntityProcessorEndToEnd.java | 3 +-
.../dataimport/TestSolrEntityProcessorUnit.java | 2 +-
.../dataimport/TestSortedMapBackedCache.java | 7 +-
.../dataimport/TestSqlEntityProcessor.java | 9 +-
.../dataimport/TestSqlEntityProcessorDelta.java | 21 +-
.../TestVariableResolverEndToEnd.java | 31 ++-
.../dataimport/TestXPathRecordReader.java | 2 +-
.../dataimport/TestZKPropertiesWriter.java | 7 +-
.../dataimport/TripleThreatTransformer.java | 16 +-
.../handler/extraction/ParseContextConfig.java | 3 +-
.../extraction/RegexRulesPasswordProvider.java | 1 -
.../handler/extraction/SolrContentHandler.java | 1 -
.../ExtractingRequestHandlerTest.java | 3 +-
.../extraction/ParseContextConfigTest.java | 3 +-
.../solr/update/processor/DetectedLanguage.java | 3 +-
...DetectLanguageIdentifierUpdateProcessor.java | 3 +-
...anguageIdentifierUpdateProcessorFactory.java | 3 +-
.../solr/update/processor/LangIdParams.java | 3 +-
.../LanguageIdentifierUpdateProcessor.java | 3 +-
.../TikaLanguageIdentifierUpdateProcessor.java | 3 +-
...anguageIdentifierUpdateProcessorFactory.java | 3 +-
...ageIdentifierUpdateProcessorFactoryTest.java | 3 +-
...dentifierUpdateProcessorFactoryTestCase.java | 1 -
...ageIdentifierUpdateProcessorFactoryTest.java | 3 +-
.../solr/hadoop/AlphaNumericComparator.java | 1 -
.../solr/hadoop/DataInputInputStream.java | 1 -
.../hadoop/UnbufferedDataInputInputStream.java | 1 -
.../apache/solr/hadoop/ZooKeeperInspector.java | 1 -
.../solr/hadoop/MorphlineGoLiveMiniMRTest.java | 1 -
.../solr/AbstractSolrMorphlineZkTestBase.java | 1 -
.../uima/processor/FieldMappingException.java | 3 +-
.../uima/processor/SolrUIMAConfiguration.java | 3 +-
.../processor/SolrUIMAConfigurationReader.java | 3 +-
.../solr/uima/processor/UIMAToSolrMapper.java | 3 +-
.../processor/UIMAUpdateRequestProcessor.java | 3 +-
.../UIMAUpdateRequestProcessorFactory.java | 3 +-
.../UIMATokenizersSolrIntegrationTest.java | 3 +-
.../UIMAUpdateRequestProcessorTest.java | 3 +-
.../uima/processor/an/DummyEntityAnnotator.java | 17 +-
.../processor/an/DummyExceptionAnnotator.java | 11 +-
.../processor/an/DummySentimentAnnotator.java | 21 +-
.../java/org/apache/solr/response/PageTool.java | 1 -
.../solr/response/SolrParamResourceLoader.java | 1 -
.../solr/response/SolrVelocityLogger.java | 3 +-
.../solr/response/VelocityResponseWriter.java | 1 -
.../test/org/apache/solr/velocity/MockTool.java | 3 +-
.../velocity/VelocityResponseWriterTest.java | 1 -
.../solr/analysis/ReversedWildcardFilter.java | 3 +-
.../analysis/ReversedWildcardFilterFactory.java | 3 +-
.../org/apache/solr/analysis/SolrAnalyzer.java | 1 -
.../apache/solr/analysis/TokenizerChain.java | 1 -
.../solrj/embedded/EmbeddedSolrServer.java | 1 -
.../solr/client/solrj/embedded/JettyConfig.java | 1 -
.../client/solrj/embedded/JettySolrRunner.java | 1 -
.../solr/client/solrj/embedded/SSLConfig.java | 3 +-
.../org/apache/solr/cloud/ActionThrottle.java | 7 +-
.../src/java/org/apache/solr/cloud/Assign.java | 27 ++-
.../solr/cloud/CloudConfigSetService.java | 1 -
.../org/apache/solr/cloud/CloudDescriptor.java | 3 +-
.../java/org/apache/solr/cloud/CloudUtil.java | 3 +-
.../cloud/CurrentCoreDescriptorProvider.java | 3 +-
.../org/apache/solr/cloud/DistributedMap.java | 3 +-
.../org/apache/solr/cloud/DistributedQueue.java | 4 +-
.../org/apache/solr/cloud/ElectionContext.java | 3 +-
.../org/apache/solr/cloud/LeaderElector.java | 3 +-
.../cloud/LeaderInitiatedRecoveryThread.java | 33 ++-
.../java/org/apache/solr/cloud/Overseer.java | 27 ++-
.../OverseerAutoReplicaFailoverThread.java | 3 +-
.../OverseerCollectionConfigSetProcessor.java | 3 +-
.../cloud/OverseerCollectionMessageHandler.java | 3 +-
.../cloud/OverseerConfigSetMessageHandler.java | 3 +-
.../solr/cloud/OverseerMessageHandler.java | 3 +-
.../solr/cloud/OverseerNodePrioritizer.java | 7 +-
.../apache/solr/cloud/OverseerSolrResponse.java | 3 +-
.../solr/cloud/OverseerTaskProcessor.java | 3 +-
.../apache/solr/cloud/OverseerTaskQueue.java | 7 +-
.../org/apache/solr/cloud/RecoveryStrategy.java | 3 +-
.../solr/cloud/SizeLimitedDistributedMap.java | 3 +-
.../org/apache/solr/cloud/SolrZkServer.java | 27 ++-
.../org/apache/solr/cloud/SyncStrategy.java | 17 +-
.../src/java/org/apache/solr/cloud/ZkCLI.java | 33 ++-
.../org/apache/solr/cloud/ZkController.java | 3 +-
.../apache/solr/cloud/ZkSolrResourceLoader.java | 3 +-
.../cloud/overseer/ClusterStateMutator.java | 7 +-
.../solr/cloud/overseer/CollectionMutator.java | 7 +-
.../solr/cloud/overseer/OverseerAction.java | 3 +-
.../solr/cloud/overseer/ReplicaMutator.java | 7 +-
.../solr/cloud/overseer/SliceMutator.java | 7 +-
.../solr/cloud/overseer/ZkStateWriter.java | 3 +-
.../solr/cloud/overseer/ZkWriteCommand.java | 3 +-
.../apache/solr/cloud/rule/ImplicitSnitch.java | 4 +-
.../apache/solr/cloud/rule/RemoteCallback.java | 3 +-
.../apache/solr/cloud/rule/ReplicaAssigner.java | 7 +-
.../java/org/apache/solr/cloud/rule/Rule.java | 4 +-
.../java/org/apache/solr/cloud/rule/Snitch.java | 3 +-
.../apache/solr/cloud/rule/SnitchContext.java | 3 +-
.../solr/core/AbstractSolrEventListener.java | 1 -
.../solr/core/CachingDirectoryFactory.java | 3 +-
.../java/org/apache/solr/core/CloseHook.java | 4 +-
.../java/org/apache/solr/core/CloudConfig.java | 3 +-
.../java/org/apache/solr/core/CodecFactory.java | 3 +-
.../src/java/org/apache/solr/core/Config.java | 1 -
.../org/apache/solr/core/ConfigOverlay.java | 3 +-
.../java/org/apache/solr/core/ConfigSet.java | 1 -
.../apache/solr/core/ConfigSetProperties.java | 1 -
.../org/apache/solr/core/ConfigSetService.java | 1 -
.../org/apache/solr/core/CoreContainer.java | 1 -
.../org/apache/solr/core/CoreDescriptor.java | 1 -
.../apache/solr/core/CorePropertiesLocator.java | 3 +-
.../java/org/apache/solr/core/CoresLocator.java | 3 +-
.../java/org/apache/solr/core/Diagnostics.java | 4 +-
.../org/apache/solr/core/DirectoryFactory.java | 3 +-
.../solr/core/EphemeralDirectoryFactory.java | 3 +-
.../apache/solr/core/HdfsDirectoryFactory.java | 3 +-
.../org/apache/solr/core/ImplicitPlugins.java | 4 +-
.../solr/core/IndexDeletionPolicyWrapper.java | 3 +-
.../apache/solr/core/IndexReaderFactory.java | 3 +-
.../java/org/apache/solr/core/InitParams.java | 3 +-
.../org/apache/solr/core/JarRepository.java | 3 +-
.../apache/solr/core/MMapDirectoryFactory.java | 4 +-
.../org/apache/solr/core/MapSerializable.java | 4 +-
.../org/apache/solr/core/MemClassLoader.java | 3 +-
.../apache/solr/core/NIOFSDirectoryFactory.java | 3 +-
.../solr/core/NRTCachingDirectoryFactory.java | 1 -
.../java/org/apache/solr/core/NodeConfig.java | 3 +-
.../java/org/apache/solr/core/PluginBag.java | 4 +-
.../apache/solr/core/QuerySenderListener.java | 1 -
.../apache/solr/core/RAMDirectoryFactory.java | 1 -
.../org/apache/solr/core/RequestHandlers.java | 1 -
.../org/apache/solr/core/RequestParams.java | 3 +-
.../apache/solr/core/RunExecutableListener.java | 1 -
.../apache/solr/core/SchemaCodecFactory.java | 33 ++-
.../solr/core/SimpleFSDirectoryFactory.java | 3 +-
.../java/org/apache/solr/core/SolrConfig.java | 1 -
.../src/java/org/apache/solr/core/SolrCore.java | 1 -
.../java/org/apache/solr/core/SolrCores.java | 3 +-
.../apache/solr/core/SolrDeletionPolicy.java | 3 +-
.../org/apache/solr/core/SolrEventListener.java | 1 -
.../org/apache/solr/core/SolrInfoMBean.java | 1 -
.../apache/solr/core/SolrResourceLoader.java | 1 -
.../core/SolrResourceNotFoundException.java | 1 -
.../org/apache/solr/core/SolrXmlConfig.java | 3 +-
.../solr/core/StandardDirectoryFactory.java | 3 +-
.../solr/core/StandardIndexReaderFactory.java | 3 +-
.../java/org/apache/solr/core/ZkContainer.java | 3 +-
.../handler/AnalysisRequestHandlerBase.java | 1 -
.../org/apache/solr/handler/BlobHandler.java | 3 +-
.../apache/solr/handler/CdcrBufferManager.java | 3 +-
.../solr/handler/CdcrBufferStateManager.java | 3 +-
.../solr/handler/CdcrLeaderStateManager.java | 7 +-
.../org/apache/solr/handler/CdcrParams.java | 3 +-
.../solr/handler/CdcrProcessStateManager.java | 7 +-
.../org/apache/solr/handler/CdcrReplicator.java | 3 +-
.../solr/handler/CdcrReplicatorManager.java | 3 +-
.../solr/handler/CdcrReplicatorScheduler.java | 3 +-
.../solr/handler/CdcrReplicatorState.java | 3 +-
.../apache/solr/handler/CdcrRequestHandler.java | 3 +-
.../apache/solr/handler/CdcrStateManager.java | 3 +-
.../solr/handler/CdcrUpdateLogSynchronizer.java | 15 +-
.../solr/handler/ContentStreamHandlerBase.java | 3 +-
.../solr/handler/ContentStreamLoader.java | 4 +-
.../handler/DocumentAnalysisRequestHandler.java | 1 -
.../apache/solr/handler/DumpRequestHandler.java | 1 -
.../handler/FieldAnalysisRequestHandler.java | 1 -
.../solr/handler/MoreLikeThisHandler.java | 1 -
.../solr/handler/NestedRequestHandler.java | 3 +-
.../solr/handler/NotFoundRequestHandler.java | 3 +-
.../apache/solr/handler/OldBackupDirectory.java | 3 +-
.../apache/solr/handler/PingRequestHandler.java | 1 -
.../apache/solr/handler/RealTimeGetHandler.java | 1 -
.../apache/solr/handler/RequestHandlerBase.java | 1 -
.../solr/handler/RequestHandlerUtils.java | 1 -
.../org/apache/solr/handler/RestoreCore.java | 3 +-
.../org/apache/solr/handler/SQLHandler.java | 3 +-
.../org/apache/solr/handler/SchemaHandler.java | 4 +-
.../apache/solr/handler/SolrConfigHandler.java | 4 +-
.../solr/handler/StandardRequestHandler.java | 1 -
.../org/apache/solr/handler/StreamHandler.java | 1 -
.../solr/handler/UpdateRequestHandler.java | 1 -
.../solr/handler/admin/AdminHandlers.java | 1 -
.../solr/handler/admin/ClusterStatus.java | 4 +-
.../solr/handler/admin/ConfigSetsHandler.java | 7 +-
.../solr/handler/admin/CoreAdminHandler.java | 1 -
.../solr/handler/admin/CoreAdminOperation.java | 3 +-
.../apache/solr/handler/admin/InfoHandler.java | 3 +-
.../solr/handler/admin/LoggingHandler.java | 3 +-
.../solr/handler/admin/LukeRequestHandler.java | 1 -
.../solr/handler/admin/PluginInfoHandler.java | 1 -
.../handler/admin/PropertiesRequestHandler.java | 1 -
.../solr/handler/admin/RebalanceLeaders.java | 33 ++-
.../solr/handler/admin/SecurityConfHandler.java | 3 +-
.../admin/SegmentsInfoRequestHandler.java | 33 ++-
.../handler/admin/ShowFileRequestHandler.java | 1 -
.../handler/admin/SolrInfoMBeanHandler.java | 3 +-
.../solr/handler/admin/SystemInfoHandler.java | 1 -
.../solr/handler/admin/ThreadDumpHandler.java | 1 -
.../handler/admin/ZookeeperInfoHandler.java | 1 -
.../handler/component/DateFacetProcessor.java | 3 +-
.../solr/handler/component/DebugComponent.java | 1 -
.../solr/handler/component/ExpandComponent.java | 1 -
.../solr/handler/component/FacetComponent.java | 1 -
.../solr/handler/component/FieldFacetStats.java | 3 +-
.../handler/component/HighlightComponent.java | 1 -
.../handler/component/HttpShardHandler.java | 3 +-
.../component/HttpShardHandlerFactory.java | 3 +-
.../component/IterativeMergeStrategy.java | 31 ++-
.../solr/handler/component/MergeStrategy.java | 31 ++-
.../component/MoreLikeThisComponent.java | 1 -
.../solr/handler/component/PivotFacet.java | 1 -
.../solr/handler/component/PivotFacetField.java | 1 -
.../PivotFacetFieldValueCollection.java | 3 +-
.../handler/component/PivotFacetHelper.java | 1 -
.../handler/component/PivotFacetProcessor.java | 3 +-
.../solr/handler/component/PivotFacetValue.java | 3 +-
.../solr/handler/component/QueryComponent.java | 1 -
.../component/QueryElevationComponent.java | 1 -
.../handler/component/RangeFacetProcessor.java | 3 +-
.../handler/component/RangeFacetRequest.java | 7 +-
.../handler/component/RealTimeGetComponent.java | 11 +-
.../solr/handler/component/ResponseBuilder.java | 1 -
.../handler/component/ResponseLogComponent.java | 3 +-
.../solr/handler/component/SearchComponent.java | 1 -
.../solr/handler/component/SearchHandler.java | 1 -
.../component/ShardFieldSortedHitQueue.java | 3 +-
.../solr/handler/component/ShardHandler.java | 4 +-
.../handler/component/ShardHandlerFactory.java | 4 +-
.../solr/handler/component/ShardResponse.java | 3 +-
.../handler/component/SpatialHeatmapFacets.java | 3 +-
.../handler/component/SpellCheckComponent.java | 1 -
.../handler/component/SpellCheckMergeData.java | 3 +-
.../solr/handler/component/StatsComponent.java | 1 -
.../solr/handler/component/StatsField.java | 1 -
.../solr/handler/component/StatsValues.java | 2 -
.../handler/component/StatsValuesFactory.java | 3 +-
.../handler/component/SuggestComponent.java | 3 +-
.../handler/component/TermVectorComponent.java | 34 ++--
.../solr/handler/component/TermsComponent.java | 3 +-
.../apache/solr/handler/loader/CSVLoader.java | 1 -
.../solr/handler/loader/CSVLoaderBase.java | 1 -
.../handler/loader/ContentStreamLoader.java | 4 +-
.../solr/handler/loader/JavabinLoader.java | 1 -
.../apache/solr/handler/loader/JsonLoader.java | 3 +-
.../apache/solr/handler/loader/XMLLoader.java | 3 +-
.../highlight/BreakIteratorBoundaryScanner.java | 1 -
.../apache/solr/highlight/DefaultEncoder.java | 1 -
.../solr/highlight/HighlightingPluginBase.java | 1 -
.../org/apache/solr/highlight/HtmlEncoder.java | 1 -
.../solr/highlight/PostingsSolrHighlighter.java | 3 +-
.../highlight/ScoreOrderFragmentsBuilder.java | 1 -
.../solr/highlight/SimpleBoundaryScanner.java | 1 -
.../solr/highlight/SimpleFragListBuilder.java | 1 -
.../solr/highlight/SimpleFragmentsBuilder.java | 1 -
.../solr/highlight/SingleFragListBuilder.java | 1 -
.../solr/highlight/SolrBoundaryScanner.java | 1 -
.../org/apache/solr/highlight/SolrEncoder.java | 1 -
.../apache/solr/highlight/SolrFormatter.java | 1 -
.../solr/highlight/SolrFragListBuilder.java | 1 -
.../apache/solr/highlight/SolrFragmenter.java | 1 -
.../solr/highlight/SolrFragmentsBuilder.java | 1 -
.../apache/solr/highlight/SolrHighlighter.java | 3 +-
.../solr/highlight/WeightedFragListBuilder.java | 1 -
.../apache/solr/index/hdfs/CheckHdfsIndex.java | 3 +-
.../org/apache/solr/internal/csv/CSVParser.java | 6 +-
.../apache/solr/internal/csv/CSVPrinter.java | 6 +-
.../apache/solr/internal/csv/CSVStrategy.java | 6 +-
.../org/apache/solr/internal/csv/CSVUtils.java | 6 +-
.../apache/solr/internal/csv/CharBuffer.java | 26 ++-
.../internal/csv/ExtendedBufferedReader.java | 6 +-
.../solr/internal/csv/writer/CSVConfig.java | 26 ++-
.../internal/csv/writer/CSVConfigGuesser.java | 26 ++-
.../solr/internal/csv/writer/CSVField.java | 26 ++-
.../solr/internal/csv/writer/CSVWriter.java | 26 ++-
.../org/apache/solr/logging/CircularList.java | 1 -
.../org/apache/solr/logging/ListenerConfig.java | 5 +-
.../org/apache/solr/logging/LogWatcher.java | 1 -
.../apache/solr/logging/LogWatcherConfig.java | 3 +-
.../org/apache/solr/logging/LoggerInfo.java | 1 -
.../apache/solr/logging/MDCLoggingContext.java | 3 +-
.../org/apache/solr/parser/FastCharStream.java | 5 +-
.../apache/solr/parser/SolrQueryParserBase.java | 1 -
.../java/org/apache/solr/query/FilterQuery.java | 3 +-
.../org/apache/solr/query/SolrRangeQuery.java | 3 +-
.../apache/solr/request/DocValuesFacets.java | 3 +-
.../org/apache/solr/request/DocValuesStats.java | 3 +-
.../org/apache/solr/request/IntervalFacets.java | 33 ++-
.../solr/request/LocalSolrQueryRequest.java | 1 -
.../org/apache/solr/request/NumericFacets.java | 3 +-
.../request/PerSegmentSingleValuedFaceting.java | 1 -
.../org/apache/solr/request/SimpleFacets.java | 1 -
.../apache/solr/request/SolrQueryRequest.java | 1 -
.../solr/request/SolrQueryRequestBase.java | 1 -
.../apache/solr/request/SolrRequestHandler.java | 1 -
.../apache/solr/request/SolrRequestInfo.java | 1 -
.../org/apache/solr/request/json/JSONUtil.java | 4 +-
.../apache/solr/request/json/ObjectUtil.java | 4 +-
.../apache/solr/request/json/RequestUtil.java | 4 +-
.../solr/request/macro/MacroExpander.java | 3 +-
.../solr/response/BasicResultContext.java | 3 +-
.../response/BinaryQueryResponseWriter.java | 4 +-
.../apache/solr/response/CSVResponseWriter.java | 1 -
.../org/apache/solr/response/DocsStreamer.java | 3 +-
.../solr/response/JSONResponseWriter.java | 1 -
.../apache/solr/response/PHPResponseWriter.java | 1 -
.../response/PHPSerializedResponseWriter.java | 1 -
.../solr/response/PythonResponseWriter.java | 1 -
.../solr/response/QueryResponseWriter.java | 1 -
.../solr/response/QueryResponseWriterUtil.java | 1 -
.../apache/solr/response/RawResponseWriter.java | 1 -
.../org/apache/solr/response/ResultContext.java | 1 -
.../solr/response/SchemaXmlResponseWriter.java | 1 -
.../apache/solr/response/SchemaXmlWriter.java | 3 +-
.../solr/response/SmileResponseWriter.java | 4 +-
.../apache/solr/response/SolrQueryResponse.java | 1 -
.../solr/response/SortingResponseWriter.java | 1 -
.../solr/response/TextResponseWriter.java | 1 -
.../apache/solr/response/XMLResponseWriter.java | 1 -
.../org/apache/solr/response/XMLWriter.java | 1 -
.../solr/response/XSLTResponseWriter.java | 1 -
.../transform/BaseEditorialTransformer.java | 5 +-
.../solr/response/transform/DocTransformer.java | 1 -
.../response/transform/DocTransformers.java | 1 -
.../transform/ElevatedMarkerFactory.java | 3 +-
.../transform/ExcludedMarkerFactory.java | 3 +-
.../response/transform/TransformerFactory.java | 1 -
.../org/apache/solr/rest/BaseSolrResource.java | 3 +-
.../java/org/apache/solr/rest/DELETEable.java | 3 +-
.../src/java/org/apache/solr/rest/GETable.java | 3 +-
.../org/apache/solr/rest/ManagedResource.java | 3 +-
.../solr/rest/ManagedResourceObserver.java | 3 +-
.../solr/rest/ManagedResourceStorage.java | 3 +-
.../src/java/org/apache/solr/rest/POSTable.java | 3 +-
.../src/java/org/apache/solr/rest/PUTable.java | 3 +-
.../java/org/apache/solr/rest/RestManager.java | 3 +-
.../org/apache/solr/rest/SolrSchemaRestApi.java | 3 +-
.../solr/rest/schema/BaseFieldResource.java | 3 +-
.../solr/rest/schema/BaseFieldTypeResource.java | 3 +-
.../schema/CopyFieldCollectionResource.java | 4 +-
.../schema/DynamicFieldCollectionResource.java | 3 +-
.../solr/rest/schema/DynamicFieldResource.java | 4 +-
.../rest/schema/FieldCollectionResource.java | 4 +-
.../apache/solr/rest/schema/FieldResource.java | 3 +-
.../schema/FieldTypeCollectionResource.java | 3 +-
.../solr/rest/schema/FieldTypeResource.java | 3 +-
.../solr/rest/schema/FieldTypeXmlAdapter.java | 3 +-
.../analysis/BaseManagedTokenFilterFactory.java | 3 +-
.../analysis/ManagedStopFilterFactory.java | 3 +-
.../analysis/ManagedSynonymFilterFactory.java | 3 +-
.../schema/analysis/ManagedWordSetResource.java | 3 +-
.../solr/schema/AbstractSpatialFieldType.java | 3 +-
.../AbstractSpatialPrefixTreeFieldType.java | 3 +-
.../solr/schema/AbstractSubTypeFieldType.java | 3 +-
.../java/org/apache/solr/schema/BBoxField.java | 3 +-
.../org/apache/solr/schema/BinaryField.java | 1 -
.../java/org/apache/solr/schema/BoolField.java | 1 -
.../solr/schema/ClassicIndexSchemaFactory.java | 3 +-
.../org/apache/solr/schema/CollationField.java | 3 +-
.../apache/solr/schema/CoordinateFieldType.java | 1 -
.../java/org/apache/solr/schema/CopyField.java | 1 -
.../org/apache/solr/schema/CurrencyField.java | 3 +-
.../org/apache/solr/schema/DateRangeField.java | 3 +-
.../apache/solr/schema/DateValueFieldType.java | 1 -
.../solr/schema/DoubleValueFieldType.java | 1 -
.../java/org/apache/solr/schema/EnumField.java | 3 +-
.../solr/schema/ExchangeRateProvider.java | 3 +-
.../solr/schema/ExternalFileFieldReloader.java | 1 -
.../org/apache/solr/schema/FieldProperties.java | 1 -
.../java/org/apache/solr/schema/FieldType.java | 1 -
.../solr/schema/FieldTypePluginLoader.java | 1 -
.../apache/solr/schema/FloatValueFieldType.java | 1 -
.../org/apache/solr/schema/GeoHashField.java | 1 -
.../org/apache/solr/schema/IndexSchema.java | 1 -
.../apache/solr/schema/IndexSchemaFactory.java | 3 +-
.../apache/solr/schema/IntValueFieldType.java | 1 -
.../solr/schema/JsonPreAnalyzedParser.java | 33 ++-
.../java/org/apache/solr/schema/LatLonType.java | 3 +-
.../apache/solr/schema/LongValueFieldType.java | 1 -
.../apache/solr/schema/ManagedIndexSchema.java | 3 +-
.../solr/schema/ManagedIndexSchemaFactory.java | 3 +-
.../solr/schema/NumericValueFieldType.java | 1 -
.../schema/OpenExchangeRatesOrgProvider.java | 3 +-
.../java/org/apache/solr/schema/PointType.java | 1 -
.../apache/solr/schema/PreAnalyzedField.java | 3 +-
.../apache/solr/schema/PrimitiveFieldType.java | 1 -
.../org/apache/solr/schema/RandomSortField.java | 1 -
.../schema/RptWithGeometrySpatialField.java | 3 +-
.../org/apache/solr/schema/SchemaAware.java | 4 +-
.../org/apache/solr/schema/SchemaField.java | 1 -
.../org/apache/solr/schema/SchemaManager.java | 4 +-
.../apache/solr/schema/SimilarityFactory.java | 3 +-
.../solr/schema/SimplePreAnalyzedParser.java | 3 +-
.../schema/SpatialPointVectorFieldType.java | 3 +-
.../apache/solr/schema/SpatialQueryable.java | 4 +-
.../SpatialRecursivePrefixTreeFieldType.java | 3 +-
.../SpatialTermQueryPrefixTreeFieldType.java | 1 -
.../java/org/apache/solr/schema/StrField.java | 1 -
.../org/apache/solr/schema/StrFieldSource.java | 1 -
.../java/org/apache/solr/schema/TextField.java | 1 -
.../org/apache/solr/schema/TrieDateField.java | 1 -
.../org/apache/solr/schema/TrieDoubleField.java | 1 -
.../org/apache/solr/schema/TrieFloatField.java | 1 -
.../org/apache/solr/schema/TrieIntField.java | 1 -
.../org/apache/solr/schema/TrieLongField.java | 1 -
.../java/org/apache/solr/schema/UUIDField.java | 3 +-
.../apache/solr/schema/ZkIndexSchemaReader.java | 3 +-
.../org/apache/solr/search/AnalyticsQuery.java | 31 ++-
.../java/org/apache/solr/search/BitDocSet.java | 1 -
.../solr/search/BitsFilteredDocIdSet.java | 3 +-
.../solr/search/BitsFilteredPostingsEnum.java | 3 +-
.../org/apache/solr/search/CacheConfig.java | 1 -
.../apache/solr/search/CacheRegenerator.java | 1 -
.../solr/search/CollapsingQParserPlugin.java | 1 -
.../solr/search/ComplexPhraseQParserPlugin.java | 3 +-
.../java/org/apache/solr/search/CursorMark.java | 1 -
.../apache/solr/search/DelegatingCollector.java | 1 -
.../org/apache/solr/search/DocIterator.java | 1 -
.../java/org/apache/solr/search/DocList.java | 1 -
.../org/apache/solr/search/DocListAndSet.java | 1 -
.../src/java/org/apache/solr/search/DocSet.java | 1 -
.../java/org/apache/solr/search/DocSetBase.java | 1 -
.../org/apache/solr/search/DocSetBuilder.java | 3 +-
.../org/apache/solr/search/DocSetCollector.java | 3 +-
.../org/apache/solr/search/DocSetProducer.java | 3 +-
.../java/org/apache/solr/search/DocSetUtil.java | 4 +-
.../java/org/apache/solr/search/DocSlice.java | 1 -
.../solr/search/EarlyTerminatingCollector.java | 3 +-
.../EarlyTerminatingCollectorException.java | 4 +-
.../apache/solr/search/ExportQParserPlugin.java | 1 -
.../solr/search/ExtendedDismaxQParser.java | 1 -
.../search/ExtendedDismaxQParserPlugin.java | 1 -
.../org/apache/solr/search/ExtendedQuery.java | 1 -
.../apache/solr/search/ExtendedQueryBase.java | 1 -
.../org/apache/solr/search/FastLRUCache.java | 3 +-
.../org/apache/solr/search/FieldParams.java | 3 +-
.../src/java/org/apache/solr/search/Filter.java | 3 +-
.../apache/solr/search/FilteredDocIdSet.java | 3 +-
.../apache/solr/search/FunctionRangeQuery.java | 1 -
.../java/org/apache/solr/search/Grouping.java | 1 -
.../java/org/apache/solr/search/HashDocSet.java | 1 -
.../apache/solr/search/HashQParserPlugin.java | 1 -
.../java/org/apache/solr/search/Insanity.java | 3 +-
.../java/org/apache/solr/search/LFUCache.java | 3 +-
.../java/org/apache/solr/search/LRUCache.java | 1 -
.../org/apache/solr/search/NoOpRegenerator.java | 3 +-
.../java/org/apache/solr/search/PostFilter.java | 1 -
.../org/apache/solr/search/QueryCommand.java | 3 +-
.../org/apache/solr/search/QueryContext.java | 3 +-
.../org/apache/solr/search/QueryParsing.java | 1 -
.../org/apache/solr/search/QueryResult.java | 3 +-
.../org/apache/solr/search/QueryResultKey.java | 1 -
.../java/org/apache/solr/search/QueryUtils.java | 1 -
.../apache/solr/search/QueryWrapperFilter.java | 3 +-
.../java/org/apache/solr/search/RankQuery.java | 31 ++-
.../apache/solr/search/ReRankQParserPlugin.java | 1 -
.../org/apache/solr/search/ScoreFilter.java | 1 -
.../apache/solr/search/SimpleQParserPlugin.java | 3 +-
.../java/org/apache/solr/search/SolrCache.java | 1 -
.../org/apache/solr/search/SolrCacheBase.java | 1 -
.../solr/search/SolrConstantScoreQuery.java | 31 ++-
.../org/apache/solr/search/SolrCoreParser.java | 3 +-
.../apache/solr/search/SolrFieldCacheMBean.java | 1 -
.../java/org/apache/solr/search/SolrFilter.java | 1 -
.../apache/solr/search/SolrIndexSearcher.java | 1 -
.../org/apache/solr/search/SolrQueryParser.java | 1 -
.../solr/search/SolrQueryTimeoutImpl.java | 3 +-
.../java/org/apache/solr/search/SortSpec.java | 1 -
.../org/apache/solr/search/SortSpecParsing.java | 31 ++-
.../org/apache/solr/search/SortedIntDocSet.java | 1 -
.../java/org/apache/solr/search/Sorting.java | 1 -
.../solr/search/SpatialBoxQParserPlugin.java | 1 -
.../solr/search/SpatialFilterQParser.java | 4 +-
.../solr/search/SpatialFilterQParserPlugin.java | 3 +-
.../org/apache/solr/search/SpatialOptions.java | 3 +-
.../java/org/apache/solr/search/StrParser.java | 7 +-
.../solr/search/SurroundQParserPlugin.java | 4 +-
.../org/apache/solr/search/SyntaxError.java | 1 -
.../apache/solr/search/TermsQParserPlugin.java | 3 +-
.../org/apache/solr/search/WrappedQuery.java | 1 -
.../apache/solr/search/XmlQParserPlugin.java | 3 +-
.../solr/search/facet/AggValueSource.java | 3 +-
.../org/apache/solr/search/facet/AvgAgg.java | 3 +-
.../org/apache/solr/search/facet/BlockJoin.java | 4 +-
.../org/apache/solr/search/facet/CountAgg.java | 3 +-
.../solr/search/facet/FacetDebugInfo.java | 1 -
.../apache/solr/search/facet/FacetField.java | 3 +-
.../search/facet/FacetFieldProcessorDV.java | 3 +-
.../facet/FacetFieldProcessorNumeric.java | 3 +-
.../apache/solr/search/facet/FacetMerger.java | 3 +-
.../apache/solr/search/facet/FacetModule.java | 3 +-
.../solr/search/facet/FacetProcessor.java | 3 +-
.../apache/solr/search/facet/FacetQuery.java | 3 +-
.../apache/solr/search/facet/FacetRange.java | 3 +-
.../apache/solr/search/facet/FacetRequest.java | 3 +-
.../org/apache/solr/search/facet/FieldUtil.java | 3 +-
.../org/apache/solr/search/facet/HLLAgg.java | 3 +-
.../apache/solr/search/facet/LegacyFacet.java | 4 +-
.../org/apache/solr/search/facet/MaxAgg.java | 3 +-
.../org/apache/solr/search/facet/MinAgg.java | 3 +-
.../apache/solr/search/facet/PercentileAgg.java | 3 +-
.../solr/search/facet/SimpleAggValueSource.java | 3 +-
.../org/apache/solr/search/facet/SlotAcc.java | 3 +-
.../solr/search/facet/StrAggValueSource.java | 3 +-
.../org/apache/solr/search/facet/SumAgg.java | 3 +-
.../org/apache/solr/search/facet/SumsqAgg.java | 3 +-
.../solr/search/facet/UnInvertedField.java | 1 -
.../org/apache/solr/search/facet/UniqueAgg.java | 3 +-
.../apache/solr/search/facet/UniqueSlotAcc.java | 3 +-
.../search/function/CollapseScoreFunction.java | 1 -
.../solr/search/function/OrdFieldSource.java | 1 -
.../search/function/ReverseOrdFieldSource.java | 1 -
.../search/function/ValueSourceRangeFilter.java | 1 -
.../distance/GeoDistValueSourceParser.java | 3 +-
.../function/distance/GeohashFunction.java | 3 +-
.../distance/GeohashHaversineFunction.java | 4 +-
.../distance/HaversineConstFunction.java | 3 +-
.../function/distance/HaversineFunction.java | 3 +-
.../distance/SquaredEuclideanFunction.java | 3 +-
.../distance/StringDistanceFunction.java | 3 +-
.../distance/VectorDistanceFunction.java | 3 +-
.../apache/solr/search/grouping/Command.java | 3 +-
.../solr/search/grouping/CommandHandler.java | 3 +-
.../search/grouping/GroupingSpecification.java | 3 +-
.../grouping/collector/FilterCollector.java | 3 +-
.../distributed/ShardRequestFactory.java | 3 +-
.../distributed/ShardResponseProcessor.java | 3 +-
.../distributed/command/GroupConverter.java | 3 +-
.../distributed/command/QueryCommand.java | 3 +-
.../distributed/command/QueryCommandResult.java | 3 +-
.../command/SearchGroupsFieldCommand.java | 3 +-
.../command/SearchGroupsFieldCommandResult.java | 3 +-
.../command/TopGroupsFieldCommand.java | 3 +-
.../SearchGroupsRequestFactory.java | 3 +-
.../StoredFieldsShardRequestFactory.java | 3 +-
.../TopGroupsShardRequestFactory.java | 3 +-
.../SearchGroupShardResponseProcessor.java | 3 +-
.../StoredFieldsShardResponseProcessor.java | 3 +-
.../TopGroupsShardResponseProcessor.java | 3 +-
.../SearchGroupsResultTransformer.java | 3 +-
.../ShardResultTransformer.java | 3 +-
.../TopGroupsResultTransformer.java | 3 +-
.../EndResultTransformer.java | 3 +-
.../GroupedEndResultTransformer.java | 3 +-
.../MainEndResultTransformer.java | 3 +-
.../SimpleEndResultTransformer.java | 3 +-
.../apache/solr/search/join/BitSetSlice.java | 1 -
.../solr/search/join/BlockJoinChildQParser.java | 1 -
.../join/BlockJoinChildQParserPlugin.java | 1 -
.../join/BlockJoinDocSetFacetComponent.java | 33 ++-
.../search/join/BlockJoinFacetCollector.java | 3 +-
.../search/join/BlockJoinFacetComponent.java | 3 +-
.../solr/search/join/BlockJoinFacetFilter.java | 3 +-
.../join/BlockJoinFieldFacetAccumulator.java | 3 +-
.../search/join/BlockJoinParentQParser.java | 1 -
.../join/BlockJoinParentQParserPlugin.java | 1 -
.../apache/solr/search/join/FrontierQuery.java | 3 +-
.../solr/search/join/GraphQParserPlugin.java | 3 +-
.../org/apache/solr/search/join/GraphQuery.java | 3 +-
.../solr/search/join/GraphQueryParser.java | 3 +-
.../solr/search/join/GraphTermsCollector.java | 3 +-
.../search/join/ScoreJoinQParserPlugin.java | 1 -
.../solr/search/join/ScoreModeParser.java | 19 +-
.../apache/solr/search/mlt/CloudMLTQParser.java | 3 +-
.../solr/search/mlt/MLTQParserPlugin.java | 3 +-
.../solr/search/mlt/SimpleMLTQParser.java | 3 +-
.../similarities/BM25SimilarityFactory.java | 3 +-
.../similarities/ClassicSimilarityFactory.java | 3 +-
.../similarities/DFISimilarityFactory.java | 3 +-
.../similarities/DFRSimilarityFactory.java | 3 +-
.../similarities/IBSimilarityFactory.java | 3 +-
.../LMDirichletSimilarityFactory.java | 3 +-
.../LMJelinekMercerSimilarityFactory.java | 3 +-
.../similarities/SchemaSimilarityFactory.java | 3 +-
.../SweetSpotSimilarityFactory.java | 3 +-
.../solr/search/stats/CachedSearcherStats.java | 3 +-
.../solr/search/stats/CollectionStats.java | 5 +-
.../search/stats/ExactSharedStatsCache.java | 3 +-
.../solr/search/stats/ExactStatsCache.java | 3 +-
.../apache/solr/search/stats/LRUStatsCache.java | 3 +-
.../solr/search/stats/LocalStatsCache.java | 7 +-
.../solr/search/stats/LocalStatsSource.java | 3 +-
.../apache/solr/search/stats/StatsCache.java | 3 +-
.../apache/solr/search/stats/StatsSource.java | 3 +-
.../org/apache/solr/search/stats/StatsUtil.java | 7 +-
.../org/apache/solr/search/stats/TermStats.java | 3 +-
.../solr/security/AuthenticationPlugin.java | 33 ++-
.../solr/security/AuthorizationContext.java | 3 +-
.../solr/security/AuthorizationPlugin.java | 3 +-
.../solr/security/AuthorizationResponse.java | 3 +-
.../apache/solr/security/BasicAuthPlugin.java | 4 +-
.../solr/security/ConfigEditablePlugin.java | 3 +-
.../security/HttpClientInterceptorPlugin.java | 4 +-
.../apache/solr/security/KerberosFilter.java | 25 ++-
.../apache/solr/security/KerberosPlugin.java | 33 ++-
.../solr/security/PKIAuthenticationPlugin.java | 3 +-
.../security/RuleBasedAuthorizationPlugin.java | 3 +-
.../solr/security/SecurityPluginHolder.java | 4 +-
.../security/Sha256AuthenticationProvider.java | 3 +-
.../org/apache/solr/servlet/BaseSolrFilter.java | 1 -
.../apache/solr/servlet/BaseSolrServlet.java | 1 -
.../solr/servlet/CheckLoggingConfiguration.java | 1 -
.../solr/servlet/DirectSolrConnection.java | 1 -
.../org/apache/solr/servlet/HttpSolrCall.java | 7 +-
.../apache/solr/servlet/LoadAdminUiServlet.java | 1 -
.../apache/solr/servlet/RedirectServlet.java | 1 -
.../org/apache/solr/servlet/ResponseUtils.java | 3 +-
.../apache/solr/servlet/SolrDispatchFilter.java | 1 -
.../apache/solr/servlet/SolrRequestParsers.java | 1 -
.../solr/servlet/cache/HttpCacheHeaderUtil.java | 1 -
.../org/apache/solr/servlet/cache/Method.java | 1 -
.../spelling/AbstractLuceneSpellChecker.java | 5 +-
.../spelling/ConjunctionSolrSpellChecker.java | 3 +-
.../solr/spelling/DirectSolrSpellChecker.java | 3 +-
.../solr/spelling/IndexBasedSpellChecker.java | 3 +-
.../solr/spelling/PossibilityIterator.java | 3 +-
.../apache/solr/spelling/QueryConverter.java | 3 +-
.../org/apache/solr/spelling/ResultEntry.java | 3 +-
.../apache/solr/spelling/SolrSpellChecker.java | 3 +-
.../solr/spelling/SpellCheckCollation.java | 3 +-
.../solr/spelling/SpellCheckCollator.java | 3 +-
.../solr/spelling/SpellCheckCorrection.java | 3 +-
.../apache/solr/spelling/SpellingOptions.java | 17 +-
.../solr/spelling/SpellingQueryConverter.java | 1 -
.../apache/solr/spelling/SpellingResult.java | 3 +-
.../solr/spelling/SuggestQueryConverter.java | 3 +-
.../spelling/WordBreakSolrSpellChecker.java | 3 +-
.../spelling/suggest/DictionaryFactory.java | 3 +-
.../suggest/DocumentDictionaryFactory.java | 3 +-
.../DocumentExpressionDictionaryFactory.java | 3 +-
.../spelling/suggest/FileDictionaryFactory.java | 3 +-
.../suggest/HighFrequencyDictionaryFactory.java | 3 +-
.../solr/spelling/suggest/LookupFactory.java | 3 +-
.../solr/spelling/suggest/SolrSuggester.java | 3 +-
.../apache/solr/spelling/suggest/Suggester.java | 1 -
.../solr/spelling/suggest/SuggesterOptions.java | 3 +-
.../solr/spelling/suggest/SuggesterParams.java | 3 +-
.../solr/spelling/suggest/SuggesterResult.java | 3 +-
.../fst/AnalyzingInfixLookupFactory.java | 3 +-
.../suggest/fst/AnalyzingLookupFactory.java | 3 +-
.../suggest/fst/BlendedInfixLookupFactory.java | 3 +-
.../spelling/suggest/fst/FSTLookupFactory.java | 3 +-
.../suggest/fst/FreeTextLookupFactory.java | 23 +--
.../suggest/fst/FuzzyLookupFactory.java | 3 +-
.../spelling/suggest/fst/WFSTLookupFactory.java | 3 +-
.../suggest/jaspell/JaspellLookupFactory.java | 7 +-
.../spelling/suggest/tst/TSTLookupFactory.java | 3 +-
.../solr/store/blockcache/BlockCache.java | 3 +-
.../solr/store/blockcache/BlockCacheKey.java | 4 +-
.../store/blockcache/BlockCacheLocation.java | 3 +-
.../solr/store/blockcache/BlockDirectory.java | 3 +-
.../store/blockcache/BlockDirectoryCache.java | 3 +-
.../solr/store/blockcache/BlockLocks.java | 3 +-
.../solr/store/blockcache/BufferStore.java | 3 +-
.../org/apache/solr/store/blockcache/Cache.java | 3 +-
.../store/blockcache/CachedIndexOutput.java | 3 +-
.../blockcache/CustomBufferedIndexInput.java | 3 +-
.../apache/solr/store/blockcache/Metrics.java | 3 +-
.../blockcache/ReusedBufferedIndexOutput.java | 3 +-
.../org/apache/solr/store/blockcache/Store.java | 3 +-
.../apache/solr/store/hdfs/HdfsDirectory.java | 3 +-
.../apache/solr/store/hdfs/HdfsFileReader.java | 3 +-
.../apache/solr/store/hdfs/HdfsFileWriter.java | 3 +-
.../solr/store/hdfs/HdfsLocalityReporter.java | 3 +-
.../apache/solr/store/hdfs/HdfsLockFactory.java | 3 +-
.../apache/solr/update/AddUpdateCommand.java | 1 -
.../apache/solr/update/CdcrTransactionLog.java | 3 +-
.../org/apache/solr/update/CdcrUpdateLog.java | 3 +-
.../org/apache/solr/update/CommitTracker.java | 7 +-
.../apache/solr/update/CommitUpdateCommand.java | 1 -
.../solr/update/DefaultSolrCoreState.java | 3 +-
.../solr/update/DeleteByQueryWrapper.java | 3 +-
.../apache/solr/update/DeleteUpdateCommand.java | 1 -
.../solr/update/DirectUpdateHandler2.java | 1 -
.../org/apache/solr/update/DocumentBuilder.java | 1 -
.../apache/solr/update/HdfsTransactionLog.java | 23 +--
.../org/apache/solr/update/HdfsUpdateLog.java | 1 -
.../apache/solr/update/IndexFingerprint.java | 200 +++++++++++++++++++
.../apache/solr/update/LoggingInfoStream.java | 1 -
.../org/apache/solr/update/MemOutputStream.java | 1 -
.../apache/solr/update/MergeIndexesCommand.java | 1 -
.../java/org/apache/solr/update/PeerSync.java | 79 ++++++--
.../solr/update/RollbackUpdateCommand.java | 1 -
.../apache/solr/update/SolrCmdDistributor.java | 3 +-
.../org/apache/solr/update/SolrCoreState.java | 3 +-
.../org/apache/solr/update/SolrIndexConfig.java | 1 -
.../apache/solr/update/SolrIndexSplitter.java | 1 -
.../org/apache/solr/update/SolrIndexWriter.java | 1 -
.../apache/solr/update/SplitIndexCommand.java | 1 -
.../solr/update/StreamingSolrClients.java | 3 +-
.../org/apache/solr/update/TransactionLog.java | 1 -
.../org/apache/solr/update/UpdateCommand.java | 1 -
.../org/apache/solr/update/UpdateHandler.java | 1 -
.../java/org/apache/solr/update/UpdateLog.java | 7 +-
.../apache/solr/update/UpdateShardHandler.java | 3 +-
.../solr/update/UpdateShardHandlerConfig.java | 3 +-
.../org/apache/solr/update/VersionBucket.java | 1 -
.../org/apache/solr/update/VersionInfo.java | 1 -
...tractDefaultValueUpdateProcessorFactory.java | 1 -
.../AddSchemaFieldsUpdateProcessorFactory.java | 1 -
...aluesOrNoneFieldMutatingUpdateProcessor.java | 1 -
.../processor/AtomicUpdateDocumentMerger.java | 7 +-
.../update/processor/CdcrUpdateProcessor.java | 3 +-
.../processor/CdcrUpdateProcessorFactory.java | 3 +-
.../ConcatFieldUpdateProcessorFactory.java | 1 -
.../CountFieldValuesUpdateProcessorFactory.java | 1 -
.../DefaultValueUpdateProcessorFactory.java | 1 -
.../processor/DistributedUpdateProcessor.java | 7 +-
.../DistributedUpdateProcessorFactory.java | 3 +-
.../DistributingUpdateProcessorFactory.java | 1 -
...BasedVersionConstraintsProcessorFactory.java | 1 -
.../DocExpirationUpdateProcessorFactory.java | 1 -
.../FieldLengthUpdateProcessorFactory.java | 1 -
.../processor/FieldMutatingUpdateProcessor.java | 1 -
.../FieldMutatingUpdateProcessorFactory.java | 1 -
...FieldNameMutatingUpdateProcessorFactory.java | 4 +-
.../FieldValueMutatingUpdateProcessor.java | 1 -
.../FieldValueSubsetUpdateProcessorFactory.java | 1 -
.../FirstFieldValueUpdateProcessorFactory.java | 1 -
.../HTMLStripFieldUpdateProcessorFactory.java | 1 -
...oreCommitOptimizeUpdateProcessorFactory.java | 1 -
.../IgnoreFieldUpdateProcessorFactory.java | 1 -
.../LastFieldValueUpdateProcessorFactory.java | 1 -
.../processor/LogUpdateProcessorFactory.java | 1 -
.../solr/update/processor/Lookup3Signature.java | 3 +-
.../solr/update/processor/MD5Signature.java | 3 +-
.../MaxFieldValueUpdateProcessorFactory.java | 1 -
.../MinFieldValueUpdateProcessorFactory.java | 1 -
.../NoOpDistributingUpdateProcessorFactory.java | 1 -
...ParseBooleanFieldUpdateProcessorFactory.java | 1 -
.../ParseDateFieldUpdateProcessorFactory.java | 1 -
.../ParseDoubleFieldUpdateProcessorFactory.java | 1 -
.../ParseFloatFieldUpdateProcessorFactory.java | 1 -
.../ParseIntFieldUpdateProcessorFactory.java | 1 -
.../ParseLongFieldUpdateProcessorFactory.java | 1 -
...ParseNumericFieldUpdateProcessorFactory.java | 1 -
.../PreAnalyzedUpdateProcessorFactory.java | 33 ++-
.../RemoveBlankFieldUpdateProcessorFactory.java | 1 -
.../processor/RunUpdateProcessorFactory.java | 1 -
.../processor/ScriptEngineCustomizer.java | 1 -
.../apache/solr/update/processor/Signature.java | 3 +-
.../SignatureUpdateProcessorFactory.java | 3 +-
.../processor/SimpleUpdateProcessorFactory.java | 3 +-
.../StatelessScriptUpdateProcessorFactory.java | 3 +-
.../update/processor/TextProfileSignature.java | 3 +-
.../TimestampUpdateProcessorFactory.java | 1 -
.../TrimFieldUpdateProcessorFactory.java | 1 -
.../TruncateFieldUpdateProcessorFactory.java | 1 -
.../processor/UUIDUpdateProcessorFactory.java | 1 -
.../UniqFieldsUpdateProcessorFactory.java | 3 +-
.../processor/UpdateRequestProcessor.java | 1 -
.../processor/UpdateRequestProcessorChain.java | 1 -
.../UpdateRequestProcessorFactory.java | 1 -
.../apache/solr/util/AdjustableSemaphore.java | 3 +-
.../org/apache/solr/util/BoundedTreeSet.java | 2 -
.../org/apache/solr/util/CommandOperation.java | 3 +-
.../apache/solr/util/ConcurrentLFUCache.java | 3 +-
.../apache/solr/util/ConcurrentLRUCache.java | 3 +-
.../java/org/apache/solr/util/CryptoKeys.java | 3 +-
.../src/java/org/apache/solr/util/DOMUtil.java | 3 +-
.../org/apache/solr/util/DateFormatUtil.java | 3 +-
.../org/apache/solr/util/DateMathParser.java | 1 -
.../solr/util/DefaultSolrThreadFactory.java | 3 +-
.../org/apache/solr/util/DistanceUnits.java | 19 +-
.../java/org/apache/solr/util/FSHDFSUtils.java | 3 +-
.../java/org/apache/solr/util/FastWriter.java | 3 +-
.../java/org/apache/solr/util/FileUtils.java | 3 +-
.../src/java/org/apache/solr/util/HdfsUtil.java | 17 +-
.../org/apache/solr/util/LongPriorityQueue.java | 7 +-
.../java/org/apache/solr/util/MapListener.java | 3 +-
.../java/org/apache/solr/util/NumberUtils.java | 1 -
.../org/apache/solr/util/PivotListEntry.java | 3 +-
.../java/org/apache/solr/util/PrimUtils.java | 3 +-
.../apache/solr/util/PropertiesInputStream.java | 3 +-
.../solr/util/PropertiesOutputStream.java | 3 +-
.../org/apache/solr/util/PropertiesUtil.java | 3 +-
.../src/java/org/apache/solr/util/RTimer.java | 3 +-
.../java/org/apache/solr/util/RTimerTree.java | 3 +-
.../apache/solr/util/RecordingJSONParser.java | 4 +-
.../java/org/apache/solr/util/RefCounted.java | 1 -
.../org/apache/solr/util/RegexFileFilter.java | 3 +-
.../org/apache/solr/util/SimplePostTool.java | 3 +-
.../src/java/org/apache/solr/util/SolrCLI.java | 3 +-
.../org/apache/solr/util/SolrLogLayout.java | 33 ++-
.../org/apache/solr/util/SolrPluginUtils.java | 1 -
.../java/org/apache/solr/util/SpatialUtils.java | 3 +-
.../org/apache/solr/util/SystemIdResolver.java | 3 +-
.../org/apache/solr/util/TestInjection.java | 3 +-
.../src/java/org/apache/solr/util/TimeOut.java | 3 +-
.../org/apache/solr/util/TimeZoneUtils.java | 1 -
.../org/apache/solr/util/VersionedFile.java | 1 -
.../hll/BigEndianAscendingWordDeserializer.java | 3 +-
.../hll/BigEndianAscendingWordSerializer.java | 3 +-
.../java/org/apache/solr/util/hll/BitUtil.java | 3 +-
.../org/apache/solr/util/hll/BitVector.java | 3 +-
.../src/java/org/apache/solr/util/hll/HLL.java | 3 +-
.../org/apache/solr/util/hll/HLLMetadata.java | 3 +-
.../java/org/apache/solr/util/hll/HLLType.java | 3 +-
.../java/org/apache/solr/util/hll/HLLUtil.java | 3 +-
.../org/apache/solr/util/hll/IHLLMetadata.java | 3 +-
.../apache/solr/util/hll/ISchemaVersion.java | 3 +-
.../apache/solr/util/hll/IWordDeserializer.java | 3 +-
.../apache/solr/util/hll/IWordSerializer.java | 3 +-
.../org/apache/solr/util/hll/LongIterator.java | 3 +-
.../org/apache/solr/util/hll/NumberUtil.java | 3 +-
.../apache/solr/util/hll/SchemaVersionOne.java | 3 +-
.../apache/solr/util/hll/SerializationUtil.java | 3 +-
.../solr/util/plugin/AbstractPluginLoader.java | 1 -
.../solr/util/plugin/MapInitializedPlugin.java | 1 -
.../solr/util/plugin/MapPluginLoader.java | 1 -
.../util/plugin/NamedListInitializedPlugin.java | 1 -
.../solr/util/plugin/NamedListPluginLoader.java | 1 -
.../apache/solr/util/plugin/SolrCoreAware.java | 1 -
.../java/org/apache/solr/util/stats/Clock.java | 1 -
.../java/org/apache/solr/util/stats/EWMA.java | 1 -
.../util/stats/ExponentiallyDecayingSample.java | 1 -
.../org/apache/solr/util/stats/Histogram.java | 1 -
.../java/org/apache/solr/util/stats/Meter.java | 1 -
.../java/org/apache/solr/util/stats/Sample.java | 1 -
.../org/apache/solr/util/stats/Snapshot.java | 1 -
.../java/org/apache/solr/util/stats/Timer.java | 1 -
.../apache/solr/util/stats/TimerContext.java | 1 -
.../apache/solr/util/stats/UniformSample.java | 1 -
.../solr/util/xslt/TransformerProvider.java | 1 -
.../runtimecode/RuntimeLibReqHandler.java | 4 +-
.../runtimecode/RuntimeLibResponseWriter.java | 18 +-
.../runtimecode/RuntimeLibSearchComponent.java | 4 +-
.../solr/AnalysisAfterCoreReloadTest.java | 3 +-
.../org/apache/solr/BasicFunctionalityTest.java | 1 -
.../org/apache/solr/ConvertedLegacyTest.java | 1 -
.../test/org/apache/solr/CursorPagingTest.java | 1 -
.../apache/solr/DisMaxRequestHandlerTest.java | 1 -
.../solr/DistributedIntervalFacetingTest.java | 28 +--
.../test/org/apache/solr/EchoParamsTest.java | 1 -
.../test/org/apache/solr/MinimalSchemaTest.java | 1 -
.../test/org/apache/solr/OutputWriterTest.java | 1 -
.../src/test/org/apache/solr/SampleTest.java | 1 -
.../org/apache/solr/SolrTestCaseJ4Test.java | 3 +-
.../test/org/apache/solr/TestCrossCoreJoin.java | 1 -
.../solr/TestCursorMarkWithoutUniqueKey.java | 1 -
.../apache/solr/TestDistributedGrouping.java | 3 +-
.../apache/solr/TestDistributedMissingSort.java | 1 -
.../org/apache/solr/TestDistributedSearch.java | 1 -
.../org/apache/solr/TestDocumentBuilder.java | 4 +-
.../org/apache/solr/TestGroupingSearch.java | 1 -
.../apache/solr/TestHighlightDedupGrouping.java | 1 -
.../core/src/test/org/apache/solr/TestJoin.java | 1 -
.../org/apache/solr/TestRandomDVFaceting.java | 1 -
.../org/apache/solr/TestRandomFaceting.java | 1 -
.../solr/TestSimpleTrackingShardHandler.java | 1 -
.../org/apache/solr/TestTolerantSearch.java | 33 ++-
.../PathHierarchyTokenizerFactoryTest.java | 1 -
.../apache/solr/analysis/TestCharFilters.java | 3 +-
.../TestReversedWildcardFilterFactory.java | 3 +-
.../TestWordDelimiterFilterFactory.java | 3 +-
.../ThrowingMockTokenFilterFactory.java | 3 +-
.../solr/client/solrj/ConnectionReuseTest.java | 3 +-
.../TestEmbeddedSolrServerConstructors.java | 3 +-
.../solrj/embedded/TestJettySolrRunner.java | 3 +-
.../apache/solr/cloud/ActionThrottleTest.java | 3 +-
.../apache/solr/cloud/AliasIntegrationTest.java | 3 +-
.../test/org/apache/solr/cloud/AssignTest.java | 3 +-
.../AsyncCallRequestStatusResponseTest.java | 3 +-
.../solr/cloud/AsyncMigrateRouteKeyTest.java | 3 +-
.../solr/cloud/BaseCdcrDistributedZkTest.java | 3 +-
.../solr/cloud/BasicDistributedZk2Test.java | 3 +-
.../solr/cloud/BasicDistributedZkTest.java | 3 +-
.../test/org/apache/solr/cloud/BasicZkTest.java | 3 +-
.../cloud/CdcrReplicationDistributedZkTest.java | 3 +-
.../solr/cloud/CdcrReplicationHandlerTest.java | 3 +-
.../solr/cloud/CdcrRequestHandlerTest.java | 3 +-
.../solr/cloud/CdcrVersionReplicationTest.java | 3 +-
.../cloud/ChaosMonkeyNothingIsSafeTest.java | 3 +-
.../solr/cloud/ChaosMonkeySafeLeaderTest.java | 3 +-
.../solr/cloud/ChaosMonkeyShardSplitTest.java | 3 +-
.../apache/solr/cloud/CleanupOldIndexTest.java | 3 +-
.../cloud/CloudExitableDirectoryReaderTest.java | 34 ++--
.../org/apache/solr/cloud/ClusterStateTest.java | 27 ++-
.../solr/cloud/ClusterStateUpdateTest.java | 3 +-
.../apache/solr/cloud/CollectionReloadTest.java | 3 +-
.../solr/cloud/CollectionStateFormat2Test.java | 3 +-
.../cloud/CollectionTooManyReplicasTest.java | 3 +-
.../CollectionsAPIAsyncDistributedZkTest.java | 3 +-
.../cloud/CollectionsAPIDistributedZkTest.java | 3 +-
.../solr/cloud/CollectionsAPISolrJTests.java | 3 +-
...ConcurrentDeleteAndCreateCollectionTest.java | 3 +-
.../apache/solr/cloud/ConfigSetsAPITest.java | 3 +-
.../solr/cloud/ConnectionManagerTest.java | 27 ++-
.../apache/solr/cloud/CustomCollectionTest.java | 3 +-
.../solr/cloud/DeleteInactiveReplicaTest.java | 3 +-
.../DeleteLastCustomShardedReplicaTest.java | 3 +-
.../apache/solr/cloud/DeleteReplicaTest.java | 3 +-
.../org/apache/solr/cloud/DeleteShardTest.java | 3 +-
.../cloud/DistribJoinFromCollectionTest.java | 3 +-
.../apache/solr/cloud/DistributedQueueTest.java | 22 +-
.../solr/cloud/DistributedVersionInfoTest.java | 3 +-
.../org/apache/solr/cloud/ForceLeaderTest.java | 3 +-
.../cloud/FullSolrCloudDistribCmdsTest.java | 3 +-
.../apache/solr/cloud/HttpPartitionTest.java | 3 +-
.../org/apache/solr/cloud/KerberosTestUtil.java | 29 ++-
.../cloud/LeaderElectionIntegrationTest.java | 3 +-
.../apache/solr/cloud/LeaderElectionTest.java | 28 ++-
.../cloud/LeaderFailoverAfterPartitionTest.java | 3 +-
.../LeaderInitiatedRecoveryOnCommitTest.java | 3 +-
...aderInitiatedRecoveryOnShardRestartTest.java | 3 +-
.../apache/solr/cloud/MigrateRouteKeyTest.java | 3 +-
.../apache/solr/cloud/MultiThreadedOCPTest.java | 3 +-
...utOfBoxZkACLAndCredentialsProvidersTest.java | 33 ++-
...rriddenZkACLAndCredentialsProvidersTest.java | 33 ++-
...verseerCollectionConfigSetProcessorTest.java | 3 +-
.../apache/solr/cloud/OverseerRolesTest.java | 4 +-
.../apache/solr/cloud/OverseerStatusTest.java | 3 +-
.../solr/cloud/OverseerTaskQueueTest.java | 22 +-
.../org/apache/solr/cloud/OverseerTest.java | 3 +-
.../solr/cloud/RecoveryAfterSoftCommitTest.java | 3 +-
.../org/apache/solr/cloud/RecoveryZkTest.java | 3 +-
.../apache/solr/cloud/RemoteQueryErrorTest.java | 3 +-
.../solr/cloud/ReplicaPropertiesBase.java | 3 +-
.../solr/cloud/ReplicationFactorTest.java | 3 +-
.../solr/cloud/RestartWhileUpdatingTest.java | 3 +-
.../apache/solr/cloud/RollingRestartTest.java | 3 +-
.../org/apache/solr/cloud/SSLMigrationTest.java | 3 +-
.../solr/cloud/SaslZkACLProviderTest.java | 33 ++-
.../solr/cloud/ShardRoutingCustomTest.java | 3 +-
.../org/apache/solr/cloud/ShardRoutingTest.java | 3 +-
.../org/apache/solr/cloud/ShardSplitTest.java | 3 +-
.../cloud/SharedFSAutoReplicaFailoverTest.java | 3 +-
.../SharedFSAutoReplicaFailoverUtilsTest.java | 3 +-
.../cloud/SimpleCollectionCreateDeleteTest.java | 3 +-
.../org/apache/solr/cloud/SliceStateTest.java | 27 ++-
.../apache/solr/cloud/SolrCloudExampleTest.java | 3 +-
.../org/apache/solr/cloud/SolrXmlInZkTest.java | 22 +-
.../org/apache/solr/cloud/SyncSliceTest.java | 3 +-
.../solr/cloud/TestAuthenticationFramework.java | 3 +-
.../apache/solr/cloud/TestCloudInspectUtil.java | 7 +-
.../apache/solr/cloud/TestCollectionAPI.java | 4 +-
.../apache/solr/cloud/TestConfigSetsAPI.java | 1 -
.../cloud/TestConfigSetsAPIExclusivity.java | 1 -
.../solr/cloud/TestConfigSetsAPIZkFailure.java | 1 -
.../org/apache/solr/cloud/TestCryptoKeys.java | 3 +-
.../solr/cloud/TestDistribDocBasedVersion.java | 3 +-
.../solr/cloud/TestDownShardTolerantSearch.java | 3 +-
.../TestExclusionRuleCollectionAccess.java | 3 +-
.../apache/solr/cloud/TestHashPartitioner.java | 27 ++-
.../solr/cloud/TestLeaderElectionZkExpiry.java | 3 +-
.../TestLeaderInitiatedRecoveryThread.java | 31 ++-
.../solr/cloud/TestMiniSolrCloudCluster.java | 3 +-
.../cloud/TestMiniSolrCloudClusterBase.java | 4 +-
.../cloud/TestMiniSolrCloudClusterKerberos.java | 3 +-
.../solr/cloud/TestMiniSolrCloudClusterSSL.java | 3 +-
.../cloud/TestRandomRequestDistribution.java | 3 +-
.../apache/solr/cloud/TestRebalanceLeaders.java | 3 +-
.../solr/cloud/TestReplicaProperties.java | 4 +-
.../solr/cloud/TestRequestForwarding.java | 3 +-
.../cloud/TestRequestStatusCollectionAPI.java | 3 +-
.../solr/cloud/TestShortCircuitedRequests.java | 3 +-
.../cloud/TestSolrCloudWithKerberosAlt.java | 3 +-
.../org/apache/solr/cloud/TestZkChroot.java | 3 +-
.../TlogReplayBufferedWhileIndexingTest.java | 136 +++++++++++++
.../cloud/TriLevelCompositeIdRoutingTest.java | 3 +-
.../solr/cloud/UnloadDistributedZkTest.java | 3 +-
...MParamsZkACLAndCredentialsProvidersTest.java | 33 ++-
.../test/org/apache/solr/cloud/ZkCLITest.java | 3 +-
.../org/apache/solr/cloud/ZkControllerTest.java | 28 ++-
.../org/apache/solr/cloud/ZkNodePropsTest.java | 27 ++-
.../org/apache/solr/cloud/ZkSolrClientTest.java | 27 ++-
.../cloud/hdfs/HdfsBasicDistributedZk2Test.java | 3 +-
.../cloud/hdfs/HdfsBasicDistributedZkTest.java | 3 +-
.../hdfs/HdfsChaosMonkeyNothingIsSafeTest.java | 3 +-
.../hdfs/HdfsChaosMonkeySafeLeaderTest.java | 3 +-
.../HdfsCollectionsAPIDistributedZkTest.java | 3 +-
.../solr/cloud/hdfs/HdfsNNFailoverTest.java | 1 -
.../solr/cloud/hdfs/HdfsRecoverLeaseTest.java | 3 +-
.../solr/cloud/hdfs/HdfsRecoveryZkTest.java | 3 +-
.../hdfs/HdfsRestartWhileUpdatingTest.java | 3 +-
.../solr/cloud/hdfs/HdfsSyncSliceTest.java | 3 +-
.../apache/solr/cloud/hdfs/HdfsTestUtil.java | 33 ++-
.../solr/cloud/hdfs/HdfsThreadLeakTest.java | 3 +-
...HdfsTlogReplayBufferedWhileIndexingTest.java | 63 ++++++
.../cloud/hdfs/HdfsUnloadDistributedZkTest.java | 3 +-
.../HdfsWriteToMultipleCollectionsTest.java | 1 -
.../apache/solr/cloud/hdfs/StressHdfsTest.java | 1 -
.../cloud/overseer/TestClusterStateMutator.java | 3 +-
.../solr/cloud/overseer/ZkStateReaderTest.java | 3 +-
.../solr/cloud/overseer/ZkStateWriterTest.java | 3 +-
.../apache/solr/cloud/rule/RuleEngineTest.java | 3 +-
.../org/apache/solr/cloud/rule/RulesTest.java | 7 +-
.../solr/core/BlobStoreTestRequestHandler.java | 4 +-
.../solr/core/CachingDirectoryFactoryTest.java | 33 ++-
.../solr/core/CountUsageValueSourceParser.java | 3 +-
.../apache/solr/core/DirectoryFactoryTest.java | 1 -
.../solr/core/DummyValueSourceParser.java | 3 +-
.../solr/core/ExitableDirectoryReaderTest.java | 4 +-
.../solr/core/HdfsDirectoryFactoryTest.java | 1 -
.../org/apache/solr/core/MockInfoMBean.java | 13 +-
.../solr/core/MockShardHandlerFactory.java | 3 +-
.../solr/core/OpenCloseCoreStressTest.java | 1 -
.../org/apache/solr/core/PluginInfoTest.java | 3 +-
.../apache/solr/core/QueryResultKeyTest.java | 1 -
.../solr/core/RAMDirectoryFactoryTest.java | 1 -
.../apache/solr/core/RequestHandlersTest.java | 1 -
.../apache/solr/core/ResourceLoaderTest.java | 1 -
.../test/org/apache/solr/core/SOLR749Test.java | 3 +-
.../core/SolrCoreCheckLockOnStartupTest.java | 3 +-
.../test/org/apache/solr/core/SolrCoreTest.java | 1 -
.../org/apache/solr/core/TestBadConfig.java | 1 -
.../org/apache/solr/core/TestCodecSupport.java | 3 +-
.../test/org/apache/solr/core/TestConfig.java | 1 -
.../org/apache/solr/core/TestConfigOverlay.java | 3 +-
.../solr/core/TestConfigSetImmutable.java | 3 +-
.../solr/core/TestConfigSetProperties.java | 3 +-
.../org/apache/solr/core/TestConfigSets.java | 3 +-
.../org/apache/solr/core/TestCoreContainer.java | 1 -
.../org/apache/solr/core/TestCoreDiscovery.java | 3 +-
.../apache/solr/core/TestDynamicLoading.java | 4 +-
.../solr/core/TestImplicitCoreProperties.java | 32 +--
.../apache/solr/core/TestInfoStreamLogging.java | 3 +-
.../org/apache/solr/core/TestInitParams.java | 3 +-
.../org/apache/solr/core/TestLazyCores.java | 3 +-
.../apache/solr/core/TestMergePolicyConfig.java | 3 +-
.../test/org/apache/solr/core/TestNRTOpen.java | 3 +-
.../solr/core/TestQuerySenderListener.java | 1 -
.../solr/core/TestQuerySenderNoQuery.java | 3 +-
.../solr/core/TestReloadAndDeleteDocs.java | 1 -
.../solr/core/TestShardHandlerFactory.java | 1 -
.../apache/solr/core/TestSolrConfigHandler.java | 4 +-
.../apache/solr/core/TestSolrIndexConfig.java | 3 +-
.../test/org/apache/solr/core/TestSolrXml.java | 3 +-
.../apache/solr/core/TestXIncludeConfig.java | 3 +-
.../handler/AnalysisRequestHandlerTestBase.java | 1 -
.../solr/handler/CSVRequestHandlerTest.java | 1 -
.../apache/solr/handler/CheckBackupStatus.java | 3 +-
.../DocumentAnalysisRequestHandlerTest.java | 1 -
.../FieldAnalysisRequestHandlerTest.java | 1 -
.../org/apache/solr/handler/JsonLoaderTest.java | 1 -
.../solr/handler/MoreLikeThisHandlerTest.java | 1 -
.../solr/handler/PingRequestHandlerTest.java | 1 -
.../apache/solr/handler/RequestLoggingTest.java | 3 +-
.../handler/StandardRequestHandlerTest.java | 1 -
.../apache/solr/handler/TestBlobHandler.java | 3 +-
.../org/apache/solr/handler/TestCSVLoader.java | 1 -
.../apache/solr/handler/TestConfigReload.java | 3 +-
.../handler/TestReplicationHandlerBackup.java | 3 +-
.../apache/solr/handler/TestReqParamsAPI.java | 33 ++-
.../apache/solr/handler/TestRestoreCore.java | 4 +-
.../org/apache/solr/handler/TestSQLHandler.java | 3 +-
.../handler/TestSolrConfigHandlerCloud.java | 4 +-
.../TestSolrConfigHandlerConcurrent.java | 3 +-
.../handler/ThrowErrorOnInitRequestHandler.java | 1 -
.../admin/CoreAdminCreateDiscoverTest.java | 1 -
.../handler/admin/CoreAdminHandlerTest.java | 1 -
.../admin/CoreAdminRequestStatusTest.java | 3 +-
.../admin/CoreMergeIndexesAdminHandlerTest.java | 3 +-
.../solr/handler/admin/InfoHandlerTest.java | 1 -
.../solr/handler/admin/LoggingHandlerTest.java | 1 -
.../handler/admin/LukeRequestHandlerTest.java | 1 -
.../solr/handler/admin/MBeansHandlerTest.java | 1 -
.../handler/admin/SecurityConfHandlerTest.java | 4 +-
.../admin/SegmentsInfoRequestHandlerTest.java | 3 +-
.../admin/ShowFileRequestHandlerTest.java | 3 +-
.../handler/admin/SystemInfoHandlerTest.java | 1 -
.../handler/component/BadComponentTest.java | 5 +-
.../handler/component/DebugComponentTest.java | 3 +-
.../DistributedDebugComponentTest.java | 33 ++-
.../DistributedExpandComponentTest.java | 3 +-
.../DistributedFacetPivotLargeTest.java | 3 +-
.../DistributedFacetPivotLongTailTest.java | 3 +-
.../DistributedFacetPivotSmallAdvancedTest.java | 3 +-
.../DistributedFacetPivotSmallTest.java | 3 +-
.../DistributedFacetPivotWhiteBoxTest.java | 3 +-
.../component/DistributedMLTComponentTest.java | 3 +-
...DistributedQueryComponentCustomSortTest.java | 3 +-
...stributedQueryComponentOptimizationTest.java | 3 +-
.../DistributedQueryElevationComponentTest.java | 3 +-
.../DistributedSpellCheckComponentTest.java | 3 +-
.../DistributedSuggestComponentTest.java | 3 +-
.../DistributedTermsComponentTest.java | 3 +-
.../component/DummyCustomParamSpellChecker.java | 26 ++-
.../handler/component/FacetPivotSmallTest.java | 3 +-
.../component/QueryElevationComponentTest.java | 1 -
.../component/ResponseLogComponentTest.java | 17 +-
.../handler/component/SearchHandlerTest.java | 1 -
.../component/SpatialHeatmapFacetsTest.java | 3 +-
.../component/SpellCheckComponentTest.java | 1 -
.../handler/component/StatsComponentTest.java | 3 +-
.../SuggestComponentContextFilterQueryTest.java | 3 +-
.../handler/component/SuggestComponentTest.java | 3 +-
.../TermVectorComponentDistributedTest.java | 1 -
.../component/TermVectorComponentTest.java | 18 +-
.../handler/component/TermsComponentTest.java | 3 +-
...estDistributedStatsComponentCardinality.java | 7 +-
.../handler/component/TestExpandComponent.java | 31 ++-
.../handler/component/TestPivotHelperCode.java | 5 +-
.../TestTrackingShardHandlerFactory.java | 3 +-
.../solr/handler/loader/JavabinLoaderTest.java | 3 +-
.../highlight/FastVectorHighlighterTest.java | 1 -
.../highlight/HighlighterMaxOffsetTest.java | 3 +-
.../apache/solr/highlight/HighlighterTest.java | 1 -
.../highlight/TestPostingsSolrHighlighter.java | 3 +-
.../solr/index/hdfs/CheckHdfsIndexTest.java | 3 +-
.../apache/solr/internal/csv/CSVParserTest.java | 6 +-
.../solr/internal/csv/CSVPrinterTest.java | 6 +-
.../solr/internal/csv/CSVStrategyTest.java | 6 +-
.../apache/solr/internal/csv/CSVUtilsTest.java | 6 +-
.../solr/internal/csv/CharBufferTest.java | 26 ++-
.../csv/ExtendedBufferedReaderTest.java | 6 +-
.../csv/writer/CSVConfigGuesserTest.java | 26 ++-
.../solr/internal/csv/writer/CSVConfigTest.java | 26 ++-
.../solr/internal/csv/writer/CSVFieldTest.java | 26 ++-
.../solr/internal/csv/writer/CSVWriterTest.java | 26 ++-
.../org/apache/solr/logging/TestLogWatcher.java | 3 +-
.../org/apache/solr/request/JSONWriterTest.java | 1 -
.../apache/solr/request/SimpleFacetsTest.java | 1 -
.../apache/solr/request/SmileWriterTest.java | 4 +-
.../org/apache/solr/request/TestFaceting.java | 1 -
.../solr/request/TestIntervalFaceting.java | 1 -
.../solr/request/TestRemoteStreaming.java | 3 +-
.../org/apache/solr/request/TestWriterPerf.java | 1 -
.../apache/solr/request/macro/TestMacros.java | 4 +-
.../solr/response/TestCSVResponseWriter.java | 1 -
.../solr/response/TestChildDocTransformer.java | 3 +-
.../solr/response/TestCustomDocTransformer.java | 3 +-
.../TestPHPSerializedResponseWriter.java | 1 -
.../solr/response/TestRawResponseWriter.java | 1 -
.../solr/response/TestRawTransformer.java | 3 +-
.../solr/response/TestSolrQueryResponse.java | 3 +-
.../response/TestSortingResponseWriter.java | 1 -
.../apache/solr/rest/SolrRestletTestBase.java | 3 +-
.../apache/solr/rest/TestManagedResource.java | 3 +-
.../solr/rest/TestManagedResourceStorage.java | 3 +-
.../org/apache/solr/rest/TestRestManager.java | 3 +-
.../solr/rest/schema/TestBulkSchemaAPI.java | 3 +-
.../rest/schema/TestClassNameShortening.java | 3 +-
.../schema/TestCopyFieldCollectionResource.java | 3 +-
.../schema/TestDefaultSearchFieldResource.java | 3 +-
.../TestDynamicFieldCollectionResource.java | 3 +-
.../rest/schema/TestDynamicFieldResource.java | 3 +-
.../schema/TestFieldCollectionResource.java | 3 +-
.../solr/rest/schema/TestFieldResource.java | 3 +-
.../schema/TestFieldTypeCollectionResource.java | 3 +-
.../solr/rest/schema/TestFieldTypeResource.java | 4 +-
.../TestManagedSchemaDynamicFieldResource.java | 3 +-
.../schema/TestManagedSchemaFieldResource.java | 3 +-
.../TestManagedSchemaFieldTypeResource.java | 3 +-
.../schema/TestRemoveLastDynamicCopyField.java | 4 +-
.../rest/schema/TestSchemaNameResource.java | 3 +-
.../solr/rest/schema/TestSchemaResource.java | 4 +-
.../schema/TestSchemaSimilarityResource.java | 3 +-
.../rest/schema/TestSchemaVersionResource.java | 3 +-
.../TestSerializedLuceneMatchVersion.java | 3 +-
...tSolrQueryParserDefaultOperatorResource.java | 3 +-
.../schema/TestSolrQueryParserResource.java | 3 +-
.../rest/schema/TestUniqueKeyFieldResource.java | 3 +-
.../analysis/TestManagedStopFilterFactory.java | 3 +-
.../TestManagedSynonymFilterFactory.java | 3 +-
.../solr/schema/AbstractCurrencyFieldTest.java | 3 +-
.../apache/solr/schema/BadCopyFieldTest.java | 1 -
.../apache/solr/schema/BadIndexSchemaTest.java | 1 -
.../solr/schema/ChangedSchemaMergeTest.java | 1 -
.../org/apache/solr/schema/CopyFieldTest.java | 1 -
.../schema/CurrencyFieldOpenExchangeTest.java | 3 +-
.../solr/schema/CurrencyFieldXmlFileTest.java | 3 +-
.../solr/schema/CustomAnalyzerStrField.java | 3 +-
.../org/apache/solr/schema/DateFieldTest.java | 1 -
.../apache/solr/schema/DateRangeFieldTest.java | 5 +-
.../solr/schema/DocValuesMissingTest.java | 3 +-
.../apache/solr/schema/DocValuesMultiTest.java | 3 +-
.../org/apache/solr/schema/DocValuesTest.java | 3 +-
.../org/apache/solr/schema/EnumFieldTest.java | 3 +-
.../solr/schema/ExternalFileFieldSortTest.java | 19 +-
.../schema/IndexSchemaRuntimeFieldTest.java | 3 +-
.../org/apache/solr/schema/IndexSchemaTest.java | 1 -
.../solr/schema/MockExchangeRateProvider.java | 3 +-
.../org/apache/solr/schema/MultiTermTest.java | 3 +-
.../apache/solr/schema/MyCrazyCustomField.java | 3 +-
.../solr/schema/NotRequiredUniqueKeyTest.java | 1 -
.../apache/solr/schema/NumericFieldsTest.java | 1 -
.../OpenExchangeRatesOrgProviderTest.java | 3 +-
.../org/apache/solr/schema/PolyFieldTest.java | 3 +-
.../solr/schema/PreAnalyzedFieldTest.java | 3 +-
.../solr/schema/PrimitiveFieldTypeTest.java | 1 -
.../apache/solr/schema/RequiredFieldsTest.java | 1 -
.../SchemaVersionSpecificBehaviorTest.java | 1 -
.../apache/solr/schema/SortableBinaryField.java | 3 +-
.../solr/schema/SpatialRPTFieldTypeTest.java | 3 +-
.../solr/schema/SynonymTokenizerTest.java | 3 +-
.../org/apache/solr/schema/TestBinaryField.java | 1 -
.../solr/schema/TestBulkSchemaConcurrent.java | 4 +-
.../solr/schema/TestCloudManagedSchema.java | 3 +-
.../TestCloudManagedSchemaConcurrent.java | 3 +-
.../apache/solr/schema/TestCloudSchemaless.java | 3 +-
.../apache/solr/schema/TestCollationField.java | 1 -
.../schema/TestCollationFieldDocValues.java | 1 -
.../apache/solr/schema/TestManagedSchema.java | 3 +-
.../apache/solr/schema/TestOmitPositions.java | 3 +-
.../apache/solr/schema/TestSchemaManager.java | 3 +-
.../solr/schema/TestUseDocValuesAsStored.java | 3 +-
.../solr/schema/TestUseDocValuesAsStored2.java | 3 +-
.../solr/schema/ThrowErrorOnInitFieldType.java | 3 +-
.../TrieIntPrefixActsAsRangeQueryFieldType.java | 3 +-
.../org/apache/solr/schema/WrappedIntField.java | 3 +-
.../solr/search/AnalyticsMergeStrategyTest.java | 3 +-
.../apache/solr/search/AnalyticsQueryTest.java | 1 -
.../org/apache/solr/search/CursorMarkTest.java | 1 -
.../solr/search/DelayingSearchComponent.java | 3 +-
.../test/org/apache/solr/search/DocSetPerf.java | 1 -
.../apache/solr/search/FooQParserPlugin.java | 1 -
.../apache/solr/search/MergeStrategyTest.java | 3 +-
.../apache/solr/search/MockSearchComponent.java | 3 +-
.../apache/solr/search/QueryEqualityTest.java | 3 +-
.../apache/solr/search/QueryParsingTest.java | 3 +-
.../org/apache/solr/search/RankQueryTest.java | 1 -
.../apache/solr/search/ReturnFieldsTest.java | 1 -
.../apache/solr/search/SortSpecParsingTest.java | 3 +-
.../apache/solr/search/SpatialFilterTest.java | 4 +-
.../solr/search/TestAddFieldRealTimeGet.java | 3 +-
.../solr/search/TestAnalyticsQParserPlugin.java | 1 -
.../solr/search/TestCollapseQParserPlugin.java | 1 -
.../search/TestComplexPhraseQParserPlugin.java | 3 +-
.../apache/solr/search/TestComponentsName.java | 3 +-
.../org/apache/solr/search/TestCustomSort.java | 3 +-
.../test/org/apache/solr/search/TestDocSet.java | 1 -
.../solr/search/TestElisionMultitermQuery.java | 11 +-
.../solr/search/TestExtendedDismaxParser.java | 1 -
.../apache/solr/search/TestFieldSortValues.java | 3 +-
.../solr/search/TestFilteredDocIdSet.java | 3 +-
.../org/apache/solr/search/TestFiltering.java | 1 -
.../solr/search/TestFoldingMultitermQuery.java | 3 +-
.../solr/search/TestHashQParserPlugin.java | 1 -
.../org/apache/solr/search/TestInitQParser.java | 3 +-
.../org/apache/solr/search/TestLFUCache.java | 3 +-
.../org/apache/solr/search/TestLRUCache.java | 3 +-
.../solr/search/TestMaxScoreQueryParser.java | 3 +-
.../apache/solr/search/TestMissingGroups.java | 1 -
.../apache/solr/search/TestNoOpRegenerator.java | 3 +-
...OverriddenPrefixQueryForCustomFieldType.java | 3 +-
.../solr/search/TestPseudoReturnFields.java | 1 -
.../org/apache/solr/search/TestQueryUtils.java | 1 -
.../solr/search/TestQueryWrapperFilter.java | 4 +-
.../search/TestRandomCollapseQParserPlugin.java | 1 -
.../apache/solr/search/TestRankQueryPlugin.java | 1 -
.../solr/search/TestReRankQParserPlugin.java | 1 -
.../apache/solr/search/TestReloadDeadlock.java | 5 +-
.../org/apache/solr/search/TestSearchPerf.java | 1 -
.../solr/search/TestSimpleQParserPlugin.java | 3 +-
.../apache/solr/search/TestSmileRequest.java | 4 +-
.../apache/solr/search/TestSolr4Spatial.java | 3 +-
.../apache/solr/search/TestSolr4Spatial2.java | 3 +-
.../test/org/apache/solr/search/TestSolrJ.java | 1 -
.../test/org/apache/solr/search/TestSort.java | 1 -
.../solr/search/TestStandardQParsers.java | 3 +-
.../solr/search/TestStressUserVersions.java | 5 +-
.../solr/search/TestSurroundQueryParser.java | 3 +-
.../org/apache/solr/search/TestTrieFacet.java | 1 -
.../solr/search/TestValueSourceCache.java | 3 +-
.../org/apache/solr/search/TestXmlQParser.java | 5 +-
.../solr/search/facet/TestJsonFacets.java | 3 +-
.../search/function/NvlValueSourceParser.java | 1 -
.../search/function/SortByFunctionTest.java | 3 +-
.../solr/search/function/TestFunctionQuery.java | 1 -
.../function/TestMinMaxOnMultiValuedField.java | 1 -
.../solr/search/function/TestOrdValues.java | 3 +-
.../function/TestSortByMinMaxFunction.java | 3 +-
.../function/distance/DistanceFunctionTest.java | 3 +-
.../apache/solr/search/join/BJQParserTest.java | 1 -
.../search/join/BlockJoinFacetDistribTest.java | 3 +-
.../search/join/BlockJoinFacetRandomTest.java | 3 +-
.../search/join/BlockJoinFacetSimpleTest.java | 3 +-
.../apache/solr/search/join/GraphQueryTest.java | 3 +-
.../search/join/TestScoreJoinQPNoScore.java | 1 -
.../solr/search/join/TestScoreJoinQPScore.java | 1 -
.../solr/search/json/TestJsonRequest.java | 3 +-
.../solr/search/mlt/CloudMLTQParserTest.java | 3 +-
.../solr/search/mlt/SimpleMLTQParserTest.java | 3 +-
.../similarities/BaseSimilarityTestCase.java | 3 +-
.../similarities/TestBM25SimilarityFactory.java | 3 +-
.../TestClassicSimilarityFactory.java | 3 +-
.../similarities/TestDFISimilarityFactory.java | 3 +-
.../similarities/TestDFRSimilarityFactory.java | 3 +-
.../similarities/TestIBSimilarityFactory.java | 3 +-
.../TestLMDirichletSimilarityFactory.java | 3 +-
.../TestLMJelinekMercerSimilarityFactory.java | 3 +-
.../TestNonDefinedSimilarityFactory.java | 3 +-
.../similarities/TestPerFieldSimilarity.java | 3 +-
.../TestPerFieldSimilarityClassic.java | 3 +-
...stPerFieldSimilarityWithDefaultOverride.java | 3 +-
.../TestSweetSpotSimilarityFactory.java | 3 +-
.../solr/search/stats/TestBaseStatsCache.java | 3 +-
.../search/stats/TestDefaultStatsCache.java | 3 +-
.../solr/search/stats/TestDistribIDF.java | 3 +-
.../search/stats/TestExactSharedStatsCache.java | 4 +-
.../solr/search/stats/TestExactStatsCache.java | 4 +-
.../solr/search/stats/TestLRUStatsCache.java | 4 +-
.../solr/security/BasicAuthIntegrationTest.java | 66 +++---
.../solr/security/MockAuthenticationPlugin.java | 4 +-
.../solr/security/MockAuthorizationPlugin.java | 3 +-
.../PKIAuthenticationIntegrationTest.java | 4 +-
.../security/TestAuthorizationFramework.java | 7 +-
.../security/TestPKIAuthenticationPlugin.java | 3 +-
.../TestRuleBasedAuthorizationPlugin.java | 3 +-
.../TestSha256AuthenticationProvider.java | 3 +-
.../solr/servlet/DirectSolrConnectionTest.java | 1 -
.../apache/solr/servlet/ResponseHeaderTest.java | 3 +-
.../solr/servlet/SolrRequestParserTest.java | 1 -
.../ConjunctionSolrSpellCheckerTest.java | 23 +--
.../spelling/DirectSolrSpellCheckerTest.java | 3 +-
.../spelling/FileBasedSpellCheckerTest.java | 1 -
.../apache/solr/spelling/SampleComparator.java | 3 +-
.../solr/spelling/SpellCheckCollatorTest.java | 3 +-
.../spelling/SpellPossibilityIteratorTest.java | 3 +-
.../spelling/SpellingQueryConverterTest.java | 1 -
.../spelling/TestSuggestSpellingConverter.java | 3 +-
.../spelling/WordBreakSolrSpellCheckerTest.java | 3 +-
.../solr/spelling/suggest/SuggesterFSTTest.java | 3 +-
.../solr/spelling/suggest/SuggesterTSTTest.java | 3 +-
.../solr/spelling/suggest/SuggesterTest.java | 1 -
.../spelling/suggest/SuggesterWFSTTest.java | 3 +-
.../suggest/TestAnalyzeInfixSuggestions.java | 11 +-
.../suggest/TestAnalyzedSuggestions.java | 3 +-
.../suggest/TestBlendedInfixSuggestions.java | 3 +-
.../suggest/TestFileDictionaryLookup.java | 3 +-
.../suggest/TestFreeTextSuggestions.java | 3 +-
.../suggest/TestFuzzyAnalyzedSuggestions.java | 11 +-
.../TestHighFrequencyDictionaryFactory.java | 3 +-
.../spelling/suggest/TestPhraseSuggestions.java | 3 +-
.../solr/store/blockcache/BlockCacheTest.java | 3 +-
.../store/blockcache/BlockDirectoryTest.java | 3 +-
.../solr/store/blockcache/BufferStoreTest.java | 3 +-
.../solr/store/hdfs/HdfsDirectoryTest.java | 3 +-
.../solr/store/hdfs/HdfsLockFactoryTest.java | 3 +-
.../apache/solr/update/AddBlockUpdateTest.java | 25 ++-
.../solr/update/AnalysisErrorHandlingTest.java | 3 +-
.../org/apache/solr/update/AutoCommitTest.java | 1 -
.../apache/solr/update/CdcrUpdateLogTest.java | 3 +-
.../solr/update/DataDrivenBlockJoinTest.java | 23 +--
.../update/DirectUpdateHandlerOptimizeTest.java | 3 +-
.../solr/update/DirectUpdateHandlerTest.java | 1 -
.../apache/solr/update/DocumentBuilderTest.java | 1 -
.../apache/solr/update/DummyMergePolicy.java | 3 +-
.../apache/solr/update/HardAutoCommitTest.java | 1 -
.../solr/update/MockStreamingSolrClients.java | 3 +-
.../org/apache/solr/update/PeerSyncTest.java | 26 ++-
.../apache/solr/update/SoftAutoCommitTest.java | 1 -
.../solr/update/SolrCmdDistributorTest.java | 3 +-
.../apache/solr/update/SolrIndexConfigTest.java | 3 +-
.../solr/update/SolrIndexSplitterTest.java | 3 +-
.../update/TestDocBasedVersionConstraints.java | 1 -
.../solr/update/TestExceedMaxTermLength.java | 3 +-
.../apache/solr/update/TestHdfsUpdateLog.java | 3 +-
.../solr/update/TestIndexingPerformance.java | 1 -
.../apache/solr/update/UpdateParamsTest.java | 1 -
.../org/apache/solr/update/VersionInfoTest.java | 3 +-
...dSchemaFieldsUpdateProcessorFactoryTest.java | 1 -
.../update/processor/AtomicUpdatesTest.java | 31 ++-
.../CloneFieldUpdateProcessorFactoryTest.java | 1 -
.../processor/CustomUpdateRequestProcessor.java | 1 -
.../CustomUpdateRequestProcessorFactory.java | 1 -
.../DefaultValueUpdateProcessorTest.java | 1 -
...DocExpirationUpdateProcessorFactoryTest.java | 1 -
.../FieldMutatingUpdateProcessorTest.java | 1 -
...ommitOptimizeUpdateProcessorFactoryTest.java | 3 +-
.../ParsingFieldUpdateProcessorsTest.java | 1 -
.../PreAnalyzedUpdateProcessorTest.java | 13 +-
.../RecordingUpdateProcessorFactory.java | 1 -
.../solr/update/processor/RuntimeUrp.java | 3 +-
.../solr/update/processor/ScriptEngineTest.java | 1 -
.../SignatureUpdateProcessorFactoryTest.java | 1 -
...atelessScriptUpdateProcessorFactoryTest.java | 3 +-
.../processor/TestNamedUpdateProcessors.java | 4 +-
.../TestPartialUpdateDeduplication.java | 3 +-
.../UUIDUpdateProcessorFallbackTest.java | 3 +-
.../UniqFieldsUpdateProcessorFactoryTest.java | 1 -
.../processor/UpdateProcessorTestBase.java | 3 +-
.../UpdateRequestProcessorFactoryTest.java | 1 -
.../test/org/apache/solr/util/BitSetPerf.java | 1 -
.../org/apache/solr/util/CircularListTest.java | 1 -
.../test/org/apache/solr/util/DOMUtilTest.java | 3 +-
.../apache/solr/util/DateMathParserTest.java | 1 -
.../org/apache/solr/util/DistanceUnitsTest.java | 9 +-
.../org/apache/solr/util/FileUtilsTest.java | 3 +-
.../org/apache/solr/util/MockCoreContainer.java | 3 +-
.../org/apache/solr/util/PrimUtilsTest.java | 14 +-
.../apache/solr/util/SimplePostToolTest.java | 3 +-
.../apache/solr/util/SolrPluginUtilsTest.java | 1 -
.../apache/solr/util/TestFastOutputStream.java | 1 -
.../org/apache/solr/util/TestFastWriter.java | 1 -
.../solr/util/TestObjectReleaseTracker.java | 3 +-
.../org/apache/solr/util/TestRTimerTree.java | 3 +-
.../solr/util/TestRandomForceMergePolicy.java | 36 ----
.../apache/solr/util/TestRandomMergePolicy.java | 74 -------
.../apache/solr/util/TestSolrCLIRunExample.java | 3 +-
.../apache/solr/util/TestSystemIdResolver.java | 3 +-
.../org/apache/solr/util/TestTestInjection.java | 3 +-
.../test/org/apache/solr/util/TestUtils.java | 1 -
.../org/apache/solr/util/TimeZoneUtilsTest.java | 1 -
.../BigEndianAscendingWordDeserializerTest.java | 1 -
.../BigEndianAscendingWordSerializerTest.java | 1 -
.../org/apache/solr/util/hll/BitVectorTest.java | 1 -
.../apache/solr/util/hll/ExplicitHLLTest.java | 1 -
.../org/apache/solr/util/hll/FullHLLTest.java | 1 -
.../solr/util/hll/HLLSerializationTest.java | 1 -
.../org/apache/solr/util/hll/HLLUtilTest.java | 1 -
.../solr/util/hll/IntegrationTestGenerator.java | 1 -
.../solr/util/hll/ProbabilisticTestUtil.java | 1 -
.../org/apache/solr/util/hll/SparseHLLTest.java | 1 -
.../solr/client/solrj/ResponseParser.java | 1 -
.../apache/solr/client/solrj/SolrClient.java | 1 -
.../org/apache/solr/client/solrj/SolrQuery.java | 1 -
.../apache/solr/client/solrj/SolrRequest.java | 1 -
.../apache/solr/client/solrj/SolrResponse.java | 1 -
.../solr/client/solrj/SolrServerException.java | 1 -
.../client/solrj/StreamingResponseCallback.java | 1 -
.../client/solrj/beans/BindingException.java | 3 +-
.../solr/client/solrj/impl/CloudSolrClient.java | 3 +-
.../solrj/impl/ConcurrentUpdateSolrClient.java | 1 -
.../client/solrj/impl/HttpClientConfigurer.java | 4 +-
.../solrj/impl/InputStreamResponseParser.java | 3 +-
.../solrj/impl/Krb5HttpClientConfigurer.java | 3 +-
.../client/solrj/impl/NoOpResponseParser.java | 3 +-
.../solrj/impl/SolrHttpRequestRetryHandler.java | 3 +-
.../impl/SolrPortAwareCookieSpecFactory.java | 33 ++-
.../client/solrj/impl/XMLResponseParser.java | 1 -
.../solr/client/solrj/io/SolrClientCache.java | 3 +-
.../org/apache/solr/client/solrj/io/Tuple.java | 1 -
.../client/solrj/io/comp/ComparatorLambda.java | 11 +-
.../client/solrj/io/comp/ComparatorOrder.java | 7 +-
.../client/solrj/io/comp/FieldComparator.java | 1 -
.../solr/client/solrj/io/comp/HashKey.java | 3 +-
.../solrj/io/comp/MultipleFieldComparator.java | 1 -
.../client/solrj/io/comp/StreamComparator.java | 1 -
.../solr/client/solrj/io/eq/Equalitor.java | 5 +-
.../solr/client/solrj/io/eq/FieldEqualitor.java | 1 -
.../solrj/io/eq/MultipleFieldEqualitor.java | 1 -
.../client/solrj/io/eq/StreamEqualitor.java | 1 -
.../client/solrj/io/ops/ConcatOperation.java | 23 +--
.../client/solrj/io/ops/DistinctOperation.java | 33 ++-
.../client/solrj/io/ops/GroupOperation.java | 33 ++-
.../client/solrj/io/ops/ReduceOperation.java | 6 +-
.../client/solrj/io/ops/ReplaceOperation.java | 21 +-
.../solrj/io/ops/ReplaceWithFieldOperation.java | 23 +--
.../solrj/io/ops/ReplaceWithValueOperation.java | 23 +--
.../client/solrj/io/ops/StreamOperation.java | 19 +-
.../client/solrj/io/sql/ConnectionImpl.java | 3 +-
.../solrj/io/sql/DatabaseMetaDataImpl.java | 3 +-
.../solr/client/solrj/io/sql/DriverImpl.java | 4 +-
.../solr/client/solrj/io/sql/ResultSetImpl.java | 3 +-
.../solrj/io/sql/ResultSetMetaDataImpl.java | 3 +-
.../solr/client/solrj/io/sql/StatementImpl.java | 3 +-
.../client/solrj/io/stream/BiJoinStream.java | 1 -
.../client/solrj/io/stream/CloudSolrStream.java | 13 +-
.../solrj/io/stream/ComplementStream.java | 1 -
.../client/solrj/io/stream/DaemonStream.java | 2 -
.../client/solrj/io/stream/ExceptionStream.java | 1 -
.../client/solrj/io/stream/FacetStream.java | 3 +-
.../client/solrj/io/stream/HashJoinStream.java | 1 -
.../client/solrj/io/stream/InnerJoinStream.java | 1 -
.../client/solrj/io/stream/IntersectStream.java | 1 -
.../solr/client/solrj/io/stream/JDBCStream.java | 1 -
.../client/solrj/io/stream/JSONTupleStream.java | 33 ++-
.../solr/client/solrj/io/stream/JoinStream.java | 33 ++-
.../solrj/io/stream/LeftOuterJoinStream.java | 1 -
.../client/solrj/io/stream/MergeStream.java | 1 -
.../solrj/io/stream/OuterHashJoinStream.java | 1 -
.../client/solrj/io/stream/ParallelStream.java | 1 -
.../client/solrj/io/stream/PushBackStream.java | 1 -
.../solr/client/solrj/io/stream/RankStream.java | 1 -
.../client/solrj/io/stream/ReducerStream.java | 1 -
.../client/solrj/io/stream/RollupStream.java | 2 -
.../client/solrj/io/stream/SelectStream.java | 1 -
.../solr/client/solrj/io/stream/SolrStream.java | 1 -
.../client/solrj/io/stream/StatsStream.java | 3 +-
.../client/solrj/io/stream/StreamContext.java | 1 -
.../client/solrj/io/stream/TupleStream.java | 1 -
.../client/solrj/io/stream/UniqueStream.java | 1 -
.../solrj/io/stream/expr/Expressible.java | 7 +-
.../solrj/io/stream/expr/StreamExpression.java | 9 +-
.../expr/StreamExpressionNamedParameter.java | 7 +-
.../stream/expr/StreamExpressionParameter.java | 3 +-
.../io/stream/expr/StreamExpressionParser.java | 22 +-
.../io/stream/expr/StreamExpressionValue.java | 3 +-
.../solrj/io/stream/expr/StreamFactory.java | 33 ++-
.../client/solrj/io/stream/metrics/Bucket.java | 7 +-
.../solrj/io/stream/metrics/CountMetric.java | 3 +-
.../solrj/io/stream/metrics/MaxMetric.java | 3 +-
.../solrj/io/stream/metrics/MeanMetric.java | 3 +-
.../client/solrj/io/stream/metrics/Metric.java | 3 +-
.../solrj/io/stream/metrics/MinMetric.java | 3 +-
.../solrj/io/stream/metrics/SumMetric.java | 3 +-
.../solrj/request/AbstractUpdateRequest.java | 3 +-
.../solrj/request/CollectionAdminRequest.java | 1 -
.../solrj/request/ConfigSetAdminRequest.java | 1 -
.../request/ContentStreamUpdateRequest.java | 4 +-
.../client/solrj/request/CoreAdminRequest.java | 1 -
.../client/solrj/request/DirectXmlRequest.java | 1 -
.../solrj/request/DocumentAnalysisRequest.java | 1 -
.../solrj/request/FieldAnalysisRequest.java | 1 -
.../solrj/request/GenericSolrRequest.java | 3 +-
.../client/solrj/request/IsUpdateRequest.java | 4 +-
.../solr/client/solrj/request/LukeRequest.java | 1 -
.../solr/client/solrj/request/QueryRequest.java | 1 -
.../client/solrj/request/RequestWriter.java | 1 -
.../solr/client/solrj/request/SolrPing.java | 1 -
.../client/solrj/request/UpdateRequest.java | 2 +-
.../request/schema/AbstractSchemaRequest.java | 3 +-
.../request/schema/AnalyzerDefinition.java | 3 +-
.../request/schema/FieldTypeDefinition.java | 3 +-
.../solrj/request/schema/SchemaRequest.java | 3 +-
.../solrj/response/AnalysisResponseBase.java | 1 -
.../solr/client/solrj/response/Cluster.java | 3 +-
.../solrj/response/ClusteringResponse.java | 3 +-
.../solrj/response/CollectionAdminResponse.java | 1 -
.../solrj/response/ConfigSetAdminResponse.java | 1 -
.../solrj/response/CoreAdminResponse.java | 1 -
.../response/DocumentAnalysisResponse.java | 1 -
.../solr/client/solrj/response/FacetField.java | 1 -
.../solrj/response/FieldAnalysisResponse.java | 1 -
.../solr/client/solrj/response/Group.java | 3 +-
.../client/solrj/response/GroupCommand.java | 3 +-
.../client/solrj/response/GroupResponse.java | 3 +-
.../client/solrj/response/IntervalFacet.java | 8 +-
.../client/solrj/response/LukeResponse.java | 1 -
.../solr/client/solrj/response/PivotField.java | 1 -
.../client/solrj/response/QueryResponse.java | 1 -
.../solr/client/solrj/response/RangeFacet.java | 3 +-
.../solrj/response/SimpleSolrResponse.java | 4 +-
.../client/solrj/response/SolrPingResponse.java | 1 -
.../client/solrj/response/SolrResponseBase.java | 1 -
.../solrj/response/SpellCheckResponse.java | 3 +-
.../solrj/response/SuggesterResponse.java | 3 +-
.../solr/client/solrj/response/Suggestion.java | 2 +-
.../client/solrj/response/TermsResponse.java | 3 +-
.../client/solrj/response/UpdateResponse.java | 1 -
.../schema/FieldTypeRepresentation.java | 3 +-
.../response/schema/SchemaRepresentation.java | 3 +-
.../solrj/response/schema/SchemaResponse.java | 3 +-
.../solr/client/solrj/util/ClientUtils.java | 1 -
.../java/org/apache/solr/common/Callable.java | 3 +-
.../apache/solr/common/EmptyEntityResolver.java | 3 +-
.../org/apache/solr/common/EnumFieldValue.java | 3 +-
.../org/apache/solr/common/SolrDocument.java | 1 -
.../apache/solr/common/SolrDocumentBase.java | 13 +-
.../apache/solr/common/SolrDocumentList.java | 1 -
.../org/apache/solr/common/SolrException.java | 1 -
.../apache/solr/common/SolrInputDocument.java | 1 -
.../org/apache/solr/common/SolrInputField.java | 1 -
.../org/apache/solr/common/StringUtils.java | 3 +-
.../org/apache/solr/common/cloud/Aliases.java | 3 +-
.../solr/common/cloud/BeforeReconnect.java | 27 ++-
.../solr/common/cloud/ClosableThread.java | 3 +-
.../apache/solr/common/cloud/ClusterState.java | 3 +-
.../solr/common/cloud/ClusterStateUtil.java | 31 ++-
.../solr/common/cloud/CompositeIdRouter.java | 3 +-
.../solr/common/cloud/ConnectionManager.java | 7 +-
.../common/cloud/DefaultConnectionStrategy.java | 27 ++-
.../solr/common/cloud/DefaultZkACLProvider.java | 13 +-
.../cloud/DefaultZkCredentialsProvider.java | 9 +-
.../apache/solr/common/cloud/DocCollection.java | 3 +-
.../org/apache/solr/common/cloud/DocRouter.java | 3 +-
.../solr/common/cloud/HashBasedRouter.java | 3 +-
.../solr/common/cloud/ImplicitDocRouter.java | 3 +-
.../apache/solr/common/cloud/OnReconnect.java | 27 ++-
.../apache/solr/common/cloud/PlainIdRouter.java | 5 +-
.../org/apache/solr/common/cloud/Replica.java | 3 +-
.../apache/solr/common/cloud/RoutingRule.java | 3 +-
.../solr/common/cloud/SaslZkACLProvider.java | 3 +-
.../org/apache/solr/common/cloud/Slice.java | 3 +-
.../apache/solr/common/cloud/SolrZkClient.java | 23 +--
.../apache/solr/common/cloud/SolrZooKeeper.java | 3 +-
...ParamsAllAndReadonlyDigestZkACLProvider.java | 23 +--
...tCredentialsDigestZkCredentialsProvider.java | 17 +-
.../apache/solr/common/cloud/ZkACLProvider.java | 11 +-
.../cloud/ZkClientConnectionStrategy.java | 27 ++-
.../apache/solr/common/cloud/ZkCmdExecutor.java | 3 +-
.../solr/common/cloud/ZkConfigManager.java | 1 -
.../solr/common/cloud/ZkCoreNodeProps.java | 27 ++-
.../common/cloud/ZkCredentialsProvider.java | 7 +-
.../apache/solr/common/cloud/ZkNodeProps.java | 3 +-
.../apache/solr/common/cloud/ZkOperation.java | 6 +-
.../apache/solr/common/cloud/ZkStateReader.java | 5 +-
.../solr/common/cloud/ZooKeeperException.java | 4 +-
.../org/apache/solr/common/luke/FieldFlag.java | 4 +-
.../solr/common/params/AnalysisParams.java | 1 -
.../solr/common/params/AppendedSolrParams.java | 1 -
.../solr/common/params/CollectionParams.java | 3 +-
.../solr/common/params/CommonAdminParams.java | 1 -
.../apache/solr/common/params/CommonParams.java | 1 -
.../solr/common/params/ConfigSetParams.java | 3 +-
.../solr/common/params/CoreAdminParams.java | 1 -
.../solr/common/params/CursorMarkParams.java | 1 -
.../solr/common/params/DefaultSolrParams.java | 1 -
.../apache/solr/common/params/DisMaxParams.java | 1 -
.../apache/solr/common/params/EventParams.java | 4 +-
.../apache/solr/common/params/ExpandParams.java | 1 -
.../apache/solr/common/params/FacetParams.java | 1 -
.../apache/solr/common/params/GroupParams.java | 1 -
.../solr/common/params/HighlightParams.java | 1 -
.../solr/common/params/MapSolrParams.java | 1 -
.../common/params/ModifiableSolrParams.java | 1 -
.../solr/common/params/MoreLikeThisParams.java | 1 -
.../solr/common/params/MultiMapSolrParams.java | 1 -
.../common/params/QueryElevationParams.java | 4 +-
.../solr/common/params/RequiredSolrParams.java | 1 -
.../apache/solr/common/params/ShardParams.java | 1 -
.../apache/solr/common/params/SimpleParams.java | 3 +-
.../apache/solr/common/params/SolrParams.java | 1 -
.../solr/common/params/SpatialParams.java | 4 +-
.../solr/common/params/SpellingParams.java | 1 -
.../apache/solr/common/params/StatsParams.java | 1 -
.../solr/common/params/TermVectorParams.java | 4 +-
.../apache/solr/common/params/TermsParams.java | 1 -
.../apache/solr/common/params/UpdateParams.java | 1 -
.../org/apache/solr/common/util/ByteUtils.java | 1 -
.../java/org/apache/solr/common/util/Cache.java | 3 +-
.../apache/solr/common/util/ContentStream.java | 1 -
.../solr/common/util/ContentStreamBase.java | 1 -
.../solr/common/util/DataInputInputStream.java | 1 -
.../org/apache/solr/common/util/DateUtil.java | 3 +-
.../apache/solr/common/util/ExecutorUtil.java | 11 +-
.../solr/common/util/FastInputStream.java | 1 -
.../solr/common/util/FastOutputStream.java | 1 -
.../java/org/apache/solr/common/util/Hash.java | 3 +-
.../org/apache/solr/common/util/IOUtils.java | 15 +-
.../apache/solr/common/util/IteratorChain.java | 1 -
.../org/apache/solr/common/util/NamedList.java | 1 -
.../solr/common/util/ObjectReleaseTracker.java | 3 +-
.../java/org/apache/solr/common/util/Pair.java | 3 +-
.../org/apache/solr/common/util/RetryUtil.java | 11 +-
.../solr/common/util/SimpleOrderedMap.java | 3 +-
.../common/util/SolrjNamedThreadFactory.java | 9 +-
.../org/apache/solr/common/util/StrUtils.java | 1 -
.../solr/common/util/SuppressForbidden.java | 3 +-
.../org/apache/solr/common/util/URLUtil.java | 1 -
.../java/org/apache/solr/common/util/Utils.java | 4 +-
.../java/org/apache/solr/common/util/XML.java | 1 -
.../apache/solr/common/util/XMLErrorLogger.java | 1 -
...ollectionAdminRequestRequiredParamsTest.java | 3 +-
.../apache/solr/client/solrj/GetByIdTest.java | 3 +-
.../solr/client/solrj/LargeVolumeTestBase.java | 1 -
.../solrj/MergeIndexesExampleTestBase.java | 1 -
.../client/solrj/SolrExampleBinaryTest.java | 1 -
.../solr/client/solrj/SolrExampleTestBase.java | 1 -
.../solr/client/solrj/SolrExampleTests.java | 1 -
.../solr/client/solrj/SolrExampleTestsBase.java | 1 -
.../solr/client/solrj/SolrExampleXMLTest.java | 1 -
.../solr/client/solrj/SolrExceptionTest.java | 1 -
.../apache/solr/client/solrj/SolrQueryTest.java | 1 -
.../client/solrj/SolrSchemalessExampleTest.java | 1 -
.../solr/client/solrj/StartSolrJetty.java | 1 -
.../solr/client/solrj/TestLBHttpSolrClient.java | 1 -
.../client/solrj/TestSolrJErrorHandling.java | 7 +-
.../AbstractEmbeddedSolrServerTestCase.java | 3 +-
.../client/solrj/embedded/JettyWebappTest.java | 1 -
.../solrj/embedded/LargeVolumeEmbeddedTest.java | 1 -
.../solrj/embedded/LargeVolumeJettyTest.java | 1 -
.../embedded/MergeIndexesEmbeddedTest.java | 1 -
.../solrj/embedded/SolrExampleEmbeddedTest.java | 1 -
.../solrj/embedded/SolrExampleJettyTest.java | 1 -
.../SolrExampleStreamingBinaryTest.java | 3 +-
.../embedded/SolrExampleStreamingTest.java | 1 -
.../solrj/embedded/TestEmbeddedSolrServer.java | 3 +-
.../solrj/embedded/TestSolrProperties.java | 1 -
.../solrj/impl/BasicHttpSolrClientTest.java | 1 -
.../CloudSolrClientMultiConstructorTest.java | 21 +-
.../client/solrj/impl/CloudSolrClientTest.java | 3 +-
.../impl/ConcurrentUpdateSolrClientTest.java | 1 -
.../solrj/impl/ExternalHttpClientTest.java | 3 +-
.../client/solrj/impl/LBHttpSolrClientTest.java | 1 -
.../solrj/impl/SolrPortAwareCookieSpecTest.java | 3 +-
.../impl/TestCloudSolrClientConnections.java | 3 +-
.../client/solrj/io/sql/JdbcDriverTest.java | 3 +-
.../solr/client/solrj/io/sql/JdbcTest.java | 3 +-
.../client/solrj/io/stream/JDBCStreamTest.java | 3 +-
.../solrj/io/stream/RecordCountStream.java | 2 +-
.../solrj/io/stream/StreamExpressionTest.java | 3 +-
.../stream/StreamExpressionToExpessionTest.java | 22 +-
.../client/solrj/io/stream/StreamingTest.java | 3 +-
.../stream/expr/StreamExpressionParserTest.java | 3 +-
.../io/stream/ops/ConcatOperationTest.java | 3 +-
.../solrj/io/stream/ops/OperationsTest.java | 3 +-
.../solr/client/solrj/request/SchemaTest.java | 3 +-
.../solr/client/solrj/request/SolrPingTest.java | 3 +-
.../request/TestConfigSetAdminRequest.java | 1 -
.../client/solrj/request/TestCoreAdmin.java | 1 -
.../client/solrj/request/TestUpdateRequest.java | 3 +-
.../solrj/response/AnlysisResponseBaseTest.java | 1 -
.../response/DocumentAnalysisResponseTest.java | 1 -
.../client/solrj/response/FacetFieldTest.java | 3 +-
.../response/FieldAnalysisResponseTest.java | 1 -
.../solrj/response/NoOpResponseParserTest.java | 3 +-
.../solrj/response/QueryResponseTest.java | 1 -
.../solrj/response/TermsResponseTest.java | 3 +-
.../solrj/response/TestClusteringResponse.java | 3 +-
.../solrj/response/TestSpellCheckResponse.java | 3 +-
.../solrj/response/TestSuggesterResponse.java | 3 +-
.../solr/client/solrj/util/ClientUtilsTest.java | 1 -
.../apache/solr/common/SolrDocumentTest.java | 1 -
.../solr/common/cloud/SolrZkClientTest.java | 3 +-
.../solr/common/cloud/TestZkConfigManager.java | 1 -
.../common/params/CommonAdminParamsTest.java | 1 -
.../solr/common/params/CommonParamsTest.java | 1 -
.../common/params/ModifiableSolrParamsTest.java | 25 ++-
.../solr/common/params/ShardParamsTest.java | 3 +-
.../solr/common/params/SolrParamTest.java | 1 -
.../solr/common/util/ContentStreamTest.java | 1 -
.../solr/common/util/IteratorChainTest.java | 1 -
.../apache/solr/common/util/NamedListTest.java | 1 -
.../apache/solr/common/util/TestDateUtil.java | 3 +-
.../org/apache/solr/common/util/TestHash.java | 3 +-
.../solr/common/util/TestJavaBinCodec.java | 3 +-
.../solr/common/util/TestJsonRecordReader.java | 3 +-
.../apache/solr/common/util/TestRetryUtil.java | 3 +-
.../solr/common/util/TestXMLEscaping.java | 1 -
.../apache/solr/common/util/URLUtilTest.java | 1 -
.../solr/BaseDistributedSearchTestCase.java | 3 +-
.../src/java/org/apache/solr/JSONTestUtil.java | 1 -
.../apache/solr/SolrIgnoredThreadsFilter.java | 13 +-
.../java/org/apache/solr/SolrJettyTestBase.java | 3 +-
.../java/org/apache/solr/SolrTestCaseHS.java | 4 +-
.../java/org/apache/solr/SolrTestCaseJ4.java | 1 -
.../solr/analysis/MockCharFilterFactory.java | 3 +-
.../solr/analysis/MockTokenFilterFactory.java | 3 +-
.../solr/analysis/MockTokenizerFactory.java | 3 +-
.../analysis/StringMockSolrResourceLoader.java | 3 +-
.../solr/cloud/AbstractDistribZkTestBase.java | 3 +-
.../apache/solr/cloud/AbstractZkTestCase.java | 3 +-
.../java/org/apache/solr/cloud/ChaosMonkey.java | 7 +-
.../org/apache/solr/cloud/CloudInspectUtil.java | 33 ++-
.../java/org/apache/solr/cloud/IpTables.java | 4 +-
.../apache/solr/cloud/MiniSolrCloudCluster.java | 3 +-
.../org/apache/solr/cloud/MockSolrZkClient.java | 3 +-
.../apache/solr/cloud/MockZkStateReader.java | 3 +-
.../java/org/apache/solr/cloud/SocketProxy.java | 3 +-
.../solr/cloud/StoppableIndexingThread.java | 25 ++-
.../solr/cloud/StoppableSearchThread.java | 7 +-
.../org/apache/solr/cloud/ZkTestServer.java | 27 ++-
.../solr/core/AbstractBadConfigTestBase.java | 1 -
.../apache/solr/core/MockDirectoryFactory.java | 3 +-
.../solr/core/MockFSDirectoryFactory.java | 3 +-
.../component/TrackingShardHandlerFactory.java | 3 +-
.../processor/BufferingRequestProcessor.java | 1 -
.../apache/solr/util/AbstractSolrTestCase.java | 2 -
.../apache/solr/util/BadHdfsThreadsFilter.java | 3 +-
.../solr/util/BadMrClusterThreadsFilter.java | 3 +-
.../solr/util/BadZookeeperThreadsFilter.java | 3 +-
.../org/apache/solr/util/BaseTestHarness.java | 3 +-
.../org/apache/solr/util/DOMUtilTestBase.java | 1 -
.../org/apache/solr/util/ExternalPaths.java | 3 +-
.../apache/solr/util/RESTfulServerProvider.java | 3 +-
.../solr/util/RandomForceMergePolicy.java | 1 -
.../org/apache/solr/util/RandomMergePolicy.java | 52 +----
.../apache/solr/util/ReadOnlyCoresLocator.java | 3 +-
.../java/org/apache/solr/util/RestTestBase.java | 3 +-
.../org/apache/solr/util/RestTestHarness.java | 3 +-
.../util/RevertDefaultThreadHandlerRule.java | 23 +--
.../org/apache/solr/util/SSLTestConfig.java | 3 +-
.../java/org/apache/solr/util/TestHarness.java | 1 -
5286 files changed, 10860 insertions(+), 13664 deletions(-)
----------------------------------------------------------------------
[10/17] lucene-solr git commit: merge master
Posted by mi...@apache.org.
merge master
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9cf74f79
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9cf74f79
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9cf74f79
Branch: refs/heads/master
Commit: 9cf74f791c23c8c117e1fa148e104a27d15659cf
Parents: 8cd731b 732b8fb
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 17:03:23 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 3 17:03:23 2016 -0500
----------------------------------------------------------------------
.../dot.settings/org.eclipse.jdt.ui.prefs | 3 +-
dev-tools/git/HELP.txt | 14 +++++
.../idea/.idea/copyright/profiles_settings.xml | 2 +-
lucene/CHANGES.txt | 6 ++
.../simpletext/SimpleTextPointWriter.java | 37 ++++++------
.../org/apache/lucene/store/FSDirectory.java | 1 -
.../org/apache/lucene/util/LuceneTestCase.java | 22 +++++++
solr/CHANGES.txt | 3 +
.../org/apache/solr/core/CoreContainer.java | 58 +++++++++++--------
.../org/apache/solr/handler/SQLHandler.java | 57 +++++++++++++++++-
.../handler/admin/CoreAdminHandlerTest.java | 61 ++++++++++++++++++--
.../solrj/io/sql/DatabaseMetaDataImpl.java | 4 +-
.../solr/client/solrj/io/sql/JdbcTest.java | 16 +++++
13 files changed, 231 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9cf74f79/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
diff --cc lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
index da69aca,400ad5d..14bb7af
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@@ -269,13 -245,6 +269,12 @@@ public abstract class FSDirectory exten
}
}
+ protected void ensureCanRead(String name) throws IOException {
- maybeDeletePendingFiles();
+ if (pendingDeletes.contains(name)) {
+ throw new NoSuchFileException("file \"" + name + "\" is pending delete and cannot be opened for read");
+ }
+ }
+
@Override
public void sync(Collection<String> names) throws IOException {
ensureOpen();
[06/17] lucene-solr git commit: cut back to
Directory.deleteFile(String);
disable 'could not removed segments_N so I don't remove any other files it may
reference' heroics
Posted by mi...@apache.org.
cut back to Directory.deleteFile(String); disable 'could not removed segments_N so I don't remove any other files it may reference' heroics
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a741ea53
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a741ea53
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a741ea53
Branch: refs/heads/master
Commit: a741ea53c9570d290fea95751a48b857fadd87dd
Parents: b4a2bf2
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 10:35:57 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 3 10:35:57 2016 -0500
----------------------------------------------------------------------
.../lucene/analysis/hunspell/Dictionary.java | 4 +-
.../util/TestFilesystemResourceLoader.java | 28 +++---
.../simpletext/SimpleTextCompoundFormat.java | 2 +-
.../codecs/lucene50/Lucene50CompoundReader.java | 2 +-
.../apache/lucene/index/IndexFileDeleter.java | 30 +++---
.../org/apache/lucene/index/IndexWriter.java | 1 +
.../index/PersistentSnapshotDeletionPolicy.java | 4 +-
.../java/org/apache/lucene/store/Directory.java | 5 +-
.../org/apache/lucene/store/FSDirectory.java | 97 ++++----------------
.../lucene/store/FileSwitchDirectory.java | 19 +---
.../apache/lucene/store/FilterDirectory.java | 4 +-
.../store/LockValidatingDirectoryWrapper.java | 4 +-
.../lucene/store/NRTCachingDirectory.java | 29 ++----
.../org/apache/lucene/store/RAMDirectory.java | 16 ++--
.../lucene/store/TrackingDirectoryWrapper.java | 9 +-
.../java/org/apache/lucene/util/IOUtils.java | 30 +++---
.../org/apache/lucene/util/bkd/BKDWriter.java | 7 +-
.../lucene/util/bkd/OfflinePointWriter.java | 3 +-
.../lucene/index/TestCodecHoldsOpenFiles.java | 7 +-
.../apache/lucene/index/TestDeletionPolicy.java | 12 +--
.../lucene/index/TestDirectoryReaderReopen.java | 9 +-
.../test/org/apache/lucene/index/TestDoc.java | 5 +-
.../lucene/index/TestIndexFileDeleter.java | 32 +++----
.../lucene/index/TestIndexWriterExceptions.java | 10 +-
.../lucene/index/TestNRTReaderCleanup.java | 8 +-
.../org/apache/lucene/store/TestDirectory.java | 4 +-
.../lucene/store/TestNativeFSLockFactory.java | 3 +-
.../lucene/store/TestSimpleFSLockFactory.java | 3 +-
.../store/TestTrackingDirectoryWrapper.java | 2 +-
.../org/apache/lucene/util/bkd/TestBKD.java | 5 +-
.../org/apache/lucene/util/fst/Test2BFST.java | 7 +-
.../lucene/util/packed/TestPackedInts.java | 3 +-
.../lucene/store/NativeUnixDirectory.java | 1 -
.../suggest/analyzing/AnalyzingSuggester.java | 2 +-
.../search/suggest/fst/ExternalRefSorter.java | 2 +-
.../search/suggest/fst/FSTCompletionLookup.java | 2 +-
.../lucene/analysis/VocabularyAssert.java | 2 +-
.../index/BaseCompoundFormatTestCase.java | 2 +-
.../apache/lucene/mockfile/VirusCheckingFS.java | 6 +-
.../lucene/store/BaseDirectoryTestCase.java | 5 +-
.../lucene/store/MockDirectoryWrapper.java | 29 +++---
.../org/apache/lucene/util/fst/FSTTester.java | 2 +-
42 files changed, 181 insertions(+), 276 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
index 49c7045..d5db839 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
@@ -877,7 +877,7 @@ public class Dictionary {
success = true;
} finally {
if (success) {
- tempDir.deleteFiles(Collections.singleton(unsorted.getName()));
+ tempDir.deleteFile(unsorted.getName());
} else {
IOUtils.deleteFilesIgnoringExceptions(tempDir, unsorted.getName());
}
@@ -966,7 +966,7 @@ public class Dictionary {
success2 = true;
} finally {
if (success2) {
- tempDir.deleteFiles(Collections.singleton(sorted));
+ tempDir.deleteFile(sorted);
} else {
IOUtils.deleteFilesIgnoringExceptions(tempDir, sorted);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
index 80de40f..6ca814e 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
@@ -57,25 +57,21 @@ public class TestFilesystemResourceLoader extends LuceneTestCase {
public void testBaseDir() throws Exception {
final Path base = createTempDir("fsResourceLoaderBase");
+ Writer os = Files.newBufferedWriter(base.resolve("template.txt"), StandardCharsets.UTF_8);
try {
- Writer os = Files.newBufferedWriter(base.resolve("template.txt"), StandardCharsets.UTF_8);
- try {
- os.write("foobar\n");
- } finally {
- IOUtils.closeWhileHandlingException(os);
- }
-
- ResourceLoader rl = new FilesystemResourceLoader(base);
- assertEquals("foobar", WordlistLoader.getLines(rl.openResource("template.txt"), StandardCharsets.UTF_8).get(0));
- // Same with full path name:
- String fullPath = base.resolve("template.txt").toAbsolutePath().toString();
- assertEquals("foobar",
- WordlistLoader.getLines(rl.openResource(fullPath), StandardCharsets.UTF_8).get(0));
- assertClasspathDelegation(rl);
- assertNotFound(rl);
+ os.write("foobar\n");
} finally {
- IOUtils.rm(base);
+ IOUtils.closeWhileHandlingException(os);
}
+
+ ResourceLoader rl = new FilesystemResourceLoader(base);
+ assertEquals("foobar", WordlistLoader.getLines(rl.openResource("template.txt"), StandardCharsets.UTF_8).get(0));
+ // Same with full path name:
+ String fullPath = base.resolve("template.txt").toAbsolutePath().toString();
+ assertEquals("foobar",
+ WordlistLoader.getLines(rl.openResource(fullPath), StandardCharsets.UTF_8).get(0));
+ assertClasspathDelegation(rl);
+ assertNotFound(rl);
}
public void testDelegation() throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
index 8398f66..c994df7 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
@@ -148,7 +148,7 @@ public class SimpleTextCompoundFormat extends CompoundFormat {
public void sync(Collection<String> names) { throw new UnsupportedOperationException(); }
@Override
- public void deleteFiles(Collection<String> name) { throw new UnsupportedOperationException(); }
+ public void deleteFile(String name) { throw new UnsupportedOperationException(); }
@Override
public void renameFile(String source, String dest) { throw new UnsupportedOperationException(); }
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
index a6ccfd4..831fb4c 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
@@ -161,7 +161,7 @@ final class Lucene50CompoundReader extends Directory {
/** Not implemented
* @throws UnsupportedOperationException always: not supported by CFS */
@Override
- public void deleteFiles(Collection<String> name) {
+ public void deleteFile(String name) {
throw new UnsupportedOperationException();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
index 569471e..2e5d5cf 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
@@ -694,20 +694,24 @@ final class IndexFileDeleter implements Closeable {
private void deleteFiles(Collection<String> names) throws IOException {
assert locked();
ensureOpen();
- if (names.isEmpty()) {
- return;
+
+ if (infoStream.isEnabled("IFD")) {
+ infoStream.message("IFD", "delete \"" + names + "\"");
}
- try {
- if (infoStream.isEnabled("IFD")) {
- infoStream.message("IFD", "delete \"" + names + "\"");
- }
- directory.deleteFiles(names);
- } catch (NoSuchFileException | FileNotFoundException e) { // if delete fails
- // IndexWriter should only ask us to delete files it knows it wrote, so if we hit this, something is wrong!
- if (Constants.WINDOWS) {
- // LUCENE-6684: we suppress this assert for Windows, since a file could be in a confusing "pending delete" state:
- } else {
- throw e;
+
+ // nocommit put annoying windows-specific segments_N heroics back?
+
+ for(String name : names) {
+ try {
+ directory.deleteFile(name);
+ } catch (NoSuchFileException | FileNotFoundException e) {
+ // IndexWriter should only ask us to delete files it knows it wrote, so if we hit this, something is wrong!
+ if (Constants.WINDOWS) {
+ // LUCENE-6684: we suppress this assert for Windows, since a file could be in a confusing "pending delete" state, and falsely
+ // return NSFE/FNFE
+ } else {
+ throw e;
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index e62cafb..ce79309 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -4617,6 +4617,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
* commits are no longer needed. Otherwise, those commits will
* be deleted the next time commit() is called.
*/
+ // nocommit remove this
public synchronized void deleteUnusedFiles() throws IOException {
ensureOpen(false);
deleter.revisitPolicy();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
index 2a286ff..e95c567 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
@@ -22,8 +22,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Map.Entry;
import java.util.Map;
+import java.util.Map.Entry;
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
@@ -212,7 +212,7 @@ public class PersistentSnapshotDeletionPolicy extends SnapshotDeletionPolicy {
private synchronized void clearPriorSnapshots() throws IOException {
for(String file : dir.listAll()) {
if (file.startsWith(SNAPSHOTS_PREFIX)) {
- dir.deleteFiles(Collections.singleton(file));
+ dir.deleteFile(file);
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java
index bb12c92..b6da4cc 100644
--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java
@@ -50,9 +50,8 @@ public abstract class Directory implements Closeable {
// nocommit should this sort?
public abstract String[] listAll() throws IOException;
- /** Removes the specified files from the directory. If an exception is thrown, behavior is undefined
- * (none, some or all of the files may have in fact been deleted). */
- public abstract void deleteFiles(Collection<String> name) throws IOException;
+ /** Removes an existing file in the directory. */
+ public abstract void deleteFile(String name) throws IOException;
/**
* Returns the length of a file in the directory. This method follows the
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 9eb78b4..a2edb84 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -126,10 +126,8 @@ public abstract class FSDirectory extends BaseDirectory {
protected final Path directory; // The underlying filesystem directory
-
- /** Files we previously tried to delete, but hit exception (on Windows) last time we tried.
- * These files are in "pending delete" state, where we refuse to openInput or createOutput
- * them, nor include them in .listAll. */
+ /** Maps files that we are trying to delete (or we tried already but failed)
+ * before attempting to delete that key. */
protected final Set<String> pendingDeletes = Collections.newSetFromMap(new ConcurrentHashMap<String,Boolean>());
/** Used to generate temp file names in {@link #createTempOutput}. */
@@ -200,12 +198,11 @@ public abstract class FSDirectory extends BaseDirectory {
}
}
- /** Lists all files (including subdirectories) in the
- * directory.
+ /** Lists all files (including subdirectories) in the directory.
*
* @throws IOException if there was an I/O error during listing */
public static String[] listAll(Path dir) throws IOException {
- return listAll(dir, Collections.emptySet());
+ return listAll(dir, null);
}
private static String[] listAll(Path dir, Set<String> skipNames) throws IOException {
@@ -214,7 +211,7 @@ public abstract class FSDirectory extends BaseDirectory {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
for (Path path : stream) {
String name = path.getFileName().toString();
- if (skipNames.contains(name) == false) {
+ if (skipNames != null && skipNames.contains(name) == false) {
entries.add(name);
}
}
@@ -236,17 +233,10 @@ public abstract class FSDirectory extends BaseDirectory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
- ensureOpen();
- // nocommit isn't it an error if they were already pending delete?
- pendingDeletes.addAll(names);
- deletePendingFiles();
- }
-
- @Override
public IndexOutput createOutput(String name, IOContext context) throws IOException {
ensureOpen();
- ensureCanWrite(name);
+ // nocommit do we need to check pending deletes?
+ deletePendingFiles();
return new FSIndexOutput(name);
}
@@ -264,14 +254,6 @@ public abstract class FSDirectory extends BaseDirectory {
}
}
- protected void ensureCanWrite(String name) throws IOException {
- deletePendingFiles();
- if (pendingDeletes.contains(name)) {
- throw new IOException("file \"" + name + "\" is pending delete and cannot be overwritten");
- }
- Files.deleteIfExists(directory.resolve(name)); // delete existing, if any
- }
-
protected void ensureCanRead(String name) throws IOException {
deletePendingFiles();
if (pendingDeletes.contains(name)) {
@@ -319,12 +301,11 @@ public abstract class FSDirectory extends BaseDirectory {
IOUtils.fsync(directory.resolve(name), false);
}
- /** Returns true if the file was successfully removed. */
- private synchronized boolean deleteFile(String name) throws IOException {
+ @Override
+ public void deleteFile(String name) throws IOException {
pendingDeletes.remove(name);
try {
Files.delete(directory.resolve(name));
- return true;
} catch (NoSuchFileException | FileNotFoundException e) {
// We were asked to delete a non-existent file:
throw e;
@@ -339,9 +320,7 @@ public abstract class FSDirectory extends BaseDirectory {
// TODO: can/should we do if (Constants.WINDOWS) here, else throw the exc?
// but what about a Linux box with a CIFS mount?
- //System.out.println("FS.deleteFile failed (" + ioe + "): will retry later");
pendingDeletes.add(name);
- return false;
}
}
@@ -354,61 +333,17 @@ public abstract class FSDirectory extends BaseDirectory {
/** Try to delete any pending files that we had previously tried to delete but failed
* because we are on Windows and the files were still held open. */
- public synchronized void deletePendingFiles() throws IOException {
+ public void deletePendingFiles() throws IOException {
+ // nocommit do we need exponential backoff here for windows?
+
// TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
- // Clone the set because it will change as we iterate:
- List<String> toDelete = new ArrayList<>(pendingDeletes);
- System.out.println("del pending: " + pendingDeletes);
-
- // First pass: delete any segments_N files. We do these first to be certain stale commit points are removed
- // before we remove any files they reference. If any delete of segments_N fails, we leave all other files
- // undeleted so index is never in a corrupt state:
- Throwable firstException = null;
- for (String fileName : toDelete) {
- if (fileName.startsWith(IndexFileNames.SEGMENTS)) {
- try {
- if (deleteFile(fileName) == false) {
- // nocommit
- System.out.println(" false on " + fileName + "; skipping the rest");
- return;
- }
- } catch (Throwable t) {
- if (firstException == null) {
- firstException = t;
- } else {
- firstException.addSuppressed(t);
- }
- // nocommit
- System.out.println(" fail on " + fileName + ":");
- t.printStackTrace(System.out);
- throw t;
- }
- }
- }
+ Set<String> toDelete = new HashSet<>(pendingDeletes);
- // Only delete other files if we were able to remove the segments_N files; this way we never
- // leave a corrupt commit in the index even in the presense of virus checkers:
- for(String fileName : toDelete) {
- if (fileName.startsWith(IndexFileNames.SEGMENTS) == false) {
- try {
- deleteFile(fileName);
- } catch (Throwable t) {
- if (firstException == null) {
- firstException = t;
- } else {
- firstException.addSuppressed(t);
- }
- // nocommit
- System.out.println(" fail on " + fileName + ":");
- t.printStackTrace(System.out);
- throw t;
- }
- }
+ // nocommit heroic exceptions here or not?
+ for(String name : toDelete) {
+ deleteFile(name);
}
-
- // Does nothing if firstException is null:
- IOUtils.reThrow(firstException);
}
final class FSIndexOutput extends OutputStreamIndexOutput {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
index 13bc217..59b8d57 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
@@ -140,20 +140,11 @@ public class FileSwitchDirectory extends Directory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
- Set<String> primaryToDelete = new HashSet<>();
- Set<String> secondaryToDelete = new HashSet<>();
- for(String name : names) {
- if (getDirectory(name) == primaryDir) {
- primaryToDelete.add(name);
- } else {
- secondaryToDelete.add(name);
- }
- }
- try {
- primaryDir.deleteFiles(primaryToDelete);
- } finally {
- secondaryDir.deleteFiles(secondaryToDelete);
+ public void deleteFile(String name) throws IOException {
+ if (getDirectory(name) == primaryDir) {
+ primaryDir.deleteFile(name);
+ } else {
+ secondaryDir.deleteFile(name);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
index 9ee2928..7c550c1 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
@@ -58,8 +58,8 @@ public class FilterDirectory extends Directory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
- in.deleteFiles(names);
+ public void deleteFile(String name) throws IOException {
+ in.deleteFile(name);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java b/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
index 3ed659a..389c56d 100644
--- a/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
@@ -33,9 +33,9 @@ public final class LockValidatingDirectoryWrapper extends FilterDirectory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
+ public void deleteFile(String name) throws IOException {
writeLock.ensureValid();
- in.deleteFiles(names);
+ in.deleteFile(name);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
index 1b8404b..5a38b44 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
@@ -20,12 +20,10 @@ package org.apache.lucene.store;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.NoSuchFileException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import org.apache.lucene.store.RAMDirectory; // javadocs
@@ -112,23 +110,14 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
}
@Override
- public synchronized void deleteFiles(Collection<String> names) throws IOException {
+ public synchronized void deleteFile(String name) throws IOException {
if (VERBOSE) {
- System.out.println("nrtdir.deleteFiles names=" + names);
+ System.out.println("nrtdir.deleteFile name=" + name);
}
- Set<String> cacheToDelete = new HashSet<>();
- Set<String> toDelete = new HashSet<>();
- for(String name : names) {
- if (cache.fileNameExists(name)) {
- cacheToDelete.add(name);
- } else {
- toDelete.add(name);
- }
- }
- try {
- cache.deleteFiles(cacheToDelete);
- } finally {
- in.deleteFiles(toDelete);
+ if (cache.fileNameExists(name)) {
+ cache.deleteFile(name);
+ } else {
+ in.deleteFile(name);
}
}
@@ -155,14 +144,14 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
System.out.println(" to cache");
}
try {
- in.deleteFiles(Collections.singleton(name));
+ in.deleteFile(name);
} catch (IOException ioe) {
// This is fine: file may not exist
}
return cache.createOutput(name, context);
} else {
try {
- cache.deleteFiles(Collections.singleton(name));
+ cache.deleteFile(name);
} catch (IOException ioe) {
// This is fine: file may not exist
}
@@ -332,7 +321,7 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
synchronized(this) {
// Must sync here because other sync methods have
// if (cache.fileNameExists(name)) { ... } else { ... }:
- cache.deleteFiles(Collections.singleton(fileName));
+ cache.deleteFile(fileName);
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
index 7be4679..d1dc0d0 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
@@ -157,16 +157,14 @@ public class RAMDirectory extends BaseDirectory implements Accountable {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
+ public void deleteFile(String name) throws IOException {
ensureOpen();
- for(String name : names) {
- RAMFile file = fileMap.remove(name);
- if (file != null) {
- file.directory = null;
- sizeInBytes.addAndGet(-file.sizeInBytes);
- } else {
- throw new FileNotFoundException(name);
- }
+ RAMFile file = fileMap.remove(name);
+ if (file != null) {
+ file.directory = null;
+ sizeInBytes.addAndGet(-file.sizeInBytes);
+ } else {
+ throw new FileNotFoundException(name);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java b/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
index 49d70f8..aa7214c 100644
--- a/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
@@ -18,7 +18,6 @@ package org.apache.lucene.store;
*/
import java.io.IOException;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -34,11 +33,9 @@ public final class TrackingDirectoryWrapper extends FilterDirectory {
}
@Override
- public void deleteFiles(Collection<String> names) throws IOException {
- in.deleteFiles(names);
- for(String name : names) {
- createdFileNames.remove(name);
- }
+ public void deleteFile(String name) throws IOException {
+ in.deleteFile(name);
+ createdFileNames.remove(name);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
index 3be3d7f..f6a6272 100644
--- a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
@@ -38,10 +38,8 @@ import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.Collection;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.Set;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
@@ -193,10 +191,12 @@ public final class IOUtils {
* Note that the files should not be null.
*/
public static void deleteFilesIgnoringExceptions(Directory dir, Collection<String> files) {
- try {
- dir.deleteFiles(files);
- } catch (Throwable ignored) {
- // ignore
+ for(String name : files) {
+ try {
+ dir.deleteFile(name);
+ } catch (Throwable ignored) {
+ // ignore
+ }
}
}
@@ -215,15 +215,21 @@ public final class IOUtils {
* @param names file names to delete
*/
public static void deleteFiles(Directory dir, Collection<String> names) throws IOException {
- Set<String> nonNullNames = new HashSet<>();
- for(String name : names) {
+ Throwable th = null;
+ for (String name : names) {
if (name != null) {
- nonNullNames.add(name);
+ try {
+ dir.deleteFile(name);
+ } catch (Throwable t) {
+ addSuppressed(th, t);
+ if (th == null) {
+ th = t;
+ }
+ }
}
}
- if (names.isEmpty() == false) {
- dir.deleteFiles(names);
- }
+
+ reThrow(th);
}
public static void deleteFiles(Directory dir, String... files) throws IOException {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
index 328ea2e..e47830d 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
@@ -22,7 +22,6 @@ import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -40,8 +39,8 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.IntroSorter;
import org.apache.lucene.util.LongBitSet;
import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
import org.apache.lucene.util.OfflineSorter;
+import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
import org.apache.lucene.util.PriorityQueue;
import org.apache.lucene.util.RamUsageEstimator;
import org.apache.lucene.util.StringHelper;
@@ -821,7 +820,7 @@ public class BKDWriter implements Closeable {
//System.out.println("sort time: " + ((t1-t0)/1000000.0) + " msec");
if (tempInput != null) {
- tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
+ tempDir.deleteFile(tempInput.getName());
tempInput = null;
} else {
assert heapPointWriter != null;
@@ -914,7 +913,7 @@ public class BKDWriter implements Closeable {
try {
tempInput.close();
} finally {
- tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
+ tempDir.deleteFile(tempInput.getName());
tempInput = null;
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
index 0751354..83ff90b 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
@@ -18,7 +18,6 @@ package org.apache.lucene.util.bkd;
*/
import java.io.IOException;
-import java.util.Collections;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
@@ -75,7 +74,7 @@ final class OfflinePointWriter implements PointWriter {
@Override
public void destroy() throws IOException {
- tempDir.deleteFiles(Collections.singleton(out.getName()));
+ tempDir.deleteFile(out.getName());
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
index fa773fa..4ffc1f8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
@@ -17,9 +17,6 @@ package org.apache.lucene.index;
* limitations under the License.
*/
-import java.io.IOException;
-import java.util.Arrays;
-
import org.apache.lucene.document.Document;
import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.NumericDocValuesField;
@@ -48,7 +45,9 @@ public class TestCodecHoldsOpenFiles extends LuceneTestCase {
w.commit();
w.close();
- d.deleteFiles(Arrays.asList(d.listAll()));
+ for (String name : d.listAll()) {
+ d.deleteFile(name);
+ }
for(LeafReaderContext cxt : r.leaves()) {
TestUtil.checkReader(cxt.reader());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
index 6d7d1de..f15f673 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
@@ -19,7 +19,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -35,9 +34,8 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.MockDirectoryWrapper;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
@@ -297,7 +295,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
break;
}
- dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
+ dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
gen--;
}
@@ -375,7 +373,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
while(gen > 0) {
IndexReader reader = DirectoryReader.open(dir);
reader.close();
- dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
+ dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
gen--;
if (gen > 0) {
@@ -602,7 +600,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
}
}
if (i < N) {
- dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
+ dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
}
gen--;
}
@@ -716,7 +714,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
}
}
if (i < N) {
- dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
+ dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
}
gen--;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
index 934ec73..2040c72 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
@@ -19,7 +19,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -40,8 +39,8 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
@@ -708,7 +707,7 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
// Blow away the index:
for(String fileName : dir.listAll()) {
- dir.deleteFiles(Collections.singleton(fileName));
+ dir.deleteFile(fileName);
}
w = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
@@ -757,7 +756,9 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
DirectoryReader r = DirectoryReader.open(dir);
// Blow away the index:
- dir.deleteFiles(Arrays.asList(dir.listAll()));
+ for(String name : dir.listAll()) {
+ dir.deleteFile(name);
+ }
w = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
doc = new Document();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
index 24ce405..705c68b 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
@@ -48,7 +48,6 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.StringHelper;
-import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
/** JUnit adaptation of an older test case DocTest. */
@@ -234,7 +233,9 @@ public class TestDoc extends LuceneTestCase {
Collection<String> filesToDelete = si.files();
codec.compoundFormat().write(dir, si, context);
si.setUseCompoundFile(true);
- si1.info.dir.deleteFiles(filesToDelete);
+ for(String name : filesToDelete) {
+ si1.info.dir.deleteFile(name);
+ }
}
return new SegmentCommitInfo(si, 0, -1L, -1L, -1L);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index fa9f1a7..a5e3c7e 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -18,6 +18,9 @@ package org.apache.lucene.index;
*/
import java.io.*;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -26,6 +29,8 @@ import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
+import org.apache.lucene.mockfile.FilterPath;
+import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
@@ -219,8 +224,14 @@ public class TestIndexFileDeleter extends LuceneTestCase {
}
public void testVirusScannerDoesntCorruptIndex() throws IOException {
- MockDirectoryWrapper dir = newMockDirectory();
- dir.setPreventDoubleWrite(false); // we arent trying to test this
+ Path path = createTempDir();
+ VirusCheckingFS fs = new VirusCheckingFS(path.getFileSystem(), random());
+ FileSystem filesystem = fs.getFileSystem(URI.create("file:///"));
+ fs.disable();
+
+ Path path2 = new FilterPath(path, filesystem);
+
+ Directory dir = newFSDirectory(path2);
// add empty commit
new IndexWriter(dir, new IndexWriterConfig(null)).close();
@@ -228,25 +239,12 @@ public class TestIndexFileDeleter extends LuceneTestCase {
dir.createOutput("_0.si", IOContext.DEFAULT).close();
// start virus scanner
- final AtomicBoolean stopScanning = new AtomicBoolean();
- dir.failOn(new MockDirectoryWrapper.Failure() {
- @Override
- public void eval(MockDirectoryWrapper dir) throws IOException {
- if (stopScanning.get()) {
- return;
- }
- for (StackTraceElement f : new Exception().getStackTrace()) {
- if ("deleteFile".equals(f.getMethodName())) {
- throw new IOException("temporarily cannot delete file");
- }
- }
- }
- });
+ fs.enable();
IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(null));
iw.addDocument(new Document());
// stop virus scanner
- stopScanning.set(true);
+ fs.disable();
iw.commit();
iw.close();
dir.close();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
index db2253b..6daa3ca 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
@@ -57,14 +57,14 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.InfoStream;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.TestUtil;
@SuppressCodecs("SimpleText") // too slow here
@@ -916,7 +916,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
if (SegmentInfos.class.getName().equals(trace[i].getClassName()) && stage.equals(trace[i].getMethodName())) {
isCommit = true;
}
- if (MockDirectoryWrapper.class.getName().equals(trace[i].getClassName()) && "deleteFiles".equals(trace[i].getMethodName())) {
+ if (MockDirectoryWrapper.class.getName().equals(trace[i].getClassName()) && "deleteFile".equals(trace[i].getMethodName())) {
isDelete = true;
}
if (SegmentInfos.class.getName().equals(trace[i].getClassName()) && "writeGlobalFieldMap".equals(trace[i].getMethodName())) {
@@ -1205,7 +1205,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
}
in.close();
out.close();
- dir.deleteFiles(Collections.singleton(fileNameIn));
+ dir.deleteFile(fileNameIn);
IndexReader reader = null;
try {
@@ -1255,7 +1255,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
assertTrue(si.info.getUseCompoundFile());
List<String> victims = new ArrayList<String>(si.info.files());
Collections.shuffle(victims, random());
- dir.deleteFiles(Collections.singleton(victims.get(0)));
+ dir.deleteFile(victims.get(0));
corrupted = true;
break;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
index bb452bf..1d53c5a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
*/
import java.io.IOException;
-import java.util.Arrays;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
@@ -26,9 +25,8 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.Constants;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.TestUtil;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
/** LUCENE-5574 */
@SuppressFileSystems("WindowsFS") // the bug doesn't happen on windows.
@@ -62,7 +60,9 @@ public class TestNRTReaderCleanup extends LuceneTestCase {
w.close();
// Blow away index and make a new writer:
- dir.deleteFiles(Arrays.asList(dir.listAll()));
+ for(String name : dir.listAll()) {
+ dir.deleteFile(name);
+ }
w = new RandomIndexWriter(random(), dir);
w.addDocument(doc);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
index 3b65389..9c68b9e 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
@@ -21,10 +21,8 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
-import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
@@ -82,7 +80,7 @@ public class TestDirectory extends LuceneTestCase {
}
// delete with a different dir
- dirs[(i+1)%dirs.length].deleteFiles(Collections.singleton(fname));
+ dirs[(i+1)%dirs.length].deleteFile(fname);
for (int j=0; j<dirs.length; j++) {
FSDirectory d2 = dirs[j];
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
index 71284f1..7cb36d6 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
@@ -20,7 +20,6 @@ package org.apache.lucene.store;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Collections;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.TestUtil;
@@ -88,7 +87,7 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
Lock lock = dir.obtainLock("test.lock");
lock.ensureValid();
- dir.deleteFiles(Collections.singleton("test.lock"));
+ dir.deleteFile("test.lock");
try {
lock.ensureValid();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
index 793c005..2baab10 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
@@ -19,7 +19,6 @@ package org.apache.lucene.store;
import java.io.IOException;
import java.nio.file.Path;
-import java.util.Collections;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.TestUtil;
@@ -41,7 +40,7 @@ public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
lock.ensureValid();
try {
- dir.deleteFiles(Collections.singleton("test.lock"));
+ dir.deleteFile("test.lock");
} catch (Exception e) {
// we can't delete a file for some reason, just clean up and assume the test.
IOUtils.closeWhileHandlingException(lock);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
index f9551d6..0985587 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestTrackingDirectoryWrapper.java
@@ -43,7 +43,7 @@ public class TestTrackingDirectoryWrapper extends BaseDirectoryTestCase {
TrackingDirectoryWrapper dir = new TrackingDirectoryWrapper(new RAMDirectory());
dir.createOutput("foo", newIOContext(random())).close();
assertEquals(asSet("foo"), dir.getCreatedFiles());
- dir.deleteFiles(Collections.singleton("foo"));
+ dir.deleteFile("foo");
assertEquals(Collections.emptySet(), dir.getCreatedFiles());
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
index dc17f96..0a414ae 100644
--- a/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
+++ b/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
@@ -22,7 +22,6 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
-import java.util.Collections;
import java.util.List;
import org.apache.lucene.index.PointValues.IntersectVisitor;
@@ -818,9 +817,9 @@ public class TestBKD extends LuceneTestCase {
}
}
in.close();
- dir.deleteFiles(Collections.singleton("bkd"));
+ dir.deleteFile("bkd");
if (toMerge != null) {
- dir.deleteFiles(Collections.singleton("bkd2"));
+ dir.deleteFile("bkd2");
}
success = true;
} finally {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
index e3868e4..2a239a4 100644
--- a/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
+++ b/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
@@ -18,7 +18,6 @@ package org.apache.lucene.util.fst;
*/
import java.util.Arrays;
-import java.util.Collections;
import java.util.Random;
import org.apache.lucene.store.Directory;
@@ -128,7 +127,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFiles(Collections.singleton("fst"));
+ dir.deleteFile("fst");
}
}
}
@@ -205,7 +204,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFiles(Collections.singleton("fst"));
+ dir.deleteFile("fst");
}
}
}
@@ -289,7 +288,7 @@ public class Test2BFST extends LuceneTestCase {
fst = new FST<>(in, outputs);
in.close();
} else {
- dir.deleteFiles(Collections.singleton("fst"));
+ dir.deleteFile("fst");
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
index e11cfef..bab144b 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
@@ -22,7 +22,6 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Random;
@@ -841,7 +840,7 @@ public class TestPackedInts extends LuceneTestCase {
assertEquals(mutable.get(i), reader.get(i));
}
in.close();
- directory.deleteFiles(Collections.singleton("packed-ints.bin"));
+ directory.deleteFile("packed-ints.bin");
}
directory.close();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
index 43763e2..51d7e92 100644
--- a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
+++ b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
@@ -148,7 +148,6 @@ public class NativeUnixDirectory extends FSDirectory {
if (context.context != Context.MERGE || context.mergeInfo.estimatedMergeBytes < minBytesDirect) {
return delegate.createOutput(name, context);
} else {
- ensureCanWrite(name);
return new NativeUnixIndexOutput(getDirectory().resolve(name), name, mergeBufferSize);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
index cb2d38c..f54ad03 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
@@ -487,7 +487,7 @@ public class AnalyzingSuggester extends Lookup implements Accountable {
tempSortedFileName = sorter.sort(tempInput.getName());
// Free disk space:
- tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
+ tempDir.deleteFile(tempInput.getName());
reader = new OfflineSorter.ByteSequencesReader(tempDir.openInput(tempSortedFileName, IOContext.READONCE));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
index 132c630..7f907af 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
@@ -69,7 +69,7 @@ public class ExternalRefSorter implements BytesRefSorter, Closeable {
success = true;
} finally {
if (success) {
- sorter.getDirectory().deleteFiles(Collections.singleton(input.getName()));
+ sorter.getDirectory().deleteFile(input.getName());
} else {
IOUtils.deleteFilesIgnoringExceptions(sorter.getDirectory(), input.getName());
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
index d178aa4..24dd0f9 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
@@ -204,7 +204,7 @@ public class FSTCompletionLookup extends Lookup implements Accountable {
// We don't know the distribution of scores and we need to bucket them, so we'll sort
// and divide into equal buckets.
tempSortedFileName = sorter.sort(tempInput.getName());
- tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
+ tempDir.deleteFile(tempInput.getName());
FSTCompletionBuilder builder = new FSTCompletionBuilder(
buckets, externalSorter, sharedTailLength);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
index de77e96..208eab9 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
@@ -76,7 +76,7 @@ public class VocabularyAssert {
/** Run a vocabulary test against a tab-separated data file inside a zip file */
public static void assertVocabulary(Analyzer a, Path zipFile, String vocOut) throws IOException {
- Path tmp = LuceneTestCase.createTempDir();
+ Path tmp = LuceneTestCase.createTempDir().resolve("unzipped");
try (InputStream in = Files.newInputStream(zipFile)) {
TestUtil.unzip(in, tmp);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
index 0c40bb3..7cee89e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
@@ -247,7 +247,7 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
si.getCodec().compoundFormat().write(dir, si, IOContext.DEFAULT);
Directory cfs = si.getCodec().compoundFormat().getCompoundReader(dir, si, IOContext.DEFAULT);
try {
- cfs.deleteFiles(Collections.singleton(testfile));
+ cfs.deleteFile(testfile);
fail("didn't get expected exception");
} catch (UnsupportedOperationException expected) {
// expected UOE
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
index b30ce94..759a840 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -46,6 +46,10 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
this.random = new Random(random.nextLong());
}
+ public void enable() {
+ enabled = true;
+ }
+
public void disable() {
enabled = false;
}
@@ -57,7 +61,7 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
&& Files.exists(path) // important that we NOT delay a NoSuchFileException until later
&& path.getFileName().toString().equals(IndexWriter.WRITE_LOCK_NAME) == false // life is particularly difficult if the virus checker hits our lock file
&& random.nextInt(5) == 1) {
- if (true || LuceneTestCase.VERBOSE) {
+ if (LuceneTestCase.VERBOSE) {
System.out.println("NOTE: VirusCheckingFS now refusing to delete " + path);
}
throw new AccessDeniedException("VirusCheckingFS is randomly refusing to delete file \"" + path + "\"");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index db83153..ef8bf70 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -164,7 +164,7 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
int count = dir.listAll().length;
dir.createOutput("foo.txt", IOContext.DEFAULT).close();
assertEquals(count+1, dir.listAll().length);
- dir.deleteFiles(Collections.singleton("foo.txt"));
+ dir.deleteFile("foo.txt");
assertEquals(count, dir.listAll().length);
dir.close();
}
@@ -751,7 +751,8 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
}
in2.close();
- dir.deleteFiles(Arrays.asList(new String[] {"test", "test2"}));
+ dir.deleteFile("test");
+ dir.deleteFile("test2");
dir.close();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index 3bd2319..3c79410 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -43,7 +43,6 @@ import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.NoDeletionPolicy;
-import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
@@ -279,7 +278,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
if (damage == 0) {
action = "deleted";
- deleteFiles(Collections.singleton(name));
+ deleteFile(name);
} else if (damage == 1) {
action = "zeroed";
// Zero out file entirely
@@ -313,7 +312,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
ii.close();
// Delete original and copy bytes back:
- deleteFiles(Collections.singleton(name));
+ deleteFile(name);
try(IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
ii = in.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
@@ -328,14 +327,14 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
throw ioe;
}
}
- deleteFiles(Collections.singleton(tempFileName));
+ deleteFile(tempFileName);
} else if (damage == 3) {
// The file survived intact:
action = "didn't change";
} else {
action = "fully truncated";
// Totally truncate the file to zero bytes
- deleteFiles(Collections.singleton(name));
+ deleteFile(name);
try (IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
} catch (IOException ioe) {
// VirusCheckingFS may have blocked the delete, at which point FSDir cannot overwrite here
@@ -449,7 +448,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
}
@Override
- public synchronized void deleteFiles(Collection<String> names) throws IOException {
+ public synchronized void deleteFile(String name) throws IOException {
maybeYield();
maybeThrowDeterministicException();
@@ -458,19 +457,17 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
throw new IOException("cannot delete after crash");
}
- for(String name : names) {
- if (openFiles.containsKey(name)) {
- openFilesDeleted.add(name);
- if (assertNoDeleteOpenFile) {
- throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot delete"), name, true);
- }
- } else {
- openFilesDeleted.remove(name);
+ if (openFiles.containsKey(name)) {
+ openFilesDeleted.add(name);
+ if (assertNoDeleteOpenFile) {
+ throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open: cannot delete"), name, true);
}
+ } else {
+ openFilesDeleted.remove(name);
}
- unSyncedFiles.removeAll(names);
- in.deleteFiles(names);
+ unSyncedFiles.remove(name);
+ in.deleteFile(name);
}
// sets the cause of the incoming ioe to be the stack
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a741ea53/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java b/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
index 3800ff7..a2ace61 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java
@@ -317,7 +317,7 @@ public class FSTTester<T> {
fst = new FST<>(in, outputs);
} finally {
in.close();
- dir.deleteFiles(Collections.singleton("fst.bin"));
+ dir.deleteFile("fst.bin");
}
}
[11/17] lucene-solr git commit: make all Directory.listAll's sort,
and add BaseDirectoryTestCase; add TODO;
suppress VirusCheckingFS for another test
Posted by mi...@apache.org.
make all Directory.listAll's sort, and add BaseDirectoryTestCase; add TODO; suppress VirusCheckingFS for another test
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/dd6379c0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/dd6379c0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/dd6379c0
Branch: refs/heads/master
Commit: dd6379c05fa879705fc4717d60c9f44fd47659c0
Parents: 9cf74f7
Author: Mike McCandless <mi...@apache.org>
Authored: Thu Feb 4 12:17:46 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Thu Feb 4 12:17:46 2016 -0500
----------------------------------------------------------------------
.../src/java/org/apache/lucene/index/IndexFileDeleter.java | 5 +++--
.../core/src/java/org/apache/lucene/index/IndexWriter.java | 5 +++--
lucene/core/src/java/org/apache/lucene/store/Directory.java | 2 +-
.../core/src/java/org/apache/lucene/store/RAMDirectory.java | 9 +++++++--
.../src/test/org/apache/lucene/index/TestIndexWriter.java | 2 +-
.../search/suggest/analyzing/AnalyzingInfixSuggester.java | 3 ++-
.../suggest/analyzing/AnalyzingInfixSuggesterTest.java | 2 ++
.../search/suggest/analyzing/BlendedInfixSuggesterTest.java | 2 ++
8 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
index 2e5d5cf..d00cec8 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
@@ -699,14 +699,15 @@ final class IndexFileDeleter implements Closeable {
infoStream.message("IFD", "delete \"" + names + "\"");
}
- // nocommit put annoying windows-specific segments_N heroics back?
-
for(String name : names) {
try {
directory.deleteFile(name);
} catch (NoSuchFileException | FileNotFoundException e) {
// IndexWriter should only ask us to delete files it knows it wrote, so if we hit this, something is wrong!
+
if (Constants.WINDOWS) {
+ // TODO: can we remove this OS-specific hacky logic? If windows deleteFile is buggy, we should instead contain this workaround in
+ // a WindowsFSDirectory ...
// LUCENE-6684: we suppress this assert for Windows, since a file could be in a confusing "pending delete" state, and falsely
// return NSFE/FNFE
} else {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index f161f5a..7d72603 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -754,8 +754,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
* IO error
*/
public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException {
- if (d instanceof FSDirectory && ((FSDirectory) d).checkPendingDeletions()) {
- throw new IllegalArgumentException("Directory still has pending deleted files");
+ Directory unwrapped = FilterDirectory.unwrap(d);
+ if (unwrapped instanceof FSDirectory && ((FSDirectory) unwrapped).checkPendingDeletions()) {
+ throw new IllegalArgumentException("Directory still has pending deleted files; cannot initialize IndexWriter");
}
conf.setIndexWriter(this); // prevent reuse by other instances
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java
index 6aa46e9..f13150c 100644
--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java
@@ -43,7 +43,7 @@ import org.apache.lucene.util.IOUtils;
public abstract class Directory implements Closeable {
/**
- * Returns an array of strings, one for each entry in the directory.
+ * Returns an array of strings, one for each entry in the directory, in sorted (UTF16, java's String.compare) order.
*
* @throws IOException in case of IO error
*/
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
index d1dc0d0..a001a0e 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
@@ -21,6 +21,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -119,8 +120,12 @@ public class RAMDirectory extends BaseDirectory implements Accountable {
// concurrently
Set<String> fileNames = fileMap.keySet();
List<String> names = new ArrayList<>(fileNames.size());
- for (String name : fileNames) names.add(name);
- return names.toArray(new String[names.size()]);
+ for (String name : fileNames) {
+ names.add(name);
+ }
+ String[] namesArray = names.toArray(new String[names.size()]);
+ Arrays.sort(namesArray);
+ return namesArray;
}
public final boolean fileNameExists(String name) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index a75d032..d6b8f84 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -2738,7 +2738,7 @@ public class TestIndexWriter extends LuceneTestCase {
try {
w = new IndexWriter(dir, iwc);
} catch (IllegalArgumentException iae) {
- assertEquals("Directory still has pending deleted files", iae.getMessage());
+ assertEquals("Directory still has pending deleted files; cannot initialize IndexWriter", iae.getMessage());
}
in.close();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java
index 5aaabbd..760535f 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.StringReader;
import java.nio.file.Path;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -58,8 +59,8 @@ import org.apache.lucene.index.SegmentReader;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.SortingMergePolicy;
import org.apache.lucene.index.Term;
-import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Collector;
import org.apache.lucene.search.EarlyTerminatingSortingCollector;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
index b51894d..8fc65d7 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
@@ -45,10 +45,12 @@ import org.apache.lucene.search.suggest.Lookup.LookupResult;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.junit.Test;
+@SuppressFileSystems("VirusCheckingFS")
public class AnalyzingInfixSuggesterTest extends LuceneTestCase {
public void testBasic() throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dd6379c0/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
index 614a1a2..470d6a2 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
@@ -33,9 +33,11 @@ import org.apache.lucene.search.suggest.Input;
import org.apache.lucene.search.suggest.InputArrayIterator;
import org.apache.lucene.search.suggest.Lookup;
import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
+@SuppressFileSystems("VirusCheckingFS")
public class BlendedInfixSuggesterTest extends LuceneTestCase {
[03/17] lucene-solr git commit: migrate current patch from svn
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index baa2484..3b45036 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -22,7 +22,11 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.io.StringReader;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -58,6 +62,8 @@ import org.apache.lucene.document.StoredField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
+import org.apache.lucene.mockfile.FilterPath;
+import org.apache.lucene.mockfile.WindowsFS;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
@@ -67,10 +73,12 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.BaseDirectoryWrapper;
import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.LockObtainFailedException;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.store.NIOFSDirectory;
import org.apache.lucene.store.NoLockFactory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSLockFactory;
@@ -90,494 +98,467 @@ import org.junit.Test;
public class TestIndexWriter extends LuceneTestCase {
- private static final FieldType storedTextType = new FieldType(TextField.TYPE_NOT_STORED);
- public void testDocCount() throws IOException {
- Directory dir = newDirectory();
-
- IndexWriter writer = null;
- IndexReader reader = null;
- int i;
+ private static final FieldType storedTextType = new FieldType(TextField.TYPE_NOT_STORED);
+ public void testDocCount() throws IOException {
+ Directory dir = newDirectory();
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ IndexWriter writer = null;
+ IndexReader reader = null;
+ int i;
- // add 100 documents
- for (i = 0; i < 100; i++) {
- addDocWithIndex(writer,i);
- }
- assertEquals(100, writer.maxDoc());
- writer.close();
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- // delete 40 documents
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setMergePolicy(NoMergePolicy.INSTANCE));
- for (i = 0; i < 40; i++) {
- writer.deleteDocuments(new Term("id", ""+i));
- }
- writer.close();
+ // add 100 documents
+ for (i = 0; i < 100; i++) {
+ addDocWithIndex(writer,i);
+ }
+ assertEquals(100, writer.maxDoc());
+ writer.close();
- reader = DirectoryReader.open(dir);
- assertEquals(60, reader.numDocs());
- reader.close();
+ // delete 40 documents
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setMergePolicy(NoMergePolicy.INSTANCE));
+ for (i = 0; i < 40; i++) {
+ writer.deleteDocuments(new Term("id", ""+i));
+ }
+ writer.close();
- // merge the index down and check that the new doc count is correct
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- assertEquals(60, writer.numDocs());
- writer.forceMerge(1);
- assertEquals(60, writer.maxDoc());
- assertEquals(60, writer.numDocs());
- writer.close();
+ reader = DirectoryReader.open(dir);
+ assertEquals(60, reader.numDocs());
+ reader.close();
- // check that the index reader gives the same numbers.
- reader = DirectoryReader.open(dir);
- assertEquals(60, reader.maxDoc());
- assertEquals(60, reader.numDocs());
- reader.close();
-
- // make sure opening a new index for create over
- // this existing one works correctly:
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.CREATE));
- assertEquals(0, writer.maxDoc());
- assertEquals(0, writer.numDocs());
- writer.close();
- dir.close();
- }
+ // merge the index down and check that the new doc count is correct
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ assertEquals(60, writer.numDocs());
+ writer.forceMerge(1);
+ assertEquals(60, writer.maxDoc());
+ assertEquals(60, writer.numDocs());
+ writer.close();
- static void addDoc(IndexWriter writer) throws IOException
- {
- Document doc = new Document();
- doc.add(newTextField("content", "aaa", Field.Store.NO));
- writer.addDocument(doc);
- }
+ // check that the index reader gives the same numbers.
+ reader = DirectoryReader.open(dir);
+ assertEquals(60, reader.maxDoc());
+ assertEquals(60, reader.numDocs());
+ reader.close();
- static void addDocWithIndex(IndexWriter writer, int index) throws IOException
- {
- Document doc = new Document();
- doc.add(newField("content", "aaa " + index, storedTextType));
- doc.add(newField("id", "" + index, storedTextType));
- writer.addDocument(doc);
- }
+ // make sure opening a new index for create over
+ // this existing one works correctly:
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.CREATE));
+ assertEquals(0, writer.maxDoc());
+ assertEquals(0, writer.numDocs());
+ writer.close();
+ dir.close();
+ }
+ static void addDoc(IndexWriter writer) throws IOException
+ {
+ Document doc = new Document();
+ doc.add(newTextField("content", "aaa", Field.Store.NO));
+ writer.addDocument(doc);
+ }
+ static void addDocWithIndex(IndexWriter writer, int index) throws IOException
+ {
+ Document doc = new Document();
+ doc.add(newField("content", "aaa " + index, storedTextType));
+ doc.add(newField("id", "" + index, storedTextType));
+ writer.addDocument(doc);
+ }
- // TODO: we have the logic in MDW to do this check, and it's better, because it knows about files it tried
- // to delete but couldn't: we should replace this!!!!
- public static void assertNoUnreferencedFiles(Directory dir, String message) throws IOException {
- if (dir instanceof MockDirectoryWrapper) {
- assertFalse("test is broken: should disable virus scanner", ((MockDirectoryWrapper)dir).getEnableVirusScanner());
- }
- String[] startFiles = dir.listAll();
- new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random()))).rollback();
- String[] endFiles = dir.listAll();
+ // TODO: we have the logic in MDW to do this check, and it's better, because it knows about files it tried
+ // to delete but couldn't: we should replace this!!!!
+ public static void assertNoUnreferencedFiles(Directory dir, String message) throws IOException {
+ String[] startFiles = dir.listAll();
+ new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random()))).rollback();
+ String[] endFiles = dir.listAll();
- Arrays.sort(startFiles);
- Arrays.sort(endFiles);
+ Arrays.sort(startFiles);
+ Arrays.sort(endFiles);
- if (!Arrays.equals(startFiles, endFiles)) {
- fail(message + ": before delete:\n " + arrayToString(startFiles) + "\n after delete:\n " + arrayToString(endFiles));
- }
+ if (!Arrays.equals(startFiles, endFiles)) {
+ fail(message + ": before delete:\n " + arrayToString(startFiles) + "\n after delete:\n " + arrayToString(endFiles));
}
+ }
- static String arrayToString(String[] l) {
- String s = "";
- for(int i=0;i<l.length;i++) {
- if (i > 0) {
- s += "\n ";
- }
- s += l[i];
+ static String arrayToString(String[] l) {
+ String s = "";
+ for(int i=0;i<l.length;i++) {
+ if (i > 0) {
+ s += "\n ";
}
- return s;
+ s += l[i];
}
+ return s;
+ }
- // Make sure we can open an index for create even when a
- // reader holds it open (this fails pre lock-less
- // commits on windows):
- public void testCreateWithReader() throws IOException {
- Directory dir = newDirectory();
+ // Make sure we can open an index for create even when a
+ // reader holds it open (this fails pre lock-less
+ // commits on windows):
+ public void testCreateWithReader() throws IOException {
+ Directory dir = newDirectory();
- // add one document & close writer
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- addDoc(writer);
- writer.close();
+ // add one document & close writer
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ addDoc(writer);
+ writer.close();
- // now open reader:
- IndexReader reader = DirectoryReader.open(dir);
- assertEquals("should be one document", reader.numDocs(), 1);
+ // now open reader:
+ IndexReader reader = DirectoryReader.open(dir);
+ assertEquals("should be one document", reader.numDocs(), 1);
- // now open index for create:
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.CREATE));
- assertEquals("should be zero documents", writer.maxDoc(), 0);
- addDoc(writer);
- writer.close();
+ // now open index for create:
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.CREATE));
+ assertEquals("should be zero documents", writer.maxDoc(), 0);
+ addDoc(writer);
+ writer.close();
- assertEquals("should be one document", reader.numDocs(), 1);
- IndexReader reader2 = DirectoryReader.open(dir);
- assertEquals("should be one document", reader2.numDocs(), 1);
- reader.close();
- reader2.close();
+ assertEquals("should be one document", reader.numDocs(), 1);
+ IndexReader reader2 = DirectoryReader.open(dir);
+ assertEquals("should be one document", reader2.numDocs(), 1);
+ reader.close();
+ reader2.close();
- dir.close();
- }
+ dir.close();
+ }
- public void testChangesAfterClose() throws IOException {
- Directory dir = newDirectory();
+ public void testChangesAfterClose() throws IOException {
+ Directory dir = newDirectory();
- IndexWriter writer = null;
+ IndexWriter writer = null;
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- addDoc(writer);
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ addDoc(writer);
- // close
- writer.close();
- try {
- addDoc(writer);
- fail("did not hit AlreadyClosedException");
- } catch (AlreadyClosedException e) {
- // expected
- }
- dir.close();
+ // close
+ writer.close();
+ try {
+ addDoc(writer);
+ fail("did not hit AlreadyClosedException");
+ } catch (AlreadyClosedException e) {
+ // expected
}
+ dir.close();
+ }
- public void testIndexNoDocuments() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- writer.commit();
- writer.close();
+ public void testIndexNoDocuments() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ writer.commit();
+ writer.close();
- IndexReader reader = DirectoryReader.open(dir);
- assertEquals(0, reader.maxDoc());
- assertEquals(0, reader.numDocs());
- reader.close();
+ IndexReader reader = DirectoryReader.open(dir);
+ assertEquals(0, reader.maxDoc());
+ assertEquals(0, reader.numDocs());
+ reader.close();
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.APPEND));
- writer.commit();
- writer.close();
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.APPEND));
+ writer.commit();
+ writer.close();
- reader = DirectoryReader.open(dir);
- assertEquals(0, reader.maxDoc());
- assertEquals(0, reader.numDocs());
- reader.close();
- dir.close();
+ reader = DirectoryReader.open(dir);
+ assertEquals(0, reader.maxDoc());
+ assertEquals(0, reader.numDocs());
+ reader.close();
+ dir.close();
+ }
+
+ public void testSmallRAMBuffer() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(
+ dir,
+ newIndexWriterConfig(new MockAnalyzer(random()))
+ .setRAMBufferSizeMB(0.000001)
+ .setMergePolicy(newLogMergePolicy(10))
+ );
+ int lastNumSegments = getSegmentCount(dir);
+ for(int j=0;j<9;j++) {
+ Document doc = new Document();
+ doc.add(newField("field", "aaa" + j, storedTextType));
+ writer.addDocument(doc);
+ // Verify that with a tiny RAM buffer we see new
+ // segment after every doc
+ int numSegments = getSegmentCount(dir);
+ assertTrue(numSegments > lastNumSegments);
+ lastNumSegments = numSegments;
}
+ writer.close();
+ dir.close();
+ }
- public void testSmallRAMBuffer() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(
- dir,
- newIndexWriterConfig(new MockAnalyzer(random()))
- .setRAMBufferSizeMB(0.000001)
- .setMergePolicy(newLogMergePolicy(10))
- );
- int lastNumSegments = getSegmentCount(dir);
- for(int j=0;j<9;j++) {
- Document doc = new Document();
- doc.add(newField("field", "aaa" + j, storedTextType));
- writer.addDocument(doc);
- // Verify that with a tiny RAM buffer we see new
- // segment after every doc
- int numSegments = getSegmentCount(dir);
- assertTrue(numSegments > lastNumSegments);
- lastNumSegments = numSegments;
- }
- writer.close();
- dir.close();
+ /** Returns how many unique segment names are in the directory. */
+ private static int getSegmentCount(Directory dir) throws IOException {
+ Set<String> segments = new HashSet<>();
+ for(String file : dir.listAll()) {
+ segments.add(IndexFileNames.parseSegmentName(file));
}
- /** Returns how many unique segment names are in the directory. */
- private static int getSegmentCount(Directory dir) throws IOException {
- Set<String> segments = new HashSet<>();
- for(String file : dir.listAll()) {
- segments.add(IndexFileNames.parseSegmentName(file));
- }
+ return segments.size();
+ }
- return segments.size();
- }
+ // Make sure it's OK to change RAM buffer size and
+ // maxBufferedDocs in a write session
+ public void testChangingRAMBuffer() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ writer.getConfig().setMaxBufferedDocs(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- // Make sure it's OK to change RAM buffer size and
- // maxBufferedDocs in a write session
- public void testChangingRAMBuffer() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- writer.getConfig().setMaxBufferedDocs(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
-
- int lastFlushCount = -1;
- for(int j=1;j<52;j++) {
- Document doc = new Document();
- doc.add(new Field("field", "aaa" + j, storedTextType));
- writer.addDocument(doc);
- TestUtil.syncConcurrentMerges(writer);
- int flushCount = writer.getFlushCount();
- if (j == 1)
- lastFlushCount = flushCount;
- else if (j < 10)
- // No new files should be created
- assertEquals(flushCount, lastFlushCount);
- else if (10 == j) {
- assertTrue(flushCount > lastFlushCount);
- lastFlushCount = flushCount;
- writer.getConfig().setRAMBufferSizeMB(0.000001);
- writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- } else if (j < 20) {
- assertTrue(flushCount > lastFlushCount);
- lastFlushCount = flushCount;
- } else if (20 == j) {
- writer.getConfig().setRAMBufferSizeMB(16);
- writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- lastFlushCount = flushCount;
- } else if (j < 30) {
- assertEquals(flushCount, lastFlushCount);
- } else if (30 == j) {
- writer.getConfig().setRAMBufferSizeMB(0.000001);
- writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- } else if (j < 40) {
- assertTrue(flushCount> lastFlushCount);
- lastFlushCount = flushCount;
- } else if (40 == j) {
- writer.getConfig().setMaxBufferedDocs(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- lastFlushCount = flushCount;
- } else if (j < 50) {
- assertEquals(flushCount, lastFlushCount);
- writer.getConfig().setMaxBufferedDocs(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- } else if (50 == j) {
- assertTrue(flushCount > lastFlushCount);
- }
+ int lastFlushCount = -1;
+ for(int j=1;j<52;j++) {
+ Document doc = new Document();
+ doc.add(new Field("field", "aaa" + j, storedTextType));
+ writer.addDocument(doc);
+ TestUtil.syncConcurrentMerges(writer);
+ int flushCount = writer.getFlushCount();
+ if (j == 1)
+ lastFlushCount = flushCount;
+ else if (j < 10)
+ // No new files should be created
+ assertEquals(flushCount, lastFlushCount);
+ else if (10 == j) {
+ assertTrue(flushCount > lastFlushCount);
+ lastFlushCount = flushCount;
+ writer.getConfig().setRAMBufferSizeMB(0.000001);
+ writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ } else if (j < 20) {
+ assertTrue(flushCount > lastFlushCount);
+ lastFlushCount = flushCount;
+ } else if (20 == j) {
+ writer.getConfig().setRAMBufferSizeMB(16);
+ writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ lastFlushCount = flushCount;
+ } else if (j < 30) {
+ assertEquals(flushCount, lastFlushCount);
+ } else if (30 == j) {
+ writer.getConfig().setRAMBufferSizeMB(0.000001);
+ writer.getConfig().setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ } else if (j < 40) {
+ assertTrue(flushCount> lastFlushCount);
+ lastFlushCount = flushCount;
+ } else if (40 == j) {
+ writer.getConfig().setMaxBufferedDocs(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ lastFlushCount = flushCount;
+ } else if (j < 50) {
+ assertEquals(flushCount, lastFlushCount);
+ writer.getConfig().setMaxBufferedDocs(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ } else if (50 == j) {
+ assertTrue(flushCount > lastFlushCount);
}
- writer.close();
- dir.close();
}
+ writer.close();
+ dir.close();
+ }
- public void testChangingRAMBuffer2() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- writer.getConfig().setMaxBufferedDocs(10);
- writer.getConfig().setMaxBufferedDeleteTerms(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ public void testChangingRAMBuffer2() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ writer.getConfig().setMaxBufferedDocs(10);
+ writer.getConfig().setMaxBufferedDeleteTerms(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- for(int j=1;j<52;j++) {
- Document doc = new Document();
- doc.add(new Field("field", "aaa" + j, storedTextType));
- writer.addDocument(doc);
- }
+ for(int j=1;j<52;j++) {
+ Document doc = new Document();
+ doc.add(new Field("field", "aaa" + j, storedTextType));
+ writer.addDocument(doc);
+ }
- int lastFlushCount = -1;
- for(int j=1;j<52;j++) {
- writer.deleteDocuments(new Term("field", "aaa" + j));
- TestUtil.syncConcurrentMerges(writer);
- int flushCount = writer.getFlushCount();
+ int lastFlushCount = -1;
+ for(int j=1;j<52;j++) {
+ writer.deleteDocuments(new Term("field", "aaa" + j));
+ TestUtil.syncConcurrentMerges(writer);
+ int flushCount = writer.getFlushCount();
- if (j == 1)
- lastFlushCount = flushCount;
- else if (j < 10) {
- // No new files should be created
- assertEquals(flushCount, lastFlushCount);
- } else if (10 == j) {
- assertTrue("" + j, flushCount > lastFlushCount);
- lastFlushCount = flushCount;
- writer.getConfig().setRAMBufferSizeMB(0.000001);
- writer.getConfig().setMaxBufferedDeleteTerms(1);
- } else if (j < 20) {
- assertTrue(flushCount > lastFlushCount);
- lastFlushCount = flushCount;
- } else if (20 == j) {
- writer.getConfig().setRAMBufferSizeMB(16);
- writer.getConfig().setMaxBufferedDeleteTerms(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- lastFlushCount = flushCount;
- } else if (j < 30) {
- assertEquals(flushCount, lastFlushCount);
- } else if (30 == j) {
- writer.getConfig().setRAMBufferSizeMB(0.000001);
- writer.getConfig().setMaxBufferedDeleteTerms(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- writer.getConfig().setMaxBufferedDeleteTerms(1);
- } else if (j < 40) {
- assertTrue(flushCount> lastFlushCount);
- lastFlushCount = flushCount;
- } else if (40 == j) {
- writer.getConfig().setMaxBufferedDeleteTerms(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- lastFlushCount = flushCount;
- } else if (j < 50) {
- assertEquals(flushCount, lastFlushCount);
- writer.getConfig().setMaxBufferedDeleteTerms(10);
- writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
- } else if (50 == j) {
- assertTrue(flushCount > lastFlushCount);
- }
+ if (j == 1)
+ lastFlushCount = flushCount;
+ else if (j < 10) {
+ // No new files should be created
+ assertEquals(flushCount, lastFlushCount);
+ } else if (10 == j) {
+ assertTrue("" + j, flushCount > lastFlushCount);
+ lastFlushCount = flushCount;
+ writer.getConfig().setRAMBufferSizeMB(0.000001);
+ writer.getConfig().setMaxBufferedDeleteTerms(1);
+ } else if (j < 20) {
+ assertTrue(flushCount > lastFlushCount);
+ lastFlushCount = flushCount;
+ } else if (20 == j) {
+ writer.getConfig().setRAMBufferSizeMB(16);
+ writer.getConfig().setMaxBufferedDeleteTerms(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ lastFlushCount = flushCount;
+ } else if (j < 30) {
+ assertEquals(flushCount, lastFlushCount);
+ } else if (30 == j) {
+ writer.getConfig().setRAMBufferSizeMB(0.000001);
+ writer.getConfig().setMaxBufferedDeleteTerms(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ writer.getConfig().setMaxBufferedDeleteTerms(1);
+ } else if (j < 40) {
+ assertTrue(flushCount> lastFlushCount);
+ lastFlushCount = flushCount;
+ } else if (40 == j) {
+ writer.getConfig().setMaxBufferedDeleteTerms(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ lastFlushCount = flushCount;
+ } else if (j < 50) {
+ assertEquals(flushCount, lastFlushCount);
+ writer.getConfig().setMaxBufferedDeleteTerms(10);
+ writer.getConfig().setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
+ } else if (50 == j) {
+ assertTrue(flushCount > lastFlushCount);
}
- writer.close();
- dir.close();
}
+ writer.close();
+ dir.close();
+ }
- public void testEnablingNorms() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setMaxBufferedDocs(10));
- // Enable norms for only 1 doc, pre flush
- FieldType customType = new FieldType(TextField.TYPE_STORED);
- customType.setOmitNorms(true);
- for(int j=0;j<10;j++) {
- Document doc = new Document();
- Field f = null;
- if (j != 8) {
- f = newField("field", "aaa", customType);
- }
- else {
- f = newField("field", "aaa", storedTextType);
- }
- doc.add(f);
- writer.addDocument(doc);
+ public void testEnablingNorms() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setMaxBufferedDocs(10));
+ // Enable norms for only 1 doc, pre flush
+ FieldType customType = new FieldType(TextField.TYPE_STORED);
+ customType.setOmitNorms(true);
+ for(int j=0;j<10;j++) {
+ Document doc = new Document();
+ Field f = null;
+ if (j != 8) {
+ f = newField("field", "aaa", customType);
}
- writer.close();
-
- Term searchTerm = new Term("field", "aaa");
-
- IndexReader reader = DirectoryReader.open(dir);
- IndexSearcher searcher = newSearcher(reader);
- ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), 1000).scoreDocs;
- assertEquals(10, hits.length);
- reader.close();
-
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(10));
- // Enable norms for only 1 doc, post flush
- for(int j=0;j<27;j++) {
- Document doc = new Document();
- Field f = null;
- if (j != 26) {
- f = newField("field", "aaa", customType);
- }
- else {
- f = newField("field", "aaa", storedTextType);
- }
- doc.add(f);
- writer.addDocument(doc);
+ else {
+ f = newField("field", "aaa", storedTextType);
}
- writer.close();
- reader = DirectoryReader.open(dir);
- searcher = newSearcher(reader);
- hits = searcher.search(new TermQuery(searchTerm), 1000).scoreDocs;
- assertEquals(27, hits.length);
- reader.close();
-
- reader = DirectoryReader.open(dir);
- reader.close();
-
- dir.close();
+ doc.add(f);
+ writer.addDocument(doc);
}
+ writer.close();
- public void testHighFreqTerm() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setRAMBufferSizeMB(0.01));
- // Massive doc that has 128 K a's
- StringBuilder b = new StringBuilder(1024*1024);
- for(int i=0;i<4096;i++) {
- b.append(" a a a a a a a a");
- b.append(" a a a a a a a a");
- b.append(" a a a a a a a a");
- b.append(" a a a a a a a a");
- }
- Document doc = new Document();
- FieldType customType = new FieldType(TextField.TYPE_STORED);
- customType.setStoreTermVectors(true);
- customType.setStoreTermVectorPositions(true);
- customType.setStoreTermVectorOffsets(true);
- doc.add(newField("field", b.toString(), customType));
- writer.addDocument(doc);
- writer.close();
+ Term searchTerm = new Term("field", "aaa");
- IndexReader reader = DirectoryReader.open(dir);
- assertEquals(1, reader.maxDoc());
- assertEquals(1, reader.numDocs());
- Term t = new Term("field", "a");
- assertEquals(1, reader.docFreq(t));
- PostingsEnum td = TestUtil.docs(random(), reader,
- "field",
- new BytesRef("a"),
- null,
- PostingsEnum.FREQS);
- td.nextDoc();
- assertEquals(128*1024, td.freq());
- reader.close();
- dir.close();
- }
+ IndexReader reader = DirectoryReader.open(dir);
+ IndexSearcher searcher = newSearcher(reader);
+ ScoreDoc[] hits = searcher.search(new TermQuery(searchTerm), 1000).scoreDocs;
+ assertEquals(10, hits.length);
+ reader.close();
- public void testFlushWithNoMerging() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(
- dir,
- newIndexWriterConfig(new MockAnalyzer(random()))
- .setMaxBufferedDocs(2)
- .setMergePolicy(newLogMergePolicy(10))
- );
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(10));
+ // Enable norms for only 1 doc, post flush
+ for(int j=0;j<27;j++) {
Document doc = new Document();
- FieldType customType = new FieldType(TextField.TYPE_STORED);
- customType.setStoreTermVectors(true);
- customType.setStoreTermVectorPositions(true);
- customType.setStoreTermVectorOffsets(true);
- doc.add(newField("field", "aaa", customType));
- for(int i=0;i<19;i++) {
- writer.addDocument(doc);
+ Field f = null;
+ if (j != 26) {
+ f = newField("field", "aaa", customType);
}
- writer.flush(false, true);
- writer.close();
- SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
- // Since we flushed w/o allowing merging we should now
- // have 10 segments
- assertEquals(10, sis.size());
- dir.close();
- }
-
- public void testFlushWithNoCommit() throws IOException {
- Directory dir = newDirectory();
- IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
- IndexWriter writer = new IndexWriter(dir, iwc);
- Document doc = new Document();
- writer.addDocument(doc);
- writer.commit();
-
+ else {
+ f = newField("field", "aaa", storedTextType);
+ }
+ doc.add(f);
writer.addDocument(doc);
- writer.flush();
- DirectoryReader r = DirectoryReader.open(dir);
- assertEquals(1, r.maxDoc());
- writer.commit();
- DirectoryReader r2 = DirectoryReader.openIfChanged(r);
- assertNotNull(r2);
- assertEquals(2, r2.maxDoc());
- IOUtils.close(r2, r, writer, dir);
}
+ writer.close();
+ reader = DirectoryReader.open(dir);
+ searcher = newSearcher(reader);
+ hits = searcher.search(new TermQuery(searchTerm), 1000).scoreDocs;
+ assertEquals(27, hits.length);
+ reader.close();
- // Make sure we can flush segment w/ norms, then add
- // empty doc (no norms) and flush
- public void testEmptyDocAfterFlushingRealDoc() throws IOException {
- Directory dir = newDirectory();
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- Document doc = new Document();
- FieldType customType = new FieldType(TextField.TYPE_STORED);
- customType.setStoreTermVectors(true);
- customType.setStoreTermVectorPositions(true);
- customType.setStoreTermVectorOffsets(true);
- doc.add(newField("field", "aaa", customType));
- writer.addDocument(doc);
- writer.commit();
- if (VERBOSE) {
- System.out.println("\nTEST: now add empty doc");
- }
- writer.addDocument(new Document());
- writer.close();
- IndexReader reader = DirectoryReader.open(dir);
- assertEquals(2, reader.numDocs());
- reader.close();
- dir.close();
+ reader = DirectoryReader.open(dir);
+ reader.close();
+
+ dir.close();
+ }
+
+ public void testHighFreqTerm() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setRAMBufferSizeMB(0.01));
+ // Massive doc that has 128 K a's
+ StringBuilder b = new StringBuilder(1024*1024);
+ for(int i=0;i<4096;i++) {
+ b.append(" a a a a a a a a");
+ b.append(" a a a a a a a a");
+ b.append(" a a a a a a a a");
+ b.append(" a a a a a a a a");
}
+ Document doc = new Document();
+ FieldType customType = new FieldType(TextField.TYPE_STORED);
+ customType.setStoreTermVectors(true);
+ customType.setStoreTermVectorPositions(true);
+ customType.setStoreTermVectorOffsets(true);
+ doc.add(newField("field", b.toString(), customType));
+ writer.addDocument(doc);
+ writer.close();
+ IndexReader reader = DirectoryReader.open(dir);
+ assertEquals(1, reader.maxDoc());
+ assertEquals(1, reader.numDocs());
+ Term t = new Term("field", "a");
+ assertEquals(1, reader.docFreq(t));
+ PostingsEnum td = TestUtil.docs(random(), reader,
+ "field",
+ new BytesRef("a"),
+ null,
+ PostingsEnum.FREQS);
+ td.nextDoc();
+ assertEquals(128*1024, td.freq());
+ reader.close();
+ dir.close();
+ }
+
+ public void testFlushWithNoMerging() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(
+ dir,
+ newIndexWriterConfig(new MockAnalyzer(random()))
+ .setMaxBufferedDocs(2)
+ .setMergePolicy(newLogMergePolicy(10))
+ );
+ Document doc = new Document();
+ FieldType customType = new FieldType(TextField.TYPE_STORED);
+ customType.setStoreTermVectors(true);
+ customType.setStoreTermVectorPositions(true);
+ customType.setStoreTermVectorOffsets(true);
+ doc.add(newField("field", "aaa", customType));
+ for(int i=0;i<19;i++)
+ writer.addDocument(doc);
+ writer.flush(false, true);
+ writer.close();
+ SegmentInfos sis = SegmentInfos.readLatestCommit(dir);
+ // Since we flushed w/o allowing merging we should now
+ // have 10 segments
+ assertEquals(10, sis.size());
+ dir.close();
+ }
+ // Make sure we can flush segment w/ norms, then add
+ // empty doc (no norms) and flush
+ public void testEmptyDocAfterFlushingRealDoc() throws IOException {
+ Directory dir = newDirectory();
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ Document doc = new Document();
+ FieldType customType = new FieldType(TextField.TYPE_STORED);
+ customType.setStoreTermVectors(true);
+ customType.setStoreTermVectorPositions(true);
+ customType.setStoreTermVectorOffsets(true);
+ doc.add(newField("field", "aaa", customType));
+ writer.addDocument(doc);
+ writer.commit();
+ if (VERBOSE) {
+ System.out.println("\nTEST: now add empty doc");
+ }
+ writer.addDocument(new Document());
+ writer.close();
+ IndexReader reader = DirectoryReader.open(dir);
+ assertEquals(2, reader.numDocs());
+ reader.close();
+ dir.close();
+ }
/**
* Test that no NullPointerException will be raised,
@@ -1276,10 +1257,17 @@ public class TestIndexWriter extends LuceneTestCase {
public void testDeleteUnusedFiles() throws Exception {
+
assumeFalse("test relies on exact filenames", Codec.getDefault() instanceof SimpleTextCodec);
for(int iter=0;iter<2;iter++) {
- MockDirectoryWrapper dir = newMockDirectory(); // relies on windows semantics
- dir.setEnableVirusScanner(false); // but ensures files are actually deleted
+ // relies on windows semantics
+ Path path = createTempDir();
+ assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(path));
+ FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///"));
+ Path indexPath = new FilterPath(path, fs);
+
+ // NOTE: cannot use MMapDir, because WindowsFS doesn't see/think it keeps file handles open?
+ FSDirectory dir = new NIOFSDirectory(indexPath);
MergePolicy mergePolicy = newLogMergePolicy(true);
@@ -1306,20 +1294,15 @@ public class TestIndexWriter extends LuceneTestCase {
r = DirectoryReader.open(dir);
}
- List<String> files = new ArrayList<>(Arrays.asList(dir.listAll()));
-
- // RAMDir won't have a write.lock, but fs dirs will:
- files.remove("write.lock");
-
- assertTrue(files.contains("_0.cfs"));
- assertTrue(files.contains("_0.cfe"));
- assertTrue(files.contains("_0.si"));
+ assertTrue(Files.exists(indexPath.resolve("_0.cfs")));
+ assertTrue(Files.exists(indexPath.resolve("_0.cfe")));
+ assertTrue(Files.exists(indexPath.resolve("_0.si")));
if (iter == 1) {
// we run a full commit so there should be a segments file etc.
- assertTrue(files.contains("segments_1"));
+ assertTrue(Files.exists(indexPath.resolve("segments_1")));
} else {
// this is an NRT reopen - no segments files yet
- assertFalse(files.contains("segments_1"));
+ assertFalse(Files.exists(indexPath.resolve("segments_1")));
}
w.addDocument(doc);
w.forceMerge(1);
@@ -1329,34 +1312,29 @@ public class TestIndexWriter extends LuceneTestCase {
IndexReader r2 = DirectoryReader.openIfChanged(r);
assertNotNull(r2);
assertTrue(r != r2);
- files = Arrays.asList(dir.listAll());
// NOTE: here we rely on "Windows" behavior, ie, even
// though IW wanted to delete _0.cfs since it was
// merged away, because we have a reader open
// against this file, it should still be here:
- assertTrue(files.contains("_0.cfs"));
+ assertTrue(Files.exists(indexPath.resolve("_0.cfs")));
// forceMerge created this
//assertTrue(files.contains("_2.cfs"));
w.deleteUnusedFiles();
- files = Arrays.asList(dir.listAll());
// r still holds this file open
- assertTrue(files.contains("_0.cfs"));
+ assertTrue(Files.exists(indexPath.resolve("_0.cfs")));
//assertTrue(files.contains("_2.cfs"));
r.close();
if (iter == 0) {
// on closing NRT reader, it calls writer.deleteUnusedFiles
- files = Arrays.asList(dir.listAll());
- assertFalse(files.contains("_0.cfs"));
+ assertFalse(Files.exists(indexPath.resolve("_0.cfs")));
} else {
- // now writer can remove it
- w.deleteUnusedFiles();
- files = Arrays.asList(dir.listAll());
- assertFalse(files.contains("_0.cfs"));
+ // now FSDir can remove it
+ dir.deletePendingFiles();
+ assertFalse(Files.exists(indexPath.resolve("_0.cfs")));
}
- //assertTrue(files.contains("_2.cfs"));
w.close();
r2.close();
@@ -1369,10 +1347,6 @@ public class TestIndexWriter extends LuceneTestCase {
// Validates that iw.deleteUnusedFiles() also deletes unused index commits
// in case a deletion policy which holds onto commits is used.
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // otherwise the delete of old commit might not actually succeed temporarily.
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
.setIndexDeletionPolicy(new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy())));
SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
@@ -1425,9 +1399,6 @@ public class TestIndexWriter extends LuceneTestCase {
// indexed, flushed (but not committed) and then IW rolls back, then no
// files are left in the Directory.
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
String[] origFiles = dir.listAll();
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
@@ -1492,10 +1463,6 @@ public class TestIndexWriter extends LuceneTestCase {
public void testNoUnwantedTVFiles() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test uses IW unref'ed check which is unaware of retries
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter indexWriter = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
.setRAMBufferSizeMB(0.01)
.setMergePolicy(newLogMergePolicy()));
@@ -1661,7 +1628,6 @@ public class TestIndexWriter extends LuceneTestCase {
public void testDeleteAllNRTLeftoverFiles() throws Exception {
MockDirectoryWrapper d = new MockDirectoryWrapper(random(), new RAMDirectory());
- d.setEnableVirusScanner(false); // needs for files to actually be deleted
IndexWriter w = new IndexWriter(d, new IndexWriterConfig(new MockAnalyzer(random())));
Document doc = new Document();
for(int i = 0; i < 20; i++) {
@@ -1784,10 +1750,6 @@ public class TestIndexWriter extends LuceneTestCase {
// LUCENE-3872
public void testPrepareCommitThenRollback() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // indexExists might return true if virus scanner prevents deletions
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter w = new IndexWriter(dir,
new IndexWriterConfig(new MockAnalyzer(random())));
@@ -2273,18 +2235,6 @@ public class TestIndexWriter extends LuceneTestCase {
dir.setCheckIndexOnClose(false);
}
- if (dir instanceof MockDirectoryWrapper) {
- MockDirectoryWrapper mdw = (MockDirectoryWrapper) dir;
- String[] files = dir.listAll();
- Arrays.sort(files);
- if ((Arrays.equals(new String[] {"segments_0"}, files) ||
- Arrays.equals(new String[] {"segments_0", "write.lock"}, files)) &&
- mdw.didTryToDelete("segments_0")) {
- // This means virus checker blocked IW deleting the corrupt first commit
- dir.setCheckIndexOnClose(false);
- }
- }
-
dir.close();
}
}
@@ -2733,7 +2683,7 @@ public class TestIndexWriter extends LuceneTestCase {
}
// LUCENE-6523
- public void testCommitImmediaatelyAfterNRTReopen() throws Exception {
+ public void testCommitImmediatelyAfterNRTReopen() throws Exception {
Directory dir = newDirectory();
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
IndexWriter w = new IndexWriter(dir, iwc);
@@ -2753,11 +2703,29 @@ public class TestIndexWriter extends LuceneTestCase {
IOUtils.close(r, r2, w, dir);
}
+ // nocommit turn test on once we have VirusCheckingFS
+ /*
+ public void testWithPendingDeletions() throws Exception {
+ try (FSDirectory dir = FSDirectory.open(createTempDir())) {
+ IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
+ IndexWriter w = new IndexWriter(dir, iwc);
+ w.commit();
+ IndexInput in = dir.openInput("segments_0", IOContext.DEFAULT);
+ w.addDocument(new Document());
+ w.close();
+ assertTrue(dir.checkPendingDeletions());
+ iwc = new IndexWriterConfig(new MockAnalyzer(random()));
+ try {
+ w = new IndexWriter(dir, iwc);
+ } catch (IllegalArgumentException iae) {
+ assertEquals("Directory still has pending deleted files", iae.getMessage());
+ }
+ }
+ }
+ */
+
public void testLeftoverTempFiles() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
IndexWriter w = new IndexWriter(dir, iwc);
w.close();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
index 3804717..4ac3f44 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
@@ -94,10 +94,6 @@ public class TestIndexWriterCommit extends LuceneTestCase {
*/
public void testCommitOnCloseAbort() throws IOException {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test uses IW unref'ed check which is unaware of retries
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
.setMaxBufferedDocs(10));
for (int i = 0; i < 14; i++) {
@@ -189,11 +185,6 @@ public class TestIndexWriterCommit extends LuceneTestCase {
final String contentFormat = TestUtil.getPostingsFormat("content");
assumeFalse("This test cannot run with Memory codec", idFormat.equals("Memory") || contentFormat.equals("Memory"));
MockDirectoryWrapper dir = newMockDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // the virus scanner can use up too much disk space :)
- // an alternative is to expose MDW.triedToDelete and discount it
- dir.setEnableVirusScanner(false);
- }
Analyzer analyzer;
if (random().nextBoolean()) {
// no payloads
@@ -279,10 +270,6 @@ public class TestIndexWriterCommit extends LuceneTestCase {
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper)dir).setPreventDoubleWrite(false);
}
- if (dir instanceof MockDirectoryWrapper) {
- // test uses IW unref'ed check which is unaware of retries
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(
dir,
newIndexWriterConfig(new MockAnalyzer(random()))
@@ -599,14 +586,7 @@ public class TestIndexWriterCommit extends LuceneTestCase {
IndexReader reader2 = DirectoryReader.open(dir);
assertEquals(0, reader2.numDocs());
- // We need to let IW delete the partial segments_N that was written in prepareCommit, else we get a false fail below:
- if (mockDir != null) {
- mockDir.setEnableVirusScanner(false);
- }
writer.rollback();
- if (mockDir != null) {
- mockDir.setEnableVirusScanner(true);
- }
IndexReader reader3 = DirectoryReader.openIfChanged(reader);
assertNull(reader3);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
index 9213c25..be98ef0 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
@@ -498,10 +498,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
// First build up a starting index:
MockDirectoryWrapper startDir = newMockDirectory();
- // TODO: find the resource leak that only occurs sometimes here.
- startDir.setNoDeleteOpenFile(false);
- // test uses IW unref'ed helper which is unaware of retries
- startDir.setEnableVirusScanner(false);
+
IndexWriter writer = new IndexWriter(startDir, newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
for (int i = 0; i < 157; i++) {
Document d = new Document();
@@ -527,8 +524,6 @@ public class TestIndexWriterDelete extends LuceneTestCase {
MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), TestUtil.ramCopyOf(startDir));
dir.setPreventDoubleWrite(false);
dir.setAllowRandomFileNotFoundException(false);
- // test uses IW unref'ed helper which is unaware of retries
- dir.setEnableVirusScanner(false);
IndexWriter modifier = new IndexWriter(dir,
newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false))
.setMaxBufferedDocs(1000)
@@ -913,8 +908,6 @@ public class TestIndexWriterDelete extends LuceneTestCase {
String[] text = { "Amsterdam", "Venice" };
MockDirectoryWrapper dir = newMockDirectory();
- // test uses IW unref'ed helper which is unaware of retries
- dir.setEnableVirusScanner(false);
IndexWriter modifier = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
modifier.commit();
dir.failOn(failure.reset());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
index 055fc5a..db2253b 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
@@ -916,7 +916,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
if (SegmentInfos.class.getName().equals(trace[i].getClassName()) && stage.equals(trace[i].getMethodName())) {
isCommit = true;
}
- if (MockDirectoryWrapper.class.getName().equals(trace[i].getClassName()) && "deleteFile".equals(trace[i].getMethodName())) {
+ if (MockDirectoryWrapper.class.getName().equals(trace[i].getClassName()) && "deleteFiles".equals(trace[i].getMethodName())) {
isDelete = true;
}
if (SegmentInfos.class.getName().equals(trace[i].getClassName()) && "writeGlobalFieldMap".equals(trace[i].getMethodName())) {
@@ -950,7 +950,6 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
for (FailOnlyInCommit failure : failures) {
MockDirectoryWrapper dir = newMockDirectory();
dir.setFailOnCreateOutput(false);
- dir.setEnableVirusScanner(false); // we check for specific list of files
int fileCount = dir.listAll().length;
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
Document doc = new Document();
@@ -965,7 +964,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
} catch (RuntimeException re) {
// Expected
}
- assertTrue(failure.failOnCommit && failure.failOnDeleteFile);
+ assertTrue("failOnCommit=" + failure.failOnCommit + " failOnDeleteFile=" + failure.failOnDeleteFile, failure.failOnCommit && failure.failOnDeleteFile);
w.rollback();
String files[] = dir.listAll();
assertTrue(files.length == fileCount || (files.length == fileCount+1 && Arrays.asList(files).contains(IndexWriter.WRITE_LOCK_NAME)));
@@ -1178,10 +1177,6 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
public void testSimulatedCorruptIndex1() throws IOException {
BaseDirectoryWrapper dir = newDirectory();
dir.setCheckIndexOnClose(false); // we are corrupting it!
- if (dir instanceof MockDirectoryWrapper) {
- // we want to ensure our corruption always succeeds!
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = null;
@@ -1210,7 +1205,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
}
in.close();
out.close();
- dir.deleteFile(fileNameIn);
+ dir.deleteFiles(Collections.singleton(fileNameIn));
IndexReader reader = null;
try {
@@ -1230,10 +1225,6 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
public void testSimulatedCorruptIndex2() throws IOException {
BaseDirectoryWrapper dir = newDirectory();
dir.setCheckIndexOnClose(false); // we are corrupting it!
- if (dir instanceof MockDirectoryWrapper) {
- // we want to ensure our corruption always succeeds!
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = null;
writer = new IndexWriter(
@@ -1264,7 +1255,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
assertTrue(si.info.getUseCompoundFile());
List<String> victims = new ArrayList<String>(si.info.files());
Collections.shuffle(victims, random());
- dir.deleteFile(victims.get(0));
+ dir.deleteFiles(Collections.singleton(victims.get(0)));
corrupted = true;
break;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
index 19030cc..7570163 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
@@ -126,7 +126,6 @@ public class TestIndexWriterForceMerge extends LuceneTestCase {
public void testForceMergeTempSpaceUsage() throws IOException {
final MockDirectoryWrapper dir = newMockDirectory();
- dir.setEnableVirusScanner(false);
// don't use MockAnalyzer, variable length payloads can cause merge to make things bigger,
// since things are optimized for fixed length case. this is a problem for MemoryPF's encoding.
// (it might have other problems too)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
index baa74e1..44d938f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
@@ -17,6 +17,10 @@ package org.apache.lucene.index;
* limitations under the License.
*/
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.store.AlreadyClosedException;
@@ -24,10 +28,7 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import org.apache.lucene.util.TestUtil;
public class TestIndexWriterFromReader extends LuceneTestCase {
@@ -111,10 +112,6 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
// Pull NRT reader after writer has committed and then indexed another doc:
public void testAfterCommitThenIndex() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // We only hit exc if stale segments file was deleted:
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig());
w.addDocument(new Document());
w.commit();
@@ -140,10 +137,6 @@ public class TestIndexWriterFromReader extends LuceneTestCase {
// NRT rollback: pull NRT reader after writer has committed and then before indexing another doc
public void testNRTRollback() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // We only hit exc if stale segments file was deleted:
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig());
w.addDocument(new Document());
w.commit();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
index f75230c..e6fe6e8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
@@ -64,7 +64,6 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
System.out.println("TEST: cycle: diskFree=" + diskFree);
}
MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), new RAMDirectory());
- dir.setEnableVirusScanner(false); // currently uses the IW unreferenced files method, unaware of retries
dir.setMaxSizeInBytes(diskFree);
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
MergeScheduler ms = writer.getConfig().getMergeScheduler();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
index 6d9bb69..bb452bf 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
@@ -18,6 +18,7 @@ package org.apache.lucene.index;
*/
import java.io.IOException;
+import java.util.Arrays;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
@@ -25,8 +26,9 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.Constants;
-import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
/** LUCENE-5574 */
@SuppressFileSystems("WindowsFS") // the bug doesn't happen on windows.
@@ -40,12 +42,6 @@ public class TestNRTReaderCleanup extends LuceneTestCase {
MockDirectoryWrapper dir = newMockDirectory();
- // don't act like windows either, or the test won't simulate the condition
- dir.setEnableVirusScanner(false);
-
- // Allow deletion of still open files:
- dir.setNoDeleteOpenFile(false);
-
// Allow writing to same file more than once:
dir.setPreventDoubleWrite(false);
@@ -66,9 +62,7 @@ public class TestNRTReaderCleanup extends LuceneTestCase {
w.close();
// Blow away index and make a new writer:
- for(String fileName : dir.listAll()) {
- dir.deleteFile(fileName);
- }
+ dir.deleteFiles(Arrays.asList(dir.listAll()));
w = new RandomIndexWriter(random(), dir);
w.addDocument(doc);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java b/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
index 0a0438a..3d15971 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
@@ -39,12 +39,6 @@ public class TestNeverDelete extends LuceneTestCase {
final Path tmpDir = createTempDir("TestNeverDelete");
final BaseDirectoryWrapper d = newFSDirectory(tmpDir);
- // We want to "see" files removed if Lucene removed
- // them. This is still worth running on Windows since
- // some files the IR opens and closes.
- if (d instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)d).setNoDeleteOpenFile(false);
- }
final RandomIndexWriter w = new RandomIndexWriter(random(),
d,
newIndexWriterConfig(new MockAnalyzer(random()))
@@ -107,7 +101,5 @@ public class TestNeverDelete extends LuceneTestCase {
}
w.close();
d.close();
-
- IOUtils.rm(tmpDir);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
index 1fb2206..df1ed20 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
@@ -1182,10 +1182,6 @@ public class TestNumericDocValuesUpdates extends LuceneTestCase {
@Test
public void testDeleteUnusedUpdatesFiles() throws Exception {
Directory dir = newDirectory();
- // test explicitly needs files to always be actually deleted
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
IndexWriter writer = new IndexWriter(dir, conf);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
index 551a073..ac32bab 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
@@ -189,10 +189,7 @@ public class TestOmitPositions extends LuceneTestCase {
// Verifies no *.prx exists when all fields omit term positions:
public void testNoPrxFile() throws Throwable {
Directory ram = newDirectory();
- if (ram instanceof MockDirectoryWrapper) {
- // we verify some files get deleted
- ((MockDirectoryWrapper)ram).setEnableVirusScanner(false);
- }
+
Analyzer analyzer = new MockAnalyzer(random());
IndexWriter writer = new IndexWriter(ram, newIndexWriterConfig(analyzer)
.setMaxBufferedDocs(3)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
index 187216b..6e8874f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
@@ -40,6 +40,7 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
public class TestOmitTf extends LuceneTestCase {
@@ -219,10 +220,6 @@ public class TestOmitTf extends LuceneTestCase {
// Verifies no *.prx exists when all fields omit term freq:
public void testNoPrxFile() throws Throwable {
Directory ram = newDirectory();
- if (ram instanceof MockDirectoryWrapper) {
- // we verify some files get deleted
- ((MockDirectoryWrapper)ram).setEnableVirusScanner(false);
- }
Analyzer analyzer = new MockAnalyzer(random());
IndexWriter writer = new IndexWriter(ram, newIndexWriterConfig(analyzer)
.setMaxBufferedDocs(3)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
index c94b66a..360933a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
@@ -23,6 +23,7 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.TestUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -50,7 +51,6 @@ public class TestPersistentSnapshotDeletionPolicy extends TestSnapshotDeletionPo
public void testExistingSnapshots() throws Exception {
int numSnapshots = 3;
MockDirectoryWrapper dir = newMockDirectory();
- dir.setEnableVirusScanner(false); // test relies on files actually being deleted
IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy(dir)));
PersistentSnapshotDeletionPolicy psdp = (PersistentSnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
assertNull(psdp.getLastSaveFile());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
index f367024..a0fda68 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
@@ -39,10 +39,6 @@ public class TestRollingUpdates extends LuceneTestCase {
public void testRollingUpdates() throws Exception {
Random random = new Random(random().nextLong());
final BaseDirectoryWrapper dir = newDirectory();
- // test checks for no unref'ed files with the IW helper method, which isn't aware of "tried to delete files"
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
final LineFileDocs docs = new LineFileDocs(random, true);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
index 1780494..e6c8f57 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
@@ -32,6 +32,7 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.ThreadInterruptedException;
import org.junit.Test;
@@ -103,10 +104,6 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
}
private void runTest(Random random, Directory dir) throws Exception {
- // we use the IW unref'ed files check which is unaware of retries:
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
// Run for ~1 seconds
final long stopTime = System.currentTimeMillis() + 1000;
@@ -257,10 +254,6 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
// Create 3 snapshots: snapshot0, snapshot1, snapshot2
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // we verify some files get deleted
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
prepareIndexAndSnapshots(sdp, writer, numSnapshots);
@@ -285,10 +278,7 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
@Test
public void testMultiThreadedSnapshotting() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test relies on files actually being deleted
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
+
final IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
final SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
@@ -364,10 +354,6 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
@Test
public void testReleaseSnapshot() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // we rely upon existence of files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
prepareIndexAndSnapshots(sdp, writer, 1);
@@ -417,10 +403,6 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCase {
// Tests the behavior of SDP when commits that are given at ctor are missing
// on onInit().
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // we rely upon existence of files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(dir, getConfig(random(), getDeletionPolicy()));
SnapshotDeletionPolicy sdp = (SnapshotDeletionPolicy) writer.getConfig().getIndexDeletionPolicy();
writer.addDocument(new Document());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
index c412545..f1d0418 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
@@ -43,15 +43,6 @@ public class TestSwappedIndexFiles extends LuceneTestCase {
Directory dir1 = newDirectory();
Directory dir2 = newDirectory();
- if (dir1 instanceof MockDirectoryWrapper) {
- // otherwise we can have unref'd files left in the index that won't be visited when opening a reader and lead to scary looking false failures:
- ((MockDirectoryWrapper) dir1).setEnableVirusScanner(false);
- }
- if (dir2 instanceof MockDirectoryWrapper) {
- // otherwise we can have unref'd files left in the index that won't be visited when opening a reader and lead to scary looking false failures:
- ((MockDirectoryWrapper) dir2).setEnableVirusScanner(false);
- }
-
// Disable CFS 80% of the time so we can truncate individual files, but the other 20% of the time we test truncation of .cfs/.cfe too:
boolean useCFS = random().nextInt(5) == 1;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
index 15d4a06..2f6f38a 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
@@ -175,7 +175,7 @@ public class TestPointQueries extends LuceneTestCase {
iwc.setCodec(getCodec());
Directory dir;
if (values.length > 100000) {
- dir = noVirusChecker(newFSDirectory(createTempDir("TestRangeTree")));
+ dir = newFSDirectory(createTempDir("TestRangeTree"));
} else {
dir = getDirectory();
}
@@ -439,7 +439,7 @@ public class TestPointQueries extends LuceneTestCase {
Directory dir;
if (docValues.length > 100000) {
- dir = noVirusChecker(newFSDirectory(createTempDir("TestPointRangeQuery")));
+ dir = newFSDirectory(createTempDir("TestPointQueries"));
} else {
dir = getDirectory();
}
@@ -1018,15 +1018,8 @@ public class TestPointQueries extends LuceneTestCase {
IOUtils.close(w, dir);
}
- private static Directory noVirusChecker(Directory dir) {
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
- }
-
private static Directory getDirectory() {
- return noVirusChecker(newDirectory());
+ return newDirectory();
}
private static Codec getCodec() {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
index ea2ec7c..3df8dc5 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
@@ -211,58 +211,54 @@ public class TestBufferedIndexInput extends LuceneTestCase {
public void testSetBufferSize() throws IOException {
Path indexDir = createTempDir("testSetBufferSize");
MockFSDirectory dir = new MockFSDirectory(indexDir, random());
- try {
- IndexWriter writer = new IndexWriter(
- dir,
- new IndexWriterConfig(new MockAnalyzer(random())).
- setOpenMode(OpenMode.CREATE).
- setMergePolicy(newLogMergePolicy(false))
- );
- for(int i=0;i<37;i++) {
- Document doc = new Document();
- doc.add(newTextField("content", "aaa bbb ccc ddd" + i, Field.Store.YES));
- doc.add(newTextField("id", "" + i, Field.Store.YES));
- writer.addDocument(doc);
- }
+ IndexWriter writer = new IndexWriter(
+ dir,
+ new IndexWriterConfig(new MockAnalyzer(random())).
+ setOpenMode(OpenMode.CREATE).
+ setMergePolicy(newLogMergePolicy(false))
+ );
+ for(int i=0;i<37;i++) {
+ Document doc = new Document();
+ doc.add(newTextField("content", "aaa bbb ccc ddd" + i, Field.Store.YES));
+ doc.add(newTextField("id", "" + i, Field.Store.YES));
+ writer.addDocument(doc);
+ }
- dir.allIndexInputs.clear();
+ dir.allIndexInputs.clear();
- IndexReader reader = DirectoryReader.open(writer);
- Term aaa = new Term("content", "aaa");
- Term bbb = new Term("content", "bbb");
+ IndexReader reader = DirectoryReader.open(writer);
+ Term aaa = new Term("content", "aaa");
+ Term bbb = new Term("content", "bbb");
- reader.close();
+ reader.close();
- dir.tweakBufferSizes();
- writer.deleteDocuments(new Term("id", "0"));
- reader = DirectoryReader.open(writer);
- IndexSearcher searcher = newSearcher(reader);
- ScoreDoc[] hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
- dir.tweakBufferSizes();
- assertEquals(36, hits.length);
+ dir.tweakBufferSizes();
+ writer.deleteDocuments(new Term("id", "0"));
+ reader = DirectoryReader.open(writer);
+ IndexSearcher searcher = newSearcher(reader);
+ ScoreDoc[] hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
+ dir.tweakBufferSizes();
+ assertEquals(36, hits.length);
- reader.close();
+ reader.close();
- dir.tweakBufferSizes();
- writer.deleteDocuments(new Term("id", "4"));
- reader = DirectoryReader.open(writer);
- searcher = newSearcher(reader);
+ dir.tweakBufferSizes();
+ writer.deleteDocuments(new Term("id", "4"));
+ reader = DirectoryReader.open(writer);
+ searcher = newSearcher(reader);
- hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
- dir.tweakBufferSizes();
- assertEquals(35, hits.length);
- dir.tweakBufferSizes();
- hits = searcher.search(new TermQuery(new Term("id", "33")), 1000).scoreDocs;
- dir.tweakBufferSizes();
- assertEquals(1, hits.length);
- hits = searcher.search(new TermQuery(aaa), 1000).scoreDocs;
- dir.tweakBufferSizes();
- assertEquals(35, hits.length);
- writer.close();
- reader.close();
- } finally {
- IOUtils.rm(indexDir);
- }
+ hits = searcher.search(new TermQuery(bbb), 1000).scoreDocs;
+ dir.tweakBufferSizes();
+ assertEquals(35, hits.length);
+ dir.tweakBufferSizes();
+ hits = searcher.search(new TermQuery(new Term("id", "33")), 1000).scoreDocs;
+ dir.tweakBufferSizes();
+ assertEquals(1, hits.length);
+ hits = searcher.search(new TermQuery(aaa), 1000).scoreDocs;
+ dir.tweakBufferSizes();
+ assertEquals(35, hits.length);
+ writer.close();
+ reader.close();
}
private static class MockFSDirectory extends FilterDirectory {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
index 8534fbf..3b65389 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
@@ -21,10 +21,12 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
public class TestDirectory extends LuceneTestCase {
@@ -32,6 +34,7 @@ public class TestDirectory extends LuceneTestCase {
// path, can read, write, and lock files.
public void testDirectInstantiation() throws Exception {
final Path path = createTempDir("testDirectInstantiation");
+ assumeFalse("test deletes files through different FSDir instances", TestUtil.hasVirusChecker(path));
final byte[] largeBuffer = new byte[random().nextInt(256*1024)], largeReadBuffer = new byte[largeBuffer.length];
for (int i = 0; i < largeBuffer.length; i++) {
@@ -79,7 +82,7 @@ public class TestDirectory extends LuceneTestCase {
}
// delete with a different dir
- dirs[(i+1)%dirs.length].deleteFile(fname);
+ dirs[(i+1)%dirs.length].deleteFiles(Collections.singleton(fname));
for (int j=0; j<dirs.length; j++) {
FSDirectory d2 = dirs[j];
@@ -110,23 +113,17 @@ public class TestDirectory extends LuceneTestCase {
dir.close();
assertFalse(dir.isOpen);
}
-
- IOUtils.rm(path);
}
// LUCENE-1468
@SuppressWarnings("resource")
public void testCopySubdir() throws Throwable {
Path path = createTempDir("testsubdir");
- try {
- Files.createDirectory(path.resolve("subdir"));
- FSDirectory fsDir = new SimpleFSDirectory(path);
- RAMDirectory ramDir = new RAMDirectory(fsDir, newIOContext(random()));
- List<String> files = Arrays.asList(ramDir.listAll());
- assertFalse(files.contains("subdir"));
- } finally {
- IOUtils.rm(path);
- }
+ Files.createDirectory(path.resolve("subdir"));
+ FSDirectory fsDir = new SimpleFSDirectory(path);
+ RAMDirectory ramDir = new RAMDirectory(fsDir, newIOContext(random()));
+ List<String> files = Arrays.asList(ramDir.listAll());
+ assertFalse(files.contains("subdir"));
}
// LUCENE-1468
@@ -145,7 +142,6 @@ public class TestDirectory extends LuceneTestCase {
}
} finally {
fsDir.close();
- IOUtils.rm(path);
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
index 60db126..04de4b2 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
@@ -100,7 +100,6 @@ public class TestFileSwitchDirectory extends BaseDirectoryTestCase {
public void testNoDir() throws Throwable {
Path primDir = createTempDir("foo");
Path secondDir = createTempDir("bar");
- IOUtils.rm(primDir, secondDir);
Directory dir = newFSSwitchDirectory(primDir, secondDir, Collections.<String>emptySet());
try {
DirectoryReader.open(dir);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
index b53707e..71284f1 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
@@ -20,8 +20,10 @@ package org.apache.lucene.store;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.Collections;
import org.apache.lucene.util.IOUtils;
+import org.apache.lucene.util.TestUtil;
/** Simple tests for NativeFSLockFactory */
public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
@@ -79,19 +81,15 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
/** delete the lockfile and test ensureValid fails */
public void testDeleteLockFile() throws IOException {
- Directory dir = getDirectory(createTempDir());
- try {
+ try (Directory dir = getDirectory(createTempDir())) {
+ assumeFalse("we must be able to delete an open file", TestUtil.hasWindowsFS(dir));
+ assumeFalse("we must be able to delete an open file", TestUtil.hasVirusChecker(dir));
+
Lock lock = dir.obtainLock("test.lock");
lock.ensureValid();
-
- try {
- dir.deleteFile("test.lock");
- } catch (Exception e) {
- // we can't delete a file for some reason, just clean up and assume the test.
- IOUtils.closeWhileHandlingException(lock);
- assumeNoException("test requires the ability to delete a locked file", e);
- }
-
+
+ dir.deleteFiles(Collections.singleton("test.lock"));
+
try {
lock.ensureValid();
fail("no exception");
@@ -100,9 +98,6 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
} finally {
IOUtils.closeWhileHandlingException(lock);
}
- } finally {
- // Do this in finally clause in case the assumeNoException is false:
- dir.close();
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
index 70cd054..dd4e175 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
@@ -83,7 +83,6 @@ public class TestRAMDirectory extends BaseDirectoryTestCase {
assertFalse(files.contains("subdir"));
} finally {
IOUtils.close(fsDir);
- IOUtils.rm(path);
}
}
[12/17] lucene-solr git commit: disable random insertion of
VirusCheckingFS, and instead add it to a few tests
Posted by mi...@apache.org.
disable random insertion of VirusCheckingFS, and instead add it to a few tests
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/85c546b7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/85c546b7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/85c546b7
Branch: refs/heads/master
Commit: 85c546b742b008fda7ab9931a1fa18ac806406aa
Parents: dd6379c
Author: Mike McCandless <mi...@apache.org>
Authored: Fri Feb 5 09:42:54 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Fri Feb 5 09:42:54 2016 -0500
----------------------------------------------------------------------
.../benchmark/byTask/TestPerfTasksLogic.java | 2 -
.../org/apache/lucene/store/FSDirectory.java | 29 +-
.../apache/lucene/index/TestDeletionPolicy.java | 2 -
.../index/TestDemoParallelLeafReader.java | 5 -
.../lucene/index/TestDirectoryReader.java | 336 +++++++++----------
.../lucene/index/TestIndexFileDeleter.java | 14 +-
.../apache/lucene/index/TestIndexWriter.java | 1 -
.../index/TestIndexWriterDeleteByQuery.java | 2 +-
.../apache/lucene/index/TestStressIndexing.java | 2 +-
.../apache/lucene/search/TestPointQueries.java | 32 +-
.../org/apache/lucene/store/TestDirectory.java | 1 -
.../lucene/store/TestNativeFSLockFactory.java | 1 -
.../lucene/store/TestSimpleFSLockFactory.java | 1 -
.../org/apache/lucene/util/TestIOUtils.java | 2 -
.../apache/lucene/util/TestOfflineSorter.java | 2 -
.../org/apache/lucene/util/fst/TestFSTs.java | 2 -
.../taxonomy/directory/TestAddTaxonomy.java | 1 -
.../writercache/TestCompactLabelToOrdinal.java | 2 -
.../IndexAndTaxonomyReplicationClientTest.java | 2 -
.../replicator/IndexReplicationClientTest.java | 2 -
.../replicator/http/HttpReplicatorTest.java | 2 -
.../analyzing/AnalyzingInfixSuggesterTest.java | 2 -
.../analyzing/BlendedInfixSuggesterTest.java | 2 -
.../apache/lucene/mockfile/VirusCheckingFS.java | 6 +-
.../lucene/store/BaseDirectoryTestCase.java | 66 +++-
.../lucene/store/BaseLockFactoryTestCase.java | 6 -
.../lucene/store/MockDirectoryWrapper.java | 33 +-
.../org/apache/lucene/util/LuceneTestCase.java | 34 +-
.../util/TestRuleTemporaryFilesCleanup.java | 16 -
.../java/org/apache/lucene/util/TestUtil.java | 51 +++
30 files changed, 373 insertions(+), 286 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
----------------------------------------------------------------------
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
index 0c82cb5..1e6d94d 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
@@ -440,8 +440,6 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
IndexReader ir = DirectoryReader.open(benchmark.getRunData().getDirectory());
assertEquals(numLines + " lines were created but " + ir.numDocs() + " docs are in the index", numLines, ir.numDocs());
ir.close();
-
- Files.delete(lineFile);
}
/**
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 14bb7af..38c8fdc 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -222,10 +222,9 @@ public abstract class FSDirectory extends BaseDirectory {
}
String[] array = entries.toArray(new String[entries.size()]);
-
- // Don't let filesystem specifics leak out of this abstraction:
+ // Directory.listAll javadocs state that we sort the results here, so we don't let filesystem
+ // specifics leak out of this abstraction:
Arrays.sort(array);
-
return array;
}
@@ -238,6 +237,9 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public long fileLength(String name) throws IOException {
ensureOpen();
+ if (pendingDeletes.contains(name)) {
+ throw new NoSuchFileException("file \"" + name + "\" is pending delete");
+ }
return Files.size(directory.resolve(name));
}
@@ -284,10 +286,13 @@ public abstract class FSDirectory extends BaseDirectory {
fsync(name);
}
}
-
+
@Override
public void renameFile(String source, String dest) throws IOException {
ensureOpen();
+ if (pendingDeletes.contains(source)) {
+ throw new NoSuchFileException("file \"" + source + "\" is pending delete and cannot be moved");
+ }
maybeDeletePendingFiles();
Files.move(directory.resolve(source), directory.resolve(dest), StandardCopyOption.ATOMIC_MOVE);
// TODO: should we move directory fsync to a separate 'syncMetadata' method?
@@ -298,7 +303,7 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public synchronized void close() throws IOException {
isOpen = false;
- maybeDeletePendingFiles();
+ deletePendingFiles();
}
/** @return the underlying filesystem directory */
@@ -333,19 +338,21 @@ public abstract class FSDirectory extends BaseDirectory {
/** Try to delete any pending files that we had previously tried to delete but failed
* because we are on Windows and the files were still held open. */
- public void deletePendingFiles() throws IOException {
+ public synchronized void deletePendingFiles() throws IOException {
+ if (pendingDeletes.isEmpty() == false) {
- // TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
+ // TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
- // Clone the set since we mutate it in privateDeleteFile:
- for(String name : new HashSet<>(pendingDeletes)) {
- privateDeleteFile(name);
+ // Clone the set since we mutate it in privateDeleteFile:
+ for(String name : new HashSet<>(pendingDeletes)) {
+ privateDeleteFile(name);
+ }
}
}
private void maybeDeletePendingFiles() throws IOException {
if (pendingDeletes.isEmpty() == false) {
- // This is a silly heuristic to try to avoid O(N^2), where N = number of files pending deletion, behavior:
+ // This is a silly heuristic to try to avoid O(N^2), where N = number of files pending deletion, behaviour on Windows:
int count = opsSinceLastDelete.incrementAndGet();
if (count >= pendingDeletes.size()) {
opsSinceLastDelete.addAndGet(-count);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
index f15f673..1d7d305 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
@@ -35,7 +35,6 @@ import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
@@ -43,7 +42,6 @@ import org.apache.lucene.util.Version;
Verify we can read the pre-2.1 file format, do searches
against it, and add documents to it.
*/
-@SuppressFileSystems("VirusCheckingFS")
public class TestDeletionPolicy extends LuceneTestCase {
private void verifyCommitOrder(List<? extends IndexCommit> commits) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
index 985606f..fe659e0 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
@@ -896,7 +896,6 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
// TODO: separate refresh thread, search threads, indexing threads
Path root = createTempDir();
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
ReindexingReader reindexer = getReindexerNewDVFields(root, currentSchemaGen);
reindexer.commit();
@@ -967,7 +966,6 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
int maxID = 0;
Path root = createTempDir();
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
int refreshEveryNumDocs = 100;
int commitCloseNumDocs = 1000;
for(int i=0;i<numDocs;i++) {
@@ -1053,7 +1051,6 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
int maxID = 0;
Path root = createTempDir();
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
int refreshEveryNumDocs = 100;
int commitCloseNumDocs = 1000;
@@ -1156,7 +1153,6 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
public void testBasic() throws Exception {
Path tempPath = createTempDir();
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(tempPath));
ReindexingReader reindexer = getReindexer(tempPath);
// Start with initial empty commit:
@@ -1226,7 +1222,6 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
public void testRandom() throws Exception {
Path root = createTempDir();
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
ReindexingReader reindexer = null;
// TODO: separate refresh thread, search threads, indexing threads
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
index 2213033..dafdcdd 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
@@ -162,174 +162,174 @@ public class TestDirectoryReader extends LuceneTestCase {
* @throws Exception on error
*/
public void testGetFieldNames() throws Exception {
- Directory d = newDirectory();
- // set up writer
- IndexWriter writer = new IndexWriter(
- d,
- newIndexWriterConfig(new MockAnalyzer(random()))
- );
+ Directory d = newDirectory();
+ // set up writer
+ IndexWriter writer = new IndexWriter(
+ d,
+ newIndexWriterConfig(new MockAnalyzer(random()))
+ );
- Document doc = new Document();
+ Document doc = new Document();
- FieldType customType3 = new FieldType();
- customType3.setStored(true);
+ FieldType customType3 = new FieldType();
+ customType3.setStored(true);
+ doc.add(new StringField("keyword", "test1", Field.Store.YES));
+ doc.add(new TextField("text", "test1", Field.Store.YES));
+ doc.add(new Field("unindexed", "test1", customType3));
+ doc.add(new TextField("unstored","test1", Field.Store.NO));
+ writer.addDocument(doc);
+
+ writer.close();
+ // set up reader
+ DirectoryReader reader = DirectoryReader.open(d);
+ FieldInfos fieldInfos = MultiFields.getMergedFieldInfos(reader);
+ assertNotNull(fieldInfos.fieldInfo("keyword"));
+ assertNotNull(fieldInfos.fieldInfo("text"));
+ assertNotNull(fieldInfos.fieldInfo("unindexed"));
+ assertNotNull(fieldInfos.fieldInfo("unstored"));
+ reader.close();
+ // add more documents
+ writer = new IndexWriter(
+ d,
+ newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.APPEND)
+ .setMergePolicy(newLogMergePolicy())
+ );
+ // want to get some more segments here
+ int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor();
+ for (int i = 0; i < 5*mergeFactor; i++) {
+ doc = new Document();
doc.add(new StringField("keyword", "test1", Field.Store.YES));
doc.add(new TextField("text", "test1", Field.Store.YES));
doc.add(new Field("unindexed", "test1", customType3));
doc.add(new TextField("unstored","test1", Field.Store.NO));
writer.addDocument(doc);
+ }
+ // new fields are in some different segments (we hope)
+ for (int i = 0; i < 5*mergeFactor; i++) {
+ doc = new Document();
+ doc.add(new StringField("keyword2", "test1", Field.Store.YES));
+ doc.add(new TextField("text2", "test1", Field.Store.YES));
+ doc.add(new Field("unindexed2", "test1", customType3));
+ doc.add(new TextField("unstored2","test1", Field.Store.NO));
+ writer.addDocument(doc);
+ }
+ // new termvector fields
- writer.close();
- // set up reader
- DirectoryReader reader = DirectoryReader.open(d);
- FieldInfos fieldInfos = MultiFields.getMergedFieldInfos(reader);
- assertNotNull(fieldInfos.fieldInfo("keyword"));
- assertNotNull(fieldInfos.fieldInfo("text"));
- assertNotNull(fieldInfos.fieldInfo("unindexed"));
- assertNotNull(fieldInfos.fieldInfo("unstored"));
- reader.close();
- // add more documents
- writer = new IndexWriter(
- d,
- newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.APPEND)
- .setMergePolicy(newLogMergePolicy())
- );
- // want to get some more segments here
- int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor();
- for (int i = 0; i < 5*mergeFactor; i++) {
- doc = new Document();
- doc.add(new StringField("keyword", "test1", Field.Store.YES));
- doc.add(new TextField("text", "test1", Field.Store.YES));
- doc.add(new Field("unindexed", "test1", customType3));
- doc.add(new TextField("unstored","test1", Field.Store.NO));
- writer.addDocument(doc);
- }
- // new fields are in some different segments (we hope)
- for (int i = 0; i < 5*mergeFactor; i++) {
- doc = new Document();
- doc.add(new StringField("keyword2", "test1", Field.Store.YES));
- doc.add(new TextField("text2", "test1", Field.Store.YES));
- doc.add(new Field("unindexed2", "test1", customType3));
- doc.add(new TextField("unstored2","test1", Field.Store.NO));
- writer.addDocument(doc);
- }
- // new termvector fields
-
- FieldType customType5 = new FieldType(TextField.TYPE_STORED);
- customType5.setStoreTermVectors(true);
- FieldType customType6 = new FieldType(TextField.TYPE_STORED);
- customType6.setStoreTermVectors(true);
- customType6.setStoreTermVectorOffsets(true);
- FieldType customType7 = new FieldType(TextField.TYPE_STORED);
- customType7.setStoreTermVectors(true);
- customType7.setStoreTermVectorPositions(true);
- FieldType customType8 = new FieldType(TextField.TYPE_STORED);
- customType8.setStoreTermVectors(true);
- customType8.setStoreTermVectorOffsets(true);
- customType8.setStoreTermVectorPositions(true);
+ FieldType customType5 = new FieldType(TextField.TYPE_STORED);
+ customType5.setStoreTermVectors(true);
+ FieldType customType6 = new FieldType(TextField.TYPE_STORED);
+ customType6.setStoreTermVectors(true);
+ customType6.setStoreTermVectorOffsets(true);
+ FieldType customType7 = new FieldType(TextField.TYPE_STORED);
+ customType7.setStoreTermVectors(true);
+ customType7.setStoreTermVectorPositions(true);
+ FieldType customType8 = new FieldType(TextField.TYPE_STORED);
+ customType8.setStoreTermVectors(true);
+ customType8.setStoreTermVectorOffsets(true);
+ customType8.setStoreTermVectorPositions(true);
- for (int i = 0; i < 5*mergeFactor; i++) {
- doc = new Document();
- doc.add(new TextField("tvnot", "tvnot", Field.Store.YES));
- doc.add(new Field("termvector", "termvector", customType5));
- doc.add(new Field("tvoffset", "tvoffset", customType6));
- doc.add(new Field("tvposition", "tvposition", customType7));
- doc.add(new Field("tvpositionoffset", "tvpositionoffset", customType8));
- writer.addDocument(doc);
- }
+ for (int i = 0; i < 5*mergeFactor; i++) {
+ doc = new Document();
+ doc.add(new TextField("tvnot", "tvnot", Field.Store.YES));
+ doc.add(new Field("termvector", "termvector", customType5));
+ doc.add(new Field("tvoffset", "tvoffset", customType6));
+ doc.add(new Field("tvposition", "tvposition", customType7));
+ doc.add(new Field("tvpositionoffset", "tvpositionoffset", customType8));
+ writer.addDocument(doc);
+ }
- writer.close();
+ writer.close();
- // verify fields again
- reader = DirectoryReader.open(d);
- fieldInfos = MultiFields.getMergedFieldInfos(reader);
+ // verify fields again
+ reader = DirectoryReader.open(d);
+ fieldInfos = MultiFields.getMergedFieldInfos(reader);
- Collection<String> allFieldNames = new HashSet<>();
- Collection<String> indexedFieldNames = new HashSet<>();
- Collection<String> notIndexedFieldNames = new HashSet<>();
- Collection<String> tvFieldNames = new HashSet<>();
+ Collection<String> allFieldNames = new HashSet<>();
+ Collection<String> indexedFieldNames = new HashSet<>();
+ Collection<String> notIndexedFieldNames = new HashSet<>();
+ Collection<String> tvFieldNames = new HashSet<>();
- for(FieldInfo fieldInfo : fieldInfos) {
- final String name = fieldInfo.name;
- allFieldNames.add(name);
- if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
- indexedFieldNames.add(name);
- } else {
- notIndexedFieldNames.add(name);
- }
- if (fieldInfo.hasVectors()) {
- tvFieldNames.add(name);
- }
+ for(FieldInfo fieldInfo : fieldInfos) {
+ final String name = fieldInfo.name;
+ allFieldNames.add(name);
+ if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
+ indexedFieldNames.add(name);
+ } else {
+ notIndexedFieldNames.add(name);
+ }
+ if (fieldInfo.hasVectors()) {
+ tvFieldNames.add(name);
}
+ }
- assertTrue(allFieldNames.contains("keyword"));
- assertTrue(allFieldNames.contains("text"));
- assertTrue(allFieldNames.contains("unindexed"));
- assertTrue(allFieldNames.contains("unstored"));
- assertTrue(allFieldNames.contains("keyword2"));
- assertTrue(allFieldNames.contains("text2"));
- assertTrue(allFieldNames.contains("unindexed2"));
- assertTrue(allFieldNames.contains("unstored2"));
- assertTrue(allFieldNames.contains("tvnot"));
- assertTrue(allFieldNames.contains("termvector"));
- assertTrue(allFieldNames.contains("tvposition"));
- assertTrue(allFieldNames.contains("tvoffset"));
- assertTrue(allFieldNames.contains("tvpositionoffset"));
+ assertTrue(allFieldNames.contains("keyword"));
+ assertTrue(allFieldNames.contains("text"));
+ assertTrue(allFieldNames.contains("unindexed"));
+ assertTrue(allFieldNames.contains("unstored"));
+ assertTrue(allFieldNames.contains("keyword2"));
+ assertTrue(allFieldNames.contains("text2"));
+ assertTrue(allFieldNames.contains("unindexed2"));
+ assertTrue(allFieldNames.contains("unstored2"));
+ assertTrue(allFieldNames.contains("tvnot"));
+ assertTrue(allFieldNames.contains("termvector"));
+ assertTrue(allFieldNames.contains("tvposition"));
+ assertTrue(allFieldNames.contains("tvoffset"));
+ assertTrue(allFieldNames.contains("tvpositionoffset"));
- // verify that only indexed fields were returned
- assertEquals(11, indexedFieldNames.size()); // 6 original + the 5 termvector fields
- assertTrue(indexedFieldNames.contains("keyword"));
- assertTrue(indexedFieldNames.contains("text"));
- assertTrue(indexedFieldNames.contains("unstored"));
- assertTrue(indexedFieldNames.contains("keyword2"));
- assertTrue(indexedFieldNames.contains("text2"));
- assertTrue(indexedFieldNames.contains("unstored2"));
- assertTrue(indexedFieldNames.contains("tvnot"));
- assertTrue(indexedFieldNames.contains("termvector"));
- assertTrue(indexedFieldNames.contains("tvposition"));
- assertTrue(indexedFieldNames.contains("tvoffset"));
- assertTrue(indexedFieldNames.contains("tvpositionoffset"));
+ // verify that only indexed fields were returned
+ assertEquals(11, indexedFieldNames.size()); // 6 original + the 5 termvector fields
+ assertTrue(indexedFieldNames.contains("keyword"));
+ assertTrue(indexedFieldNames.contains("text"));
+ assertTrue(indexedFieldNames.contains("unstored"));
+ assertTrue(indexedFieldNames.contains("keyword2"));
+ assertTrue(indexedFieldNames.contains("text2"));
+ assertTrue(indexedFieldNames.contains("unstored2"));
+ assertTrue(indexedFieldNames.contains("tvnot"));
+ assertTrue(indexedFieldNames.contains("termvector"));
+ assertTrue(indexedFieldNames.contains("tvposition"));
+ assertTrue(indexedFieldNames.contains("tvoffset"));
+ assertTrue(indexedFieldNames.contains("tvpositionoffset"));
- // verify that only unindexed fields were returned
- assertEquals(2, notIndexedFieldNames.size()); // the following fields
- assertTrue(notIndexedFieldNames.contains("unindexed"));
- assertTrue(notIndexedFieldNames.contains("unindexed2"));
+ // verify that only unindexed fields were returned
+ assertEquals(2, notIndexedFieldNames.size()); // the following fields
+ assertTrue(notIndexedFieldNames.contains("unindexed"));
+ assertTrue(notIndexedFieldNames.contains("unindexed2"));
- // verify index term vector fields
- assertEquals(tvFieldNames.toString(), 4, tvFieldNames.size()); // 4 field has term vector only
- assertTrue(tvFieldNames.contains("termvector"));
+ // verify index term vector fields
+ assertEquals(tvFieldNames.toString(), 4, tvFieldNames.size()); // 4 field has term vector only
+ assertTrue(tvFieldNames.contains("termvector"));
- reader.close();
- d.close();
+ reader.close();
+ d.close();
}
-public void testTermVectors() throws Exception {
- Directory d = newDirectory();
- // set up writer
- IndexWriter writer = new IndexWriter(
- d,
- newIndexWriterConfig(new MockAnalyzer(random()))
- .setMergePolicy(newLogMergePolicy())
- );
- // want to get some more segments here
- // new termvector fields
- int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor();
- FieldType customType5 = new FieldType(TextField.TYPE_STORED);
- customType5.setStoreTermVectors(true);
- FieldType customType6 = new FieldType(TextField.TYPE_STORED);
- customType6.setStoreTermVectors(true);
- customType6.setStoreTermVectorOffsets(true);
- FieldType customType7 = new FieldType(TextField.TYPE_STORED);
- customType7.setStoreTermVectors(true);
- customType7.setStoreTermVectorPositions(true);
- FieldType customType8 = new FieldType(TextField.TYPE_STORED);
- customType8.setStoreTermVectors(true);
- customType8.setStoreTermVectorOffsets(true);
- customType8.setStoreTermVectorPositions(true);
- for (int i = 0; i < 5 * mergeFactor; i++) {
- Document doc = new Document();
+ public void testTermVectors() throws Exception {
+ Directory d = newDirectory();
+ // set up writer
+ IndexWriter writer = new IndexWriter(
+ d,
+ newIndexWriterConfig(new MockAnalyzer(random()))
+ .setMergePolicy(newLogMergePolicy())
+ );
+ // want to get some more segments here
+ // new termvector fields
+ int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor();
+ FieldType customType5 = new FieldType(TextField.TYPE_STORED);
+ customType5.setStoreTermVectors(true);
+ FieldType customType6 = new FieldType(TextField.TYPE_STORED);
+ customType6.setStoreTermVectors(true);
+ customType6.setStoreTermVectorOffsets(true);
+ FieldType customType7 = new FieldType(TextField.TYPE_STORED);
+ customType7.setStoreTermVectors(true);
+ customType7.setStoreTermVectorPositions(true);
+ FieldType customType8 = new FieldType(TextField.TYPE_STORED);
+ customType8.setStoreTermVectors(true);
+ customType8.setStoreTermVectorOffsets(true);
+ customType8.setStoreTermVectorPositions(true);
+ for (int i = 0; i < 5 * mergeFactor; i++) {
+ Document doc = new Document();
doc.add(new TextField("tvnot", "one two two three three three", Field.Store.YES));
doc.add(new Field("termvector", "one two two three three three", customType5));
doc.add(new Field("tvoffset", "one two two three three three", customType6));
@@ -337,30 +337,29 @@ public void testTermVectors() throws Exception {
doc.add(new Field("tvpositionoffset", "one two two three three three", customType8));
writer.addDocument(doc);
+ }
+ writer.close();
+ d.close();
}
- writer.close();
- d.close();
-}
-void assertTermDocsCount(String msg,
- IndexReader reader,
- Term term,
- int expected)
- throws IOException {
- PostingsEnum tdocs = TestUtil.docs(random(), reader,
- term.field(),
- new BytesRef(term.text()),
- null,
- 0);
- int count = 0;
- if (tdocs != null) {
- while(tdocs.nextDoc()!= DocIdSetIterator.NO_MORE_DOCS) {
- count++;
+ void assertTermDocsCount(String msg,
+ IndexReader reader,
+ Term term,
+ int expected)
+ throws IOException {
+ PostingsEnum tdocs = TestUtil.docs(random(), reader,
+ term.field(),
+ new BytesRef(term.text()),
+ null,
+ 0);
+ int count = 0;
+ if (tdocs != null) {
+ while(tdocs.nextDoc()!= DocIdSetIterator.NO_MORE_DOCS) {
+ count++;
+ }
}
+ assertEquals(msg + ", count mismatch", expected, count);
}
- assertEquals(msg + ", count mismatch", expected, count);
-}
-
public void testBinaryFields() throws IOException {
Directory dir = newDirectory();
@@ -439,7 +438,6 @@ void assertTermDocsCount(String msg,
public void testFilesOpenClose() throws IOException {
// Create initial data set
Path dirFile = createTempDir("TestIndexReader.testFilesOpenClose");
- assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(dirFile));
Directory dir = newFSDirectory(dirFile);
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
@@ -472,10 +470,6 @@ void assertTermDocsCount(String msg,
public void testOpenReaderAfterDelete() throws IOException {
Path dirFile = createTempDir("deletetest");
Directory dir = newFSDirectory(dirFile);
- if (TestUtil.hasVirusChecker(dir)) {
- dir.close();
- assumeTrue("test deletes files directly", false);
- }
if (dir instanceof BaseDirectoryWrapper) {
((BaseDirectoryWrapper)dir).setCheckIndexOnClose(false); // we will hit NoSuchFileException in MDW since we nuked it!
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index 8c2dd91..50daac3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -39,6 +39,7 @@ import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
/*
Verify we can read the pre-2.1 file format, do searches
@@ -224,13 +225,8 @@ public class TestIndexFileDeleter extends LuceneTestCase {
public void testVirusScannerDoesntCorruptIndex() throws IOException {
Path path = createTempDir();
- VirusCheckingFS fs = new VirusCheckingFS(path.getFileSystem(), random().nextLong());
- FileSystem filesystem = fs.getFileSystem(URI.create("file:///"));
- fs.disable();
-
- Path path2 = new FilterPath(path, filesystem);
-
- Directory dir = newFSDirectory(path2);
+ Directory dir = newFSDirectory(addVirusChecker(path));
+ TestUtil.disableVirusChecker(dir);
// add empty commit
new IndexWriter(dir, new IndexWriterConfig(null)).close();
@@ -238,12 +234,12 @@ public class TestIndexFileDeleter extends LuceneTestCase {
dir.createOutput("_0.si", IOContext.DEFAULT).close();
// start virus scanner
- fs.enable();
+ TestUtil.enableVirusChecker(dir);
IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(null));
iw.addDocument(new Document());
// stop virus scanner
- fs.disable();
+ TestUtil.disableVirusChecker(dir);
iw.commit();
iw.close();
dir.close();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index d6b8f84..1c3568a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -1265,7 +1265,6 @@ public class TestIndexWriter extends LuceneTestCase {
for(int iter=0;iter<2;iter++) {
// relies on windows semantics
Path path = createTempDir();
- assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(path));
FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///"));
Path indexPath = new FilterPath(path, fs);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java
index c36cc1c..e87610a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java
@@ -27,7 +27,7 @@ public class TestIndexWriterDeleteByQuery extends LuceneTestCase {
// LUCENE-6379
public void testDeleteMatchAllDocsQuery() throws Exception {
- Directory dir = newDirectory();
+ Directory dir = newMaybeVirusCheckingDirectory();
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig());
Document doc = new Document();
// Norms are disabled:
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java
index 87a0ea4..13aeb0b 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java
@@ -164,7 +164,7 @@ public class TestStressIndexing extends LuceneTestCase {
FSDirectory.
*/
public void testStressIndexAndSearching() throws Exception {
- Directory directory = newDirectory();
+ Directory directory = newMaybeVirusCheckingDirectory();
if (directory instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper) directory).setAssertNoUnrefencedFilesOnClose(true);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
index 2f6f38a..7e08683 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
@@ -175,9 +175,9 @@ public class TestPointQueries extends LuceneTestCase {
iwc.setCodec(getCodec());
Directory dir;
if (values.length > 100000) {
- dir = newFSDirectory(createTempDir("TestRangeTree"));
+ dir = newMaybeVirusCheckingFSDirectory(createTempDir("TestRangeTree"));
} else {
- dir = getDirectory();
+ dir = newMaybeVirusCheckingDirectory();
}
int missingPct = random().nextInt(100);
@@ -441,7 +441,7 @@ public class TestPointQueries extends LuceneTestCase {
if (docValues.length > 100000) {
dir = newFSDirectory(createTempDir("TestPointQueries"));
} else {
- dir = getDirectory();
+ dir = newDirectory();
}
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -721,7 +721,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testMinMaxLong() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -760,7 +760,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testBasicSortedSet() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -825,7 +825,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testLongMinMaxNumeric() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -851,7 +851,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testLongMinMaxSortedSet() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -878,7 +878,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testSortedSetNoOrdsMatch() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -900,7 +900,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testNumericNoValuesMatch() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -920,7 +920,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testNoDocs() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -935,7 +935,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testWrongNumDims() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -958,7 +958,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testWrongNumBytes() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -982,7 +982,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testAllPointDocsWereDeletedAndThenMergedAgain() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
IndexWriter w = new IndexWriter(dir, iwc);
@@ -1018,10 +1018,6 @@ public class TestPointQueries extends LuceneTestCase {
IOUtils.close(w, dir);
}
- private static Directory getDirectory() {
- return newDirectory();
- }
-
private static Codec getCodec() {
if (Codec.getDefault().getName().equals("Lucene60")) {
int maxPointsInLeafNode = TestUtil.nextInt(random(), 16, 2048);
@@ -1052,7 +1048,7 @@ public class TestPointQueries extends LuceneTestCase {
}
public void testExactPointQuery() throws Exception {
- Directory dir = getDirectory();
+ Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
iwc.setCodec(getCodec());
IndexWriter w = new IndexWriter(dir, iwc);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
index 9c68b9e..b07ab0b 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
@@ -32,7 +32,6 @@ public class TestDirectory extends LuceneTestCase {
// path, can read, write, and lock files.
public void testDirectInstantiation() throws Exception {
final Path path = createTempDir("testDirectInstantiation");
- assumeFalse("test deletes files through different FSDir instances", TestUtil.hasVirusChecker(path));
final byte[] largeBuffer = new byte[random().nextInt(256*1024)], largeReadBuffer = new byte[largeBuffer.length];
for (int i = 0; i < largeBuffer.length; i++) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
index 7cb36d6..7201bad 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
@@ -82,7 +82,6 @@ public class TestNativeFSLockFactory extends BaseLockFactoryTestCase {
public void testDeleteLockFile() throws IOException {
try (Directory dir = getDirectory(createTempDir())) {
assumeFalse("we must be able to delete an open file", TestUtil.hasWindowsFS(dir));
- assumeFalse("we must be able to delete an open file", TestUtil.hasVirusChecker(dir));
Lock lock = dir.obtainLock("test.lock");
lock.ensureValid();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
index 2baab10..d33d01c 100644
--- a/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
+++ b/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
@@ -35,7 +35,6 @@ public class TestSimpleFSLockFactory extends BaseLockFactoryTestCase {
public void testDeleteLockFile() throws IOException {
Directory dir = getDirectory(createTempDir());
try {
- assumeFalse("test directly deletes lock files", TestUtil.hasVirusChecker(dir));
Lock lock = dir.obtainLock("test.lock");
lock.ensureValid();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
index 726f4f8..2c284bd 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
@@ -38,11 +38,9 @@ import java.util.UUID;
import org.apache.lucene.mockfile.FilterFileSystem;
import org.apache.lucene.mockfile.FilterFileSystemProvider;
import org.apache.lucene.mockfile.FilterPath;
-import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
/** Simple test methods for IOUtils */
-@SuppressFileSystems("VirusCheckingFS")
public class TestIOUtils extends LuceneTestCase {
public void testDeleteFileIgnoringExceptions() throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
index ca8e802..522fbf9 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
@@ -30,7 +30,6 @@ import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.OfflineSorter.BufferSize;
import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
import org.apache.lucene.util.OfflineSorter.SortInfo;
@@ -38,7 +37,6 @@ import org.apache.lucene.util.OfflineSorter.SortInfo;
/**
* Tests for on-disk merge sorting.
*/
-@SuppressFileSystems("VirusCheckingFS")
public class TestOfflineSorter extends LuceneTestCase {
private Path tempDir;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
index ac948d7..6cf8bb8 100644
--- a/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
+++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
@@ -66,7 +66,6 @@ import org.apache.lucene.util.IntsRefBuilder;
import org.apache.lucene.util.LineFileDocs;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.automaton.Automaton;
@@ -84,7 +83,6 @@ import static org.apache.lucene.util.fst.FSTTester.simpleRandomString;
import static org.apache.lucene.util.fst.FSTTester.toIntsRef;
@SuppressCodecs({ "SimpleText", "Memory", "Direct" })
-@SuppressFileSystems({ "VirusCheckingFS" })
@Slow
public class TestFSTs extends LuceneTestCase {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
index 7dc73e1..a860ec9 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
@@ -31,7 +31,6 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.TestUtil;
-//@SuppressFileSystems("VirusCheckingFS")
public class TestAddTaxonomy extends FacetTestCase {
private void dotest(int ncats, final int range) throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
index bf67929..49fc9bd 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
@@ -29,10 +29,8 @@ import java.util.Random;
import org.apache.lucene.facet.FacetTestCase;
import org.apache.lucene.facet.taxonomy.FacetLabel;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.junit.Test;
-@SuppressFileSystems("VirusCheckingFS")
public class TestCompactLabelToOrdinal extends FacetTestCase {
@Test
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
index 26e68d32..219e68b 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
@@ -52,14 +52,12 @@ import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.ThreadInterruptedException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-@SuppressFileSystems("VirusCheckingFS")
public class IndexAndTaxonomyReplicationClientTest extends ReplicatorTestCase {
private static class IndexAndTaxonomyReadyCallback implements Callable<Boolean>, Closeable {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
index bcbf9cb..3f91013 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/IndexReplicationClientTest.java
@@ -33,14 +33,12 @@ import org.apache.lucene.replicator.ReplicationClient.SourceDirectoryFactory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.ThreadInterruptedException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-@SuppressFileSystems("VirusCheckingFS")
public class IndexReplicationClientTest extends ReplicatorTestCase {
private static class IndexReadyCallback implements Callable<Boolean>, Closeable {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
----------------------------------------------------------------------
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java b/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
index 4298af8..6283d5b 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
@@ -36,14 +36,12 @@ import org.apache.lucene.replicator.Replicator;
import org.apache.lucene.replicator.ReplicatorTestCase;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.Before;
import org.junit.Test;
-@SuppressFileSystems("VirusCheckingFS")
public class HttpReplicatorTest extends ReplicatorTestCase {
private Path clientWorkDir;
private Replicator serverReplicator;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
index 8fc65d7..b51894d 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggesterTest.java
@@ -45,12 +45,10 @@ import org.apache.lucene.search.suggest.Lookup.LookupResult;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.junit.Test;
-@SuppressFileSystems("VirusCheckingFS")
public class AnalyzingInfixSuggesterTest extends LuceneTestCase {
public void testBasic() throws Exception {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
----------------------------------------------------------------------
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
index 470d6a2..614a1a2 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggesterTest.java
@@ -33,11 +33,9 @@ import org.apache.lucene.search.suggest.Input;
import org.apache.lucene.search.suggest.InputArrayIterator;
import org.apache.lucene.search.suggest.Lookup;
import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
-@SuppressFileSystems("VirusCheckingFS")
public class BlendedInfixSuggesterTest extends LuceneTestCase {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
index 8b34551..5d14a3b 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -33,7 +33,7 @@ import org.apache.lucene.util.LuceneTestCase;
*/
public class VirusCheckingFS extends FilterFileSystemProvider {
- private boolean enabled = true;
+ private volatile boolean enabled = true;
private final AtomicLong state;
@@ -49,6 +49,10 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
enabled = true;
}
+ public boolean isEnabled() {
+ return enabled;
+ }
+
public void disable() {
enabled = false;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index ef8bf70..892da1e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -668,7 +668,6 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
// LUCENE-3382 -- make sure we get exception if the directory really does not exist.
public void testNoDir() throws Throwable {
Path tempDir = createTempDir("doesnotexist");
- assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(tempDir));
IOUtils.rm(tempDir);
Directory dir = getDirectory(tempDir);
try {
@@ -827,7 +826,6 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
// TODO: somehow change this test to
public void testFsyncDoesntCreateNewFiles() throws Exception {
Path path = createTempDir("nocreate");
- assumeFalse("we directly delete files", TestUtil.hasVirusChecker(path));
Directory fsdir = getDirectory(path);
// this test backdoors the directory via the filesystem. so it must be an FSDir (for now)
@@ -1227,4 +1225,68 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
}
}
}
+
+ // Make sure the FSDirectory impl properly "emulates" deletions on filesystems (Windows) with buggy deleteFile:
+ public void testPendingDeletions() throws IOException {
+ try (Directory dir = getDirectory(addVirusChecker(createTempDir()))) {
+ assumeTrue("we can only install VirusCheckingFS on an FSDirectory", dir instanceof FSDirectory);
+ FSDirectory fsDir = (FSDirectory) dir;
+
+ // Keep trying until virus checker refuses to delete:
+ String fileName;
+ while (true) {
+ fileName = TestUtil.randomSimpleString(random());
+ if (fileName.length() == 0) {
+ continue;
+ }
+ try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+ }
+ fsDir.deleteFile(fileName);
+ if (fsDir.checkPendingDeletions()) {
+ // good: virus checker struck and prevented deletion of fileName
+ break;
+ }
+ }
+
+ // Make sure listAll does NOT include the file:
+ assertFalse(Arrays.asList(fsDir.listAll()).contains(fileName));
+
+ // Make sure fileLength claims it's deleted:
+ try {
+ fsDir.fileLength(fileName);
+ fail("did not hit exception");
+ } catch (NoSuchFileException nsfe) {
+ // expected
+ }
+
+ // Make sure rename fails:
+ try {
+ fsDir.renameFile(fileName, "file2");
+ fail("did not hit exception");
+ } catch (NoSuchFileException nsfe) {
+ // expected
+ }
+
+ // Make sure delete fails:
+ try {
+ fsDir.deleteFile(fileName);
+ fail("did not hit exception");
+ } catch (NoSuchFileException nsfe) {
+ // expected
+ }
+
+ try {
+ fsDir.openInput(fileName, IOContext.DEFAULT);
+ fail("did not hit exception");
+ } catch (NoSuchFileException nsfe) {
+ // expected
+ }
+
+ // write the file again
+ try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+ }
+ assertEquals(0, fsDir.fileLength(fileName));
+ assertTrue(Arrays.asList(fsDir.listAll()).contains(fileName));
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index 5dfe3e8..2b6a6e3 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@ -56,7 +56,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test obtaining and releasing locks, checking validity */
public void testBasics() throws IOException {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
@@ -76,7 +75,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test closing locks twice */
public void testDoubleClose() throws IOException {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
@@ -89,7 +87,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test ensureValid returns true after acquire */
public void testValidAfterAcquire() throws IOException {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
l.ensureValid(); // no exception
@@ -100,7 +97,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
/** Test ensureValid throws exception after close */
public void testInvalidAfterClose() throws IOException {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
Directory dir = getDirectory(tempPath);
Lock l = dir.obtainLock("commit");
@@ -115,7 +111,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
public void testObtainConcurrently() throws InterruptedException, IOException {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
final Directory directory = getDirectory(tempPath);
final AtomicBoolean running = new AtomicBoolean(true);
final AtomicInteger atomicCounter = new AtomicInteger(0);
@@ -165,7 +160,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
// no unexpected exceptions are raised:
public void testStressLocks() throws Exception {
Path tempPath = createTempDir();
- assumeFalse("test works with lock files", TestUtil.hasVirusChecker(tempPath));
Directory dir = getDirectory(tempPath);
// First create a 1 doc index:
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index b86c043..4287ca9 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -20,6 +20,7 @@ package org.apache.lucene.store;
import java.io.Closeable;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.nio.file.FileSystem;
import java.nio.file.NoSuchFileException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -43,6 +44,8 @@ import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.NoDeletionPolicy;
+import org.apache.lucene.mockfile.FilterFileSystem;
+import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
@@ -270,7 +273,10 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
f.close();
} catch (Exception ignored) {}
}
-
+
+ // Maybe disable virus checker so it doesn't interfere with our efforts to corrupt files below:
+ boolean virusCheckerWasEnabled = TestUtil.disableVirusChecker(in);
+
while(it.hasNext()) {
String name = it.next();
int damage = randomState.nextInt(5);
@@ -318,14 +324,6 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
ii = in.openInput(tempFileName, LuceneTestCase.newIOContext(randomState));
out.copyBytes(ii, ii.length());
ii.close();
- } catch (IOException ioe) {
- // VirusCheckingFS may have blocked the delete, at which point FSDir cannot overwrite here
- if (ioe.getMessage().equals("file \"" + name + "\" is pending delete and cannot be overwritten")) {
- // OK
- action = "deleted";
- } else {
- throw ioe;
- }
}
deleteFile(tempFileName);
} else if (damage == 3) {
@@ -336,16 +334,12 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
// Totally truncate the file to zero bytes
deleteFile(name);
try (IndexOutput out = in.createOutput(name, LuceneTestCase.newIOContext(randomState))) {
- } catch (IOException ioe) {
- // VirusCheckingFS may have blocked the delete, at which point FSDir cannot overwrite here
- if (ioe.getMessage().equals("file \"" + name + "\" is pending delete and cannot be overwritten")) {
- // OK
- action = "deleted";
- } else {
- throw ioe;
- }
}
}
+ // Re-enable
+ if (virusCheckerWasEnabled) {
+ TestUtil.enableVirusChecker(in);
+ }
if (LuceneTestCase.VERBOSE) {
System.out.println("MockDirectoryWrapper: " + action + " unsynced file: " + name);
}
@@ -746,11 +740,16 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
// TODO: factor this out / share w/ TestIW.assertNoUnreferencedFiles
if (assertNoUnreferencedFilesOnClose) {
+
// now look for unreferenced files: discount ones that we tried to delete but could not
Set<String> allFiles = new HashSet<>(Arrays.asList(listAll()));
String[] startFiles = allFiles.toArray(new String[0]);
IndexWriterConfig iwc = new IndexWriterConfig(null);
iwc.setIndexDeletionPolicy(NoDeletionPolicy.INSTANCE);
+
+ // We must do this before opening writer otherwise writer will be angry if there are pending deletions:
+ TestUtil.disableVirusChecker(in);
+
new IndexWriter(in, iwc).rollback();
String[] endFiles = in.listAll();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index c7c45c4..ffcd80b 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -30,6 +30,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
+import java.net.URI;
+import java.nio.file.FileSystem;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -64,7 +66,6 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Logger;
-import junit.framework.AssertionFailedError;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
@@ -77,6 +78,8 @@ import org.apache.lucene.index.*;
import org.apache.lucene.index.IndexReader.ReaderClosedListener;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.TermsEnum.SeekStatus;
+import org.apache.lucene.mockfile.FilterPath;
+import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.search.AssertingIndexSearcher;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
@@ -138,6 +141,8 @@ import com.carrotsearch.randomizedtesting.rules.NoClassHooksShadowingRule;
import com.carrotsearch.randomizedtesting.rules.NoInstanceHooksOverridesRule;
import com.carrotsearch.randomizedtesting.rules.StaticFieldsInvariantRule;
+import junit.framework.AssertionFailedError;
+
import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean;
import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt;
@@ -1266,6 +1271,16 @@ public abstract class LuceneTestCase extends Assert {
public static BaseDirectoryWrapper newDirectory() {
return newDirectory(random());
}
+
+ /** Like {@link newDirectory} except randomly the {@link VirusCheckingFS} may be installed */
+ public static BaseDirectoryWrapper newMaybeVirusCheckingDirectory() {
+ if (random().nextInt(5) == 4) {
+ Path path = addVirusChecker(createTempDir());
+ return newFSDirectory(path);
+ } else {
+ return newDirectory(random());
+ }
+ }
/**
* Returns a new Directory instance, using the specified random.
@@ -1303,6 +1318,15 @@ public abstract class LuceneTestCase extends Assert {
return (MockDirectoryWrapper) newFSDirectory(f, lf, false);
}
+ public static Path addVirusChecker(Path path) {
+ if (TestUtil.hasVirusChecker(path) == false) {
+ VirusCheckingFS fs = new VirusCheckingFS(path.getFileSystem(), random().nextLong());
+ FileSystem filesystem = fs.getFileSystem(URI.create("file:///"));
+ path = new FilterPath(path, filesystem);
+ }
+ return path;
+ }
+
/**
* Returns a new Directory instance, with contents copied from the
* provided directory. See {@link #newDirectory()} for more
@@ -1317,6 +1341,14 @@ public abstract class LuceneTestCase extends Assert {
return newFSDirectory(f, FSLockFactory.getDefault());
}
+ /** Like {@link newFSDirectory(Path)}, but randomly insert {@link VirusCheckingFS} */
+ public static BaseDirectoryWrapper newMaybeVirusCheckingFSDirectory(Path f) {
+ if (random().nextInt(5) == 4) {
+ f = addVirusChecker(f);
+ }
+ return newFSDirectory(f, FSLockFactory.getDefault());
+ }
+
/** Returns a new FSDirectory instance over the given file, which must be a folder. */
public static BaseDirectoryWrapper newFSDirectory(Path f, LockFactory lf) {
return newFSDirectory(f, lf, rarely());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
index c864ec1..dc2b10e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
@@ -39,7 +39,6 @@ import org.apache.lucene.mockfile.HandleLimitFS;
import org.apache.lucene.mockfile.LeakFS;
import org.apache.lucene.mockfile.ShuffleFS;
import org.apache.lucene.mockfile.VerboseFS;
-import org.apache.lucene.mockfile.VirusCheckingFS;
import org.apache.lucene.mockfile.WindowsFS;
import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase.SuppressFsync;
@@ -76,11 +75,6 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
private FileSystem fileSystem;
/**
- * Only set if the file system chain includes the VirusCheckingFS
- */
- private VirusCheckingFS virusCheckingFS;
-
- /**
* Suite failure marker.
*/
private final TestRuleMarkFailure failureMarker;
@@ -180,11 +174,6 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
if (allowed(avoid, ExtrasFS.class)) {
fs = new ExtrasFS(fs, random.nextInt(4) == 0, random.nextBoolean()).getFileSystem(null);
}
- if (allowed(avoid, VirusCheckingFS.class) && random.nextInt(10) == 1) {
- // 10% of the time we swap in virus checking (acts-like-windows) FS:
- virusCheckingFS = new VirusCheckingFS(fs, random.nextLong());
- fs = virusCheckingFS.getFileSystem(null);
- }
}
if (LuceneTestCase.VERBOSE) {
System.out.println("filesystem: " + fs.provider());
@@ -224,11 +213,6 @@ final class TestRuleTemporaryFilesCleanup extends TestRuleAdapter {
// and leave them there.
if (failureMarker.wasSuccessful()) {
- if (virusCheckingFS != null) {
- // Otherwise our IOUtils.rm below can fail:
- virusCheckingFS.disable();
- }
-
try {
IOUtils.rm(everything);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/85c546b7/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
index 0329f4b..50a2204 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
@@ -1303,6 +1303,19 @@ public final class TestUtil {
return false;
}
+ public static boolean hasWindowsFS(Path path) {
+ FileSystem fs = path.getFileSystem();
+ while (fs instanceof FilterFileSystem) {
+ FilterFileSystem ffs = (FilterFileSystem) fs;
+ if (ffs.getParent() instanceof WindowsFS) {
+ return true;
+ }
+ fs = ffs.getDelegate();
+ }
+
+ return false;
+ }
+
public static boolean hasVirusChecker(Directory dir) {
dir = FilterDirectory.unwrap(dir);
if (dir instanceof FSDirectory) {
@@ -1324,4 +1337,42 @@ public final class TestUtil {
return false;
}
+
+ /** Returns true if VirusCheckingFS is in use and was in fact already enabled */
+ public static boolean disableVirusChecker(Directory in) {
+ Directory dir = FilterDirectory.unwrap(in);
+ if (dir instanceof FSDirectory) {
+
+ FileSystem fs = ((FSDirectory) dir).getDirectory().getFileSystem();
+ while (fs instanceof FilterFileSystem) {
+ FilterFileSystem ffs = (FilterFileSystem) fs;
+ if (ffs.getParent() instanceof VirusCheckingFS) {
+ VirusCheckingFS vfs = (VirusCheckingFS) ffs.getParent();
+ boolean isEnabled = vfs.isEnabled();
+ vfs.disable();
+ return isEnabled;
+ }
+ fs = ffs.getDelegate();
+ }
+ }
+
+ return false;
+ }
+
+ public static void enableVirusChecker(Directory in) {
+ Directory dir = FilterDirectory.unwrap(in);
+ if (dir instanceof FSDirectory) {
+
+ FileSystem fs = ((FSDirectory) dir).getDirectory().getFileSystem();
+ while (fs instanceof FilterFileSystem) {
+ FilterFileSystem ffs = (FilterFileSystem) fs;
+ if (ffs.getParent() instanceof VirusCheckingFS) {
+ VirusCheckingFS vfs = (VirusCheckingFS) ffs.getParent();
+ vfs.enable();
+ return;
+ }
+ fs = ffs.getDelegate();
+ }
+ }
+ }
}
[14/17] lucene-solr git commit: Merge branch 'master' into lucene-6835
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/analysis/common/src/test/org/apache/lucene/analysis/util/TestFilesystemResourceLoader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/StreamUtilsTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
----------------------------------------------------------------------
diff --cc lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
index 831fb4c,8cac810..a448782
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
@@@ -16,14 -14,9 +14,16 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.codecs.lucene50;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexFileNames;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
diff --cc lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
index 9d0cfa7,584168a..32e078c
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@@ -16,8 -14,9 +14,10 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.store;
+
+import java.io.FileNotFoundException;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.nio.channels.ClosedChannelException; // javadoc @link
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
----------------------------------------------------------------------
diff --cc lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
index 4ffc1f8,0c0605f..e3fd699
--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
@@@ -16,7 -14,11 +14,9 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.index;
+
-import java.io.IOException;
-
import org.apache.lucene.document.Document;
import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.NumericDocValuesField;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
----------------------------------------------------------------------
diff --cc lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
index 1d7d305,8461923..b9cdf2b
--- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
@@@ -16,15 -14,9 +14,17 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.index;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
----------------------------------------------------------------------
diff --cc lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index 50daac3,2ca0b27..3ea9da0
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@@ -16,11 -14,10 +14,13 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.index;
+
import java.io.*;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterCommit.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterDeleteByQuery.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
----------------------------------------------------------------------
diff --cc lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
index 44d938f,d25711d..e63894f
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterFromReader.java
@@@ -16,11 -14,9 +14,13 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.index;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.store.AlreadyClosedException;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderCleanup.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestNeverDelete.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestNumericDocValuesUpdates.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestOmitPositions.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestOmitTf.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/index/TestSwappedIndexFiles.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestNativeFSLockFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestRAMDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/store/TestSimpleFSLockFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/util/TestIOUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/util/bkd/TestBKD.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/util/fst/Test2BFST.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/core/src/test/org/apache/lucene/util/fst/TestFSTs.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
----------------------------------------------------------------------
diff --cc lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
index a860ec9,e3fed13..7a71450
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
@@@ -16,13 -14,14 +16,27 @@@ package org.apache.lucene.facet.taxonom
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.facet.taxonomy.directory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.lucene.facet.FacetTestCase;
++import org.apache.lucene.facet.taxonomy.FacetLabel;
++import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOrdinalMap;
++import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap;
++import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap;
++import org.apache.lucene.store.Directory;
++import org.apache.lucene.util.IOUtils;
++import org.apache.lucene.util.TestUtil;
+
+ import java.io.IOException;
+ import java.util.HashSet;
+ import java.util.Random;
+ import java.util.concurrent.atomic.AtomicInteger;
+
+ import org.apache.lucene.facet.FacetTestCase;
import org.apache.lucene.facet.taxonomy.FacetLabel;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOrdinalMap;
import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
----------------------------------------------------------------------
diff --cc lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
index 49fc9bd,3ab277a..801b46f
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/TestCompactLabelToOrdinal.java
@@@ -1,7 -1,5 +1,5 @@@
- package org.apache.lucene.facet.taxonomy.writercache;
-
/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
@@@ -16,7 -14,8 +14,9 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+ package org.apache.lucene.facet.taxonomy.writercache;
+
import java.nio.ByteBuffer;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CodingErrorAction;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/misc/src/test/org/apache/lucene/util/fst/TestFSTsMisc.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyReplicationClientTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/replicator/src/test/org/apache/lucene/replicator/IndexAndTaxonomyRevisionTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/replicator/src/test/org/apache/lucene/replicator/IndexRevisionTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/replicator/src/test/org/apache/lucene/replicator/LocalReplicatorTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/replicator/src/test/org/apache/lucene/replicator/http/HttpReplicatorTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/TestInputIterator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggesterTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/FuzzySuggesterTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/BytesRefSortersTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/FSTCompletionTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/WFSTCompletionTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/analysis/VocabularyAssert.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/BasePointFormatTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/RandomPostingsTester.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --cc lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index 7677bad,512a000..595efee
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@@ -16,18 -14,8 +14,19 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.lucene.store;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.Path;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
+
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleTemporaryFilesCleanup.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/test/org/apache/lucene/mockfile/TestWindowsFS.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/lucene/test-framework/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/handler/RestoreCore.java
index 735163b,086985c..a6c1da9
--- a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
+++ b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java
@@@ -16,7 -14,9 +14,8 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+ package org.apache.solr.handler;
-import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.nio.file.Paths;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/solr/test-framework/src/java/org/apache/solr/core/MockDirectoryFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2a5c103/solr/test-framework/src/java/org/apache/solr/core/MockFSDirectoryFactory.java
----------------------------------------------------------------------
[04/17] lucene-solr git commit: migrate current patch from svn
Posted by mi...@apache.org.
migrate current patch from svn
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/84f44589
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/84f44589
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/84f44589
Branch: refs/heads/master
Commit: 84f44589f6f91250666b5f66f7c7667d347e1e3a
Parents: a48ba50
Author: Mike McCandless <mi...@apache.org>
Authored: Tue Feb 2 15:53:16 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Tue Feb 2 15:53:16 2016 -0500
----------------------------------------------------------------------
.../lucene/analysis/hunspell/Dictionary.java | 4 +-
.../analysis/hunspell/Test64kAffixes.java | 4 +-
.../analysis/hunspell/TestAllDictionaries.java | 6 +-
.../analysis/hunspell/TestAllDictionaries2.java | 6 -
.../analysis/hunspell/TestDictionary.java | 6 +-
.../hunspell/TestHunspellStemFilter.java | 6 +-
.../index/TestBackwardsCompatibility.java | 6 -
.../simpletext/SimpleTextCompoundFormat.java | 2 +-
.../codecs/lucene50/Lucene50CompoundReader.java | 16 +-
.../apache/lucene/index/IndexFileDeleter.java | 128 +--
.../org/apache/lucene/index/IndexWriter.java | 12 +-
.../index/PersistentSnapshotDeletionPolicy.java | 2 +-
.../java/org/apache/lucene/store/Directory.java | 6 +-
.../org/apache/lucene/store/FSDirectory.java | 114 ++-
.../lucene/store/FileSwitchDirectory.java | 17 +-
.../apache/lucene/store/FilterDirectory.java | 4 +-
.../store/LockValidatingDirectoryWrapper.java | 4 +-
.../org/apache/lucene/store/MMapDirectory.java | 1 +
.../org/apache/lucene/store/NIOFSDirectory.java | 2 +-
.../lucene/store/NRTCachingDirectory.java | 27 +-
.../org/apache/lucene/store/RAMDirectory.java | 16 +-
.../apache/lucene/store/SimpleFSDirectory.java | 1 +
.../lucene/store/TrackingDirectoryWrapper.java | 9 +-
.../java/org/apache/lucene/util/IOUtils.java | 34 +-
.../org/apache/lucene/util/bkd/BKDWriter.java | 7 +-
.../lucene/util/bkd/OfflinePointWriter.java | 4 +-
.../org/apache/lucene/index/TestAddIndexes.java | 2 -
.../index/TestAllFilesCheckIndexHeader.java | 5 -
.../index/TestAllFilesDetectTruncation.java | 5 -
.../apache/lucene/index/TestAtomicUpdate.java | 1 -
.../index/TestBinaryDocValuesUpdates.java | 4 -
.../lucene/index/TestCodecHoldsOpenFiles.java | 11 +-
.../index/TestConcurrentMergeScheduler.java | 4 -
.../apache/lucene/index/TestDeletionPolicy.java | 44 +-
.../index/TestDemoParallelLeafReader.java | 13 +-
.../lucene/index/TestDirectoryReader.java | 54 +-
.../lucene/index/TestDirectoryReaderReopen.java | 15 +-
.../test/org/apache/lucene/index/TestDoc.java | 9 +-
.../apache/lucene/index/TestFieldsReader.java | 65 +-
.../lucene/index/TestIndexFileDeleter.java | 4 +-
.../apache/lucene/index/TestIndexWriter.java | 928 +++++++++----------
.../lucene/index/TestIndexWriterCommit.java | 20 -
.../lucene/index/TestIndexWriterDelete.java | 9 +-
.../lucene/index/TestIndexWriterExceptions.java | 17 +-
.../lucene/index/TestIndexWriterForceMerge.java | 1 -
.../lucene/index/TestIndexWriterFromReader.java | 17 +-
.../lucene/index/TestIndexWriterOnDiskFull.java | 1 -
.../lucene/index/TestNRTReaderCleanup.java | 14 +-
.../apache/lucene/index/TestNeverDelete.java | 8 -
.../index/TestNumericDocValuesUpdates.java | 4 -
.../apache/lucene/index/TestOmitPositions.java | 5 +-
.../org/apache/lucene/index/TestOmitTf.java | 5 +-
.../TestPersistentSnapshotDeletionPolicy.java | 2 +-
.../apache/lucene/index/TestRollingUpdates.java | 4 -
.../index/TestSnapshotDeletionPolicy.java | 22 +-
.../lucene/index/TestSwappedIndexFiles.java | 9 -
.../apache/lucene/search/TestPointQueries.java | 13 +-
.../lucene/store/TestBufferedIndexInput.java | 86 +-
.../org/apache/lucene/store/TestDirectory.java | 22 +-
.../lucene/store/TestFileSwitchDirectory.java | 1 -
.../lucene/store/TestNativeFSLockFactory.java | 23 +-
.../apache/lucene/store/TestRAMDirectory.java | 1 -
.../lucene/store/TestSimpleFSLockFactory.java | 5 +-
.../store/TestTrackingDirectoryWrapper.java | 2 +-
.../apache/lucene/util/TestOfflineSorter.java | 30 +-
.../org/apache/lucene/util/bkd/TestBKD.java | 11 +-
.../org/apache/lucene/util/fst/Test2BFST.java | 8 +-
.../org/apache/lucene/util/fst/TestFSTs.java | 5 +-
.../lucene/util/packed/TestPackedInts.java | 3 +-
.../apache/lucene/util/fst/TestFSTsMisc.java | 1 -
.../IndexAndTaxonomyReplicationClientTest.java | 17 +-
.../IndexAndTaxonomyRevisionTest.java | 8 -
.../lucene/replicator/IndexRevisionTest.java | 4 -
.../lucene/replicator/LocalReplicatorTest.java | 90 +-
.../lucene/util/BaseGeoPointTestCase.java | 9 -
.../org/apache/lucene/geo3d/TestGeo3DPoint.java | 11 +-
.../suggest/analyzing/AnalyzingSuggester.java | 2 +-
.../search/suggest/fst/ExternalRefSorter.java | 3 +-
.../search/suggest/fst/FSTCompletionLookup.java | 2 +-
.../lucene/search/suggest/PersistenceTest.java | 6 +-
.../search/suggest/TestInputIterator.java | 6 +-
.../analyzing/AnalyzingSuggesterTest.java | 6 +-
.../suggest/analyzing/FuzzySuggesterTest.java | 6 +-
.../search/suggest/fst/BytesRefSortersTest.java | 3 -
.../search/suggest/fst/FSTCompletionTest.java | 6 +-
.../search/suggest/fst/WFSTCompletionTest.java | 6 +-
.../index/BaseCompoundFormatTestCase.java | 7 +-
.../index/BaseIndexFileFormatTestCase.java | 11 +-
.../lucene/index/BasePointFormatTestCase.java | 11 -
.../index/BasePostingsFormatTestCase.java | 2 -
.../lucene/index/RandomPostingsTester.java | 1 -
.../ThreadedIndexingAndSearchingTestCase.java | 1 -
.../apache/lucene/mockfile/VirusCheckingFS.java | 65 ++
.../lucene/store/BaseDirectoryTestCase.java | 10 +-
.../lucene/store/BaseLockFactoryTestCase.java | 50 +-
.../lucene/store/MockDirectoryWrapper.java | 206 ++--
.../util/TestRuleTemporaryFilesCleanup.java | 19 +
.../java/org/apache/lucene/util/TestUtil.java | 46 +
.../org/apache/lucene/util/fst/FSTTester.java | 2 +-
.../TestCompressingStoredFieldsFormat.java | 4 -
.../lucene/mockfile/TestVirusCheckingFS.java | 62 ++
.../apache/lucene/mockfile/TestWindowsFS.java | 2 +-
.../lucene/store/TestMockDirectoryWrapper.java | 1 -
.../org/apache/solr/core/DirectoryFactory.java | 7 +-
.../org/apache/solr/handler/IndexFetcher.java | 4 +-
.../org/apache/solr/handler/RestoreCore.java | 3 +-
.../solr/store/blockcache/BlockDirectory.java | 9 +-
.../apache/solr/store/hdfs/HdfsDirectory.java | 10 +-
.../solr/store/hdfs/HdfsDirectoryTest.java | 14 +-
.../apache/solr/core/MockDirectoryFactory.java | 3 -
.../solr/core/MockFSDirectoryFactory.java | 1 -
111 files changed, 1245 insertions(+), 1448 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
index d5db839..49c7045 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java
@@ -877,7 +877,7 @@ public class Dictionary {
success = true;
} finally {
if (success) {
- tempDir.deleteFile(unsorted.getName());
+ tempDir.deleteFiles(Collections.singleton(unsorted.getName()));
} else {
IOUtils.deleteFilesIgnoringExceptions(tempDir, unsorted.getName());
}
@@ -966,7 +966,7 @@ public class Dictionary {
success2 = true;
} finally {
if (success2) {
- tempDir.deleteFile(sorted);
+ tempDir.deleteFiles(Collections.singleton(sorted));
} else {
IOUtils.deleteFilesIgnoringExceptions(tempDir, sorted);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
index 6fa6ecf..20d4c47 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/Test64kAffixes.java
@@ -28,6 +28,7 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.CharsRef;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
/** Tests that > 64k affixes actually works and doesnt overflow some internal int */
public class Test64kAffixes extends LuceneTestCase {
@@ -54,9 +55,6 @@ public class Test64kAffixes extends LuceneTestCase {
dictWriter.close();
try (InputStream affStream = Files.newInputStream(affix); InputStream dictStream = Files.newInputStream(dict); Directory tempDir2 = newDirectory()) {
- if (tempDir2 instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) tempDir2).setEnableVirusScanner(false);
- }
Dictionary dictionary = new Dictionary(tempDir2, "dictionary", affStream, dictStream);
Stemmer stemmer = new Stemmer(dictionary);
// drinks should still stem to drink
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
index 4a66430..5470ded 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries.java
@@ -215,10 +215,6 @@ public class TestAllDictionaries extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
index efc5d66..1317cfc 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestAllDictionaries2.java
@@ -189,9 +189,6 @@ public class TestAllDictionaries2 extends LuceneTestCase {
try (InputStream dictionary = Files.newInputStream(dicEntry);
InputStream affix = Files.newInputStream(affEntry);
Directory tempDir = newDirectory()) {
- if (tempDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) tempDir).setEnableVirusScanner(false);
- }
Dictionary dic = new Dictionary(tempDir, "dictionary", affix, dictionary);
System.out.println(tests[i] + "\t" + RamUsageTester.humanSizeOf(dic) + "\t(" +
"words=" + RamUsageTester.humanSizeOf(dic.words) + ", " +
@@ -226,9 +223,6 @@ public class TestAllDictionaries2 extends LuceneTestCase {
try (InputStream dictionary = Files.newInputStream(dicEntry);
InputStream affix = Files.newInputStream(affEntry);
Directory tempDir = newDirectory()) {
- if (tempDir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) tempDir).setEnableVirusScanner(false);
- }
new Dictionary(tempDir, "dictionary", affix, dictionary);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
index 39feb1d..1d162c0 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java
@@ -260,10 +260,6 @@ public class TestDictionary extends LuceneTestCase {
}
private Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
index 69acc93..5cda81a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspellStemFilter.java
@@ -129,10 +129,6 @@ public class TestHunspellStemFilter extends BaseTokenStreamTestCase {
}
private static Directory getDirectory() {
- Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
- return dir;
+ return newDirectory();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
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 f61599d..87cdea6 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
@@ -1238,12 +1238,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
System.out.println("testUpgradeOldSingleSegmentIndexWithAdditions: index=" +name);
}
Directory dir = newDirectory(oldIndexDirs.get(name));
- if (dir instanceof MockDirectoryWrapper) {
- // we need to ensure we delete old commits for this test,
- // otherwise IndexUpgrader gets angry
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
-
assertEquals("Original index must be single segment", 1, getNumberOfSegments(dir));
// create a bunch of dummy segments
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
----------------------------------------------------------------------
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
index c994df7..8398f66 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCompoundFormat.java
@@ -148,7 +148,7 @@ public class SimpleTextCompoundFormat extends CompoundFormat {
public void sync(Collection<String> names) { throw new UnsupportedOperationException(); }
@Override
- public void deleteFile(String name) { throw new UnsupportedOperationException(); }
+ public void deleteFiles(Collection<String> name) { throw new UnsupportedOperationException(); }
@Override
public void renameFile(String source, String dest) { throw new UnsupportedOperationException(); }
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
index b1cfc5d..a6ccfd4 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene50/Lucene50CompoundReader.java
@@ -17,6 +17,13 @@ package org.apache.lucene.codecs.lucene50;
* limitations under the License.
*/
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexFileNames;
@@ -29,13 +36,6 @@ import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.Lock;
import org.apache.lucene.util.IOUtils;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* Class for accessing a compound stream.
* This class implements a directory, but is limited to only read operations.
@@ -161,7 +161,7 @@ final class Lucene50CompoundReader extends Directory {
/** Not implemented
* @throws UnsupportedOperationException always: not supported by CFS */
@Override
- public void deleteFile(String name) {
+ public void deleteFiles(Collection<String> name) {
throw new UnsupportedOperationException();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
index e2b29c9..569471e 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexFileDeleter.java
@@ -79,11 +79,6 @@ import org.apache.lucene.util.InfoStream;
final class IndexFileDeleter implements Closeable {
- /* Files that we tried to delete but failed (likely
- * because they are open and we are running on Windows),
- * so we will retry them again later: */
- private final Set<String> deletable = new HashSet<>();
-
/* Reference count for all files in the index.
* Counts how many existing commits reference a file.
**/
@@ -220,6 +215,7 @@ final class IndexFileDeleter implements Closeable {
// Now delete anything with ref count at 0. These are
// presumably abandoned files eg due to crash of
// IndexWriter.
+ Set<String> toDelete = new HashSet<>();
for(Map.Entry<String, RefCount> entry : refCounts.entrySet() ) {
RefCount rc = entry.getValue();
final String fileName = entry.getKey();
@@ -231,10 +227,12 @@ final class IndexFileDeleter implements Closeable {
if (infoStream.isEnabled("IFD")) {
infoStream.message("IFD", "init: removing unreferenced file \"" + fileName + "\"");
}
- deleteFile(fileName);
+ toDelete.add(fileName);
}
}
+ deleteFiles(toDelete);
+
// Finally, give policy a chance to remove things on
// startup:
policy.onInit(commits);
@@ -425,7 +423,7 @@ final class IndexFileDeleter implements Closeable {
*/
void refresh() throws IOException {
assert locked();
- deletable.clear();
+ Set<String> toDelete = new HashSet<>();
String[] files = directory.listAll();
@@ -445,15 +443,15 @@ final class IndexFileDeleter implements Closeable {
if (infoStream.isEnabled("IFD")) {
infoStream.message("IFD", "refresh: removing newly created unreferenced file \"" + fileName + "\"");
}
- deletable.add(fileName);
+ toDelete.add(fileName);
}
}
- deletePendingFiles();
+ deleteFiles(toDelete);
}
@Override
- public void close() {
+ public void close() throws IOException {
// DecRef old files from the last checkpoint, if any:
assert locked();
@@ -464,8 +462,6 @@ final class IndexFileDeleter implements Closeable {
lastFiles.clear();
}
}
-
- deletePendingFiles();
}
/**
@@ -489,39 +485,6 @@ final class IndexFileDeleter implements Closeable {
}
}
- public void deletePendingFiles() {
- assert locked();
-
- // Clone the set because it will change as we iterate:
- List<String> toDelete = new ArrayList<>(deletable);
-
- // First pass: delete any segments_N files. We do these first to be certain stale commit points are removed
- // before we remove any files they reference. If any delete of segments_N fails, we leave all other files
- // undeleted so index is never in a corrupt state:
- for (String fileName : toDelete) {
- RefCount rc = refCounts.get(fileName);
- if (rc != null && rc.count > 0) {
- // LUCENE-5904: should never happen! This means we are about to pending-delete a referenced index file
- throw new IllegalStateException("file \"" + fileName + "\" is in pending delete set but has non-zero refCount=" + rc.count);
- } else if (fileName.startsWith(IndexFileNames.SEGMENTS)) {
- if (deleteFile(fileName) == false) {
- if (infoStream.isEnabled("IFD")) {
- infoStream.message("IFD", "failed to remove commit point \"" + fileName + "\"; skipping deletion of all other pending files");
- }
- return;
- }
- }
- }
-
- // Only delete other files if we were able to remove the segments_N files; this way we never
- // leave a corrupt commit in the index even in the presense of virus checkers:
- for(String fileName : toDelete) {
- if (fileName.startsWith(IndexFileNames.SEGMENTS) == false) {
- deleteFile(fileName);
- }
- }
- }
-
/**
* For definition of "check point" see IndexWriter comments:
* "Clarification: Check Points (and commits)".
@@ -610,12 +573,15 @@ final class IndexFileDeleter implements Closeable {
}
/** Decrefs all provided files, even on exception; throws first exception hit, if any. */
- void decRef(Collection<String> files) {
+ void decRef(Collection<String> files) throws IOException {
assert locked();
+ Set<String> toDelete = new HashSet<>();
Throwable firstThrowable = null;
for(final String file : files) {
try {
- decRef(file);
+ if (decRef(file)) {
+ toDelete.add(file);
+ }
} catch (Throwable t) {
if (firstThrowable == null) {
// Save first exception and throw it in the end, but be sure to finish decRef all files
@@ -625,7 +591,7 @@ final class IndexFileDeleter implements Closeable {
}
try {
- deletePendingFiles();
+ deleteFiles(toDelete);
} catch (Throwable t) {
if (firstThrowable == null) {
// Save first exception and throw it in the end, but be sure to finish decRef all files
@@ -634,27 +600,31 @@ final class IndexFileDeleter implements Closeable {
}
// NOTE: does nothing if firstThrowable is null
- IOUtils.reThrowUnchecked(firstThrowable);
+ IOUtils.reThrow(firstThrowable);
}
/** Decrefs all provided files, ignoring any exceptions hit; call this if
* you are already handling an exception. */
void decRefWhileHandlingException(Collection<String> files) {
assert locked();
+ Set<String> toDelete = new HashSet<>();
for(final String file : files) {
try {
- decRef(file);
+ if (decRef(file)) {
+ toDelete.add(file);
+ }
} catch (Throwable t) {
}
}
try {
- deletePendingFiles();
+ deleteFiles(toDelete);
} catch (Throwable t) {
}
}
- private void decRef(String fileName) {
+ /** Returns true if the file should now be deleted. */
+ private boolean decRef(String fileName) {
assert locked();
RefCount rc = getRefCount(fileName);
if (infoStream.isEnabled("IFD")) {
@@ -662,14 +632,13 @@ final class IndexFileDeleter implements Closeable {
infoStream.message("IFD", " DecRef \"" + fileName + "\": pre-decr count is " + rc.count);
}
}
- if (0 == rc.DecRef()) {
+ if (rc.DecRef() == 0) {
// This file is no longer referenced by any past
// commit points nor by the in-memory SegmentInfos:
- try {
- deletable.add(fileName);
- } finally {
- refCounts.remove(fileName);
- }
+ refCounts.remove(fileName);
+ return true;
+ } else {
+ return false;
}
}
@@ -692,8 +661,6 @@ final class IndexFileDeleter implements Closeable {
RefCount rc;
if (!refCounts.containsKey(fileName)) {
rc = new RefCount(fileName);
- // We should never incRef a file we are already wanting to delete:
- assert deletable.contains(fileName) == false: "file \"" + fileName + "\" cannot be incRef'd: it's already pending delete";
refCounts.put(fileName, rc);
} else {
rc = refCounts.get(fileName);
@@ -705,6 +672,7 @@ final class IndexFileDeleter implements Closeable {
* (have not yet been incref'd). */
void deleteNewFiles(Collection<String> files) throws IOException {
assert locked();
+ Set<String> toDelete = new HashSet<>();
for (final String fileName: files) {
// NOTE: it's very unusual yet possible for the
// refCount to be present and 0: it can happen if you
@@ -716,45 +684,31 @@ final class IndexFileDeleter implements Closeable {
if (infoStream.isEnabled("IFD")) {
infoStream.message("IFD", "will delete new file \"" + fileName + "\"");
}
- deletable.add(fileName);
+ toDelete.add(fileName);
}
}
- deletePendingFiles();
+ deleteFiles(toDelete);
}
- /** Returns true if the delete succeeded. Otherwise, the fileName is
- * added to the deletable set so we will retry the delete later, and
- * we return false. */
- private boolean deleteFile(String fileName) {
+ private void deleteFiles(Collection<String> names) throws IOException {
assert locked();
ensureOpen();
+ if (names.isEmpty()) {
+ return;
+ }
try {
if (infoStream.isEnabled("IFD")) {
- infoStream.message("IFD", "delete \"" + fileName + "\"");
+ infoStream.message("IFD", "delete \"" + names + "\"");
}
- directory.deleteFile(fileName);
- deletable.remove(fileName);
- return true;
- } catch (IOException e) { // if delete fails
-
+ directory.deleteFiles(names);
+ } catch (NoSuchFileException | FileNotFoundException e) { // if delete fails
// IndexWriter should only ask us to delete files it knows it wrote, so if we hit this, something is wrong!
- // LUCENE-6684: we suppress this assert for Windows, since a file could be in a confusing "pending delete" state:
- assert Constants.WINDOWS || e instanceof NoSuchFileException == false: "hit unexpected NoSuchFileException: file=" + fileName;
- assert Constants.WINDOWS || e instanceof FileNotFoundException == false: "hit unexpected FileNotFoundException: file=" + fileName;
-
- // Some operating systems (e.g. Windows) don't
- // permit a file to be deleted while it is opened
- // for read (e.g. by another process or thread). So
- // we assume that when a delete fails it is because
- // the file is open in another process, and queue
- // the file for subsequent deletion.
-
- if (infoStream.isEnabled("IFD")) {
- infoStream.message("IFD", "unable to remove file \"" + fileName + "\": " + e.toString() + "; Will re-try later.");
+ if (Constants.WINDOWS) {
+ // LUCENE-6684: we suppress this assert for Windows, since a file could be in a confusing "pending delete" state:
+ } else {
+ throw e;
}
- deletable.add(fileName);
- return false;
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index b05e15a..e62cafb 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -51,6 +51,7 @@ import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.FilterDirectory;
import org.apache.lucene.store.FlushInfo;
import org.apache.lucene.store.IOContext;
@@ -753,6 +754,10 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
* IO error
*/
public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException {
+ if (d instanceof FSDirectory && ((FSDirectory) d).checkPendingDeletions()) {
+ throw new IllegalArgumentException("Directory still has pending deleted files");
+ }
+
conf.setIndexWriter(this); // prevent reuse by other instances
config = conf;
infoStream = config.getInfoStream();
@@ -3569,8 +3574,6 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
}
}
- deleter.deletePendingFiles();
-
if (infoStream.isEnabled("IW")) {
infoStream.message("IW", "after commitMerge: " + segString());
}
@@ -4616,14 +4619,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
*/
public synchronized void deleteUnusedFiles() throws IOException {
ensureOpen(false);
- deleter.deletePendingFiles();
deleter.revisitPolicy();
}
- private synchronized void deletePendingFiles() throws IOException {
- deleter.deletePendingFiles();
- }
-
/**
* NOTE: this method creates a compound file for all files returned by
* info.files(). While, generally, this may include separate norms and
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
index 0464852..2a286ff 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
@@ -212,7 +212,7 @@ public class PersistentSnapshotDeletionPolicy extends SnapshotDeletionPolicy {
private synchronized void clearPriorSnapshots() throws IOException {
for(String file : dir.listAll()) {
if (file.startsWith(SNAPSHOTS_PREFIX)) {
- dir.deleteFile(file);
+ dir.deleteFiles(Collections.singleton(file));
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/Directory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java
index 8aa5fa1..b9e5ad4 100644
--- a/lucene/core/src/java/org/apache/lucene/store/Directory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java
@@ -49,8 +49,9 @@ public abstract class Directory implements Closeable {
*/
public abstract String[] listAll() throws IOException;
- /** Removes an existing file in the directory. */
- public abstract void deleteFile(String name) throws IOException;
+ /** Removes the specified files from the directory. If an exception is thrown, behavior is undefined
+ * (none, some or all of the files may have in fact been deleted). */
+ public abstract void deleteFiles(Collection<String> name) throws IOException;
/**
* Returns the length of a file in the directory. This method follows the
@@ -67,7 +68,6 @@ public abstract class Directory implements Closeable {
*/
public abstract long fileLength(String name) throws IOException;
-
/** Creates a new, empty file in the directory with the given name.
Returns a stream writing this file. */
public abstract IndexOutput createOutput(String name, IOContext context) throws IOException;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 d02c126..0e1d4e9 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -17,19 +17,25 @@ package org.apache.lucene.store;
* limitations under the License.
*/
+import java.io.FileNotFoundException;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.nio.channels.ClosedChannelException; // javadoc @link
import java.nio.file.DirectoryStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;
@@ -120,6 +126,12 @@ public abstract class FSDirectory extends BaseDirectory {
protected final Path directory; // The underlying filesystem directory
+
+ /** Files we previously tried to delete, but hit exception (on Windows) last time we tried.
+ * These files are in "pending delete" state, where we refuse to openInput or createOutput
+ * them, nor include them in .listAll. */
+ protected final Set<String> pendingDeletes = Collections.newSetFromMap(new ConcurrentHashMap<String,Boolean>());
+
/** Used to generate temp file names in {@link #createTempOutput}. */
private final AtomicLong nextTempFileCounter = new AtomicLong();
@@ -193,11 +205,18 @@ public abstract class FSDirectory extends BaseDirectory {
*
* @throws IOException if there was an I/O error during listing */
public static String[] listAll(Path dir) throws IOException {
+ return listAll(dir, Collections.emptySet());
+ }
+
+ private static String[] listAll(Path dir, Set<String> skipNames) throws IOException {
List<String> entries = new ArrayList<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
for (Path path : stream) {
- entries.add(path.getFileName().toString());
+ String name = path.getFileName().toString();
+ if (skipNames.contains(name) == false) {
+ entries.add(name);
+ }
}
}
@@ -207,7 +226,7 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public String[] listAll() throws IOException {
ensureOpen();
- return listAll(directory);
+ return listAll(directory, pendingDeletes);
}
/** Returns the length in bytes of a file in the directory. */
@@ -219,9 +238,10 @@ public abstract class FSDirectory extends BaseDirectory {
/** Removes an existing file in the directory. */
@Override
- public void deleteFile(String name) throws IOException {
+ public void deleteFiles(Collection<String> names) throws IOException {
ensureOpen();
- Files.delete(directory.resolve(name));
+ pendingDeletes.addAll(names);
+ deletePendingFiles();
}
/** Creates an IndexOutput for the file with the given name. */
@@ -247,9 +267,20 @@ public abstract class FSDirectory extends BaseDirectory {
}
protected void ensureCanWrite(String name) throws IOException {
+ deletePendingFiles();
+ if (pendingDeletes.contains(name)) {
+ throw new IOException("file \"" + name + "\" is pending delete and cannot be overwritten");
+ }
Files.deleteIfExists(directory.resolve(name)); // delete existing, if any
}
+ protected void ensureCanRead(String name) throws IOException {
+ deletePendingFiles();
+ if (pendingDeletes.contains(name)) {
+ throw new NoSuchFileException("file \"" + name + "\" is pending delete and cannot be overwritten");
+ }
+ }
+
@Override
public void sync(Collection<String> names) throws IOException {
ensureOpen();
@@ -270,8 +301,9 @@ public abstract class FSDirectory extends BaseDirectory {
/** Closes the store to future operations. */
@Override
- public synchronized void close() {
+ public synchronized void close() throws IOException {
isOpen = false;
+ deletePendingFiles();
}
/** @return the underlying filesystem directory */
@@ -286,6 +318,74 @@ public abstract class FSDirectory extends BaseDirectory {
return this.getClass().getSimpleName() + "@" + directory + " lockFactory=" + lockFactory;
}
+ protected void fsync(String name) throws IOException {
+ deletePendingFiles();
+ IOUtils.fsync(directory.resolve(name), false);
+ }
+
+ /** Returns true if the file was successfully removed. */
+ private boolean deleteFile(String name) throws IOException {
+ try {
+ Files.delete(directory.resolve(name));
+ pendingDeletes.remove(name);
+ return true;
+ } catch (NoSuchFileException | FileNotFoundException e) {
+ // We were asked to delete a non-existent file:
+ pendingDeletes.remove(name);
+ throw e;
+ } catch (IOException ioe) {
+ // On windows, a file delete can fail because there's still an open
+ // file handle against it. We record this in pendingDeletes and
+ // try again later.
+
+ // TODO: this is hacky/lenient (we don't know which IOException this is), and
+ // it should only happen on filesystems that can do this, so really we should
+ // move this logic to WindowsDirectory or something
+
+ // TODO: can/should we do if (Constants.WINDOWS) here, else throw the exc?
+ // but what about a Linux box with a CIFS mount?
+ //System.out.println("FS.deleteFile failed (" + ioe + "): will retry later");
+ pendingDeletes.add(name);
+ return false;
+ }
+ }
+
+ /** Tries to delete any pending deleted files, and returns true if
+ * there are still files that could not be deleted. */
+ public boolean checkPendingDeletions() throws IOException {
+ deletePendingFiles();
+ return pendingDeletes.isEmpty() == false;
+ }
+
+ /** Try to delete any pending files that we had previously tried to delete but failed
+ * because we are on Windows and the files were still
+ * held open. */
+ public void deletePendingFiles() throws IOException {
+ // TODO: we could fix IndexInputs from FSDirectory subclasses to call this when they are closed?
+
+ // Clone the set because it will change as we iterate:
+ List<String> toDelete = new ArrayList<>(pendingDeletes);
+
+ // First pass: delete any segments_N files. We do these first to be certain stale commit points are removed
+ // before we remove any files they reference. If any delete of segments_N fails, we leave all other files
+ // undeleted so index is never in a corrupt state:
+ for (String fileName : toDelete) {
+ if (fileName.startsWith(IndexFileNames.SEGMENTS)) {
+ if (deleteFile(fileName) == false) {
+ return;
+ }
+ }
+ }
+
+ // Only delete other files if we were able to remove the segments_N files; this way we never
+ // leave a corrupt commit in the index even in the presense of virus checkers:
+ for(String fileName : toDelete) {
+ if (fileName.startsWith(IndexFileNames.SEGMENTS) == false) {
+ deleteFile(fileName);
+ }
+ }
+ }
+
final class FSIndexOutput extends OutputStreamIndexOutput {
/**
* The maximum chunk size is 8192 bytes, because file channel mallocs
@@ -312,8 +412,4 @@ public abstract class FSDirectory extends BaseDirectory {
}, CHUNK_SIZE);
}
}
-
- protected void fsync(String name) throws IOException {
- IOUtils.fsync(directory.resolve(name), false);
- }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
index 0b986f4..13bc217 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FileSwitchDirectory.java
@@ -140,8 +140,21 @@ public class FileSwitchDirectory extends Directory {
}
@Override
- public void deleteFile(String name) throws IOException {
- getDirectory(name).deleteFile(name);
+ public void deleteFiles(Collection<String> names) throws IOException {
+ Set<String> primaryToDelete = new HashSet<>();
+ Set<String> secondaryToDelete = new HashSet<>();
+ for(String name : names) {
+ if (getDirectory(name) == primaryDir) {
+ primaryToDelete.add(name);
+ } else {
+ secondaryToDelete.add(name);
+ }
+ }
+ try {
+ primaryDir.deleteFiles(primaryToDelete);
+ } finally {
+ secondaryDir.deleteFiles(secondaryToDelete);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
index 7c550c1..9ee2928 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FilterDirectory.java
@@ -58,8 +58,8 @@ public class FilterDirectory extends Directory {
}
@Override
- public void deleteFile(String name) throws IOException {
- in.deleteFile(name);
+ public void deleteFiles(Collection<String> names) throws IOException {
+ in.deleteFiles(names);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java b/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
index 389c56d..3ed659a 100644
--- a/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/store/LockValidatingDirectoryWrapper.java
@@ -33,9 +33,9 @@ public final class LockValidatingDirectoryWrapper extends FilterDirectory {
}
@Override
- public void deleteFile(String name) throws IOException {
+ public void deleteFiles(Collection<String> names) throws IOException {
writeLock.ensureValid();
- in.deleteFile(name);
+ in.deleteFiles(names);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
index 0808eb6..b6b4033 100644
--- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
@@ -234,6 +234,7 @@ public class MMapDirectory extends FSDirectory {
@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
ensureOpen();
+ ensureCanRead(name);
Path path = directory.resolve(name);
try (FileChannel c = FileChannel.open(path, StandardOpenOption.READ)) {
final String resourceDescription = "MMapIndexInput(path=\"" + path.toString() + "\")";
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
index b739290..3234592 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
@@ -74,10 +74,10 @@ public class NIOFSDirectory extends FSDirectory {
this(path, FSLockFactory.getDefault());
}
- /** Creates an IndexInput for the file with the given name. */
@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
ensureOpen();
+ ensureCanRead(name);
Path path = getDirectory().resolve(name);
FileChannel fc = FileChannel.open(path, StandardOpenOption.READ);
return new NIOFSIndexInput("NIOFSIndexInput(path=\"" + path + "\")", fc, context);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
index fd5e3d7..1b8404b 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java
@@ -112,14 +112,23 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
}
@Override
- public synchronized void deleteFile(String name) throws IOException {
+ public synchronized void deleteFiles(Collection<String> names) throws IOException {
if (VERBOSE) {
- System.out.println("nrtdir.deleteFile name=" + name);
+ System.out.println("nrtdir.deleteFiles names=" + names);
}
- if (cache.fileNameExists(name)) {
- cache.deleteFile(name);
- } else {
- in.deleteFile(name);
+ Set<String> cacheToDelete = new HashSet<>();
+ Set<String> toDelete = new HashSet<>();
+ for(String name : names) {
+ if (cache.fileNameExists(name)) {
+ cacheToDelete.add(name);
+ } else {
+ toDelete.add(name);
+ }
+ }
+ try {
+ cache.deleteFiles(cacheToDelete);
+ } finally {
+ in.deleteFiles(toDelete);
}
}
@@ -146,14 +155,14 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
System.out.println(" to cache");
}
try {
- in.deleteFile(name);
+ in.deleteFiles(Collections.singleton(name));
} catch (IOException ioe) {
// This is fine: file may not exist
}
return cache.createOutput(name, context);
} else {
try {
- cache.deleteFile(name);
+ cache.deleteFiles(Collections.singleton(name));
} catch (IOException ioe) {
// This is fine: file may not exist
}
@@ -323,7 +332,7 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
synchronized(this) {
// Must sync here because other sync methods have
// if (cache.fileNameExists(name)) { ... } else { ... }:
- cache.deleteFile(fileName);
+ cache.deleteFiles(Collections.singleton(fileName));
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
index d1dc0d0..7be4679 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java
@@ -157,14 +157,16 @@ public class RAMDirectory extends BaseDirectory implements Accountable {
}
@Override
- public void deleteFile(String name) throws IOException {
+ public void deleteFiles(Collection<String> names) throws IOException {
ensureOpen();
- RAMFile file = fileMap.remove(name);
- if (file != null) {
- file.directory = null;
- sizeInBytes.addAndGet(-file.sizeInBytes);
- } else {
- throw new FileNotFoundException(name);
+ for(String name : names) {
+ RAMFile file = fileMap.remove(name);
+ if (file != null) {
+ file.directory = null;
+ sizeInBytes.addAndGet(-file.sizeInBytes);
+ } else {
+ throw new FileNotFoundException(name);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
index 2daf98f..dc7a92c 100644
--- a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
@@ -72,6 +72,7 @@ public class SimpleFSDirectory extends FSDirectory {
@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
ensureOpen();
+ ensureCanRead(name);
Path path = directory.resolve(name);
SeekableByteChannel channel = Files.newByteChannel(path, StandardOpenOption.READ);
return new SimpleFSIndexInput("SimpleFSIndexInput(path=\"" + path + "\")", channel, context);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java b/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
index aa7214c..49d70f8 100644
--- a/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/store/TrackingDirectoryWrapper.java
@@ -18,6 +18,7 @@ package org.apache.lucene.store;
*/
import java.io.IOException;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -33,9 +34,11 @@ public final class TrackingDirectoryWrapper extends FilterDirectory {
}
@Override
- public void deleteFile(String name) throws IOException {
- in.deleteFile(name);
- createdFileNames.remove(name);
+ public void deleteFiles(Collection<String> names) throws IOException {
+ in.deleteFiles(names);
+ for(String name : names) {
+ createdFileNames.remove(name);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
index 510545f..3be3d7f 100644
--- a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java
@@ -38,8 +38,10 @@ import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.Collection;
+import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.Set;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
@@ -191,12 +193,10 @@ public final class IOUtils {
* Note that the files should not be null.
*/
public static void deleteFilesIgnoringExceptions(Directory dir, Collection<String> files) {
- for (String name : files) {
- try {
- dir.deleteFile(name);
- } catch (Throwable ignored) {
- // ignore
- }
+ try {
+ dir.deleteFiles(files);
+ } catch (Throwable ignored) {
+ // ignore
}
}
@@ -212,24 +212,18 @@ public final class IOUtils {
* completes normally if there were no exceptions.
*
* @param dir Directory to delete files from
- * @param files file names to delete
+ * @param names file names to delete
*/
- public static void deleteFiles(Directory dir, Collection<String> files) throws IOException {
- Throwable th = null;
- for (String name : files) {
+ public static void deleteFiles(Directory dir, Collection<String> names) throws IOException {
+ Set<String> nonNullNames = new HashSet<>();
+ for(String name : names) {
if (name != null) {
- try {
- dir.deleteFile(name);
- } catch (Throwable t) {
- addSuppressed(th, t);
- if (th == null) {
- th = t;
- }
- }
+ nonNullNames.add(name);
}
}
-
- reThrow(th);
+ if (names.isEmpty() == false) {
+ dir.deleteFiles(names);
+ }
}
public static void deleteFiles(Directory dir, String... files) throws IOException {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
index e47830d..328ea2e 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
@@ -22,6 +22,7 @@ import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -39,8 +40,8 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.IntroSorter;
import org.apache.lucene.util.LongBitSet;
import org.apache.lucene.util.NumericUtils;
-import org.apache.lucene.util.OfflineSorter;
import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter;
+import org.apache.lucene.util.OfflineSorter;
import org.apache.lucene.util.PriorityQueue;
import org.apache.lucene.util.RamUsageEstimator;
import org.apache.lucene.util.StringHelper;
@@ -820,7 +821,7 @@ public class BKDWriter implements Closeable {
//System.out.println("sort time: " + ((t1-t0)/1000000.0) + " msec");
if (tempInput != null) {
- tempDir.deleteFile(tempInput.getName());
+ tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
tempInput = null;
} else {
assert heapPointWriter != null;
@@ -913,7 +914,7 @@ public class BKDWriter implements Closeable {
try {
tempInput.close();
} finally {
- tempDir.deleteFile(tempInput.getName());
+ tempDir.deleteFiles(Collections.singleton(tempInput.getName()));
tempInput = null;
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
index 6cf1097..0751354 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
@@ -18,7 +18,7 @@ package org.apache.lucene.util.bkd;
*/
import java.io.IOException;
-
+import java.util.Collections;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
@@ -75,7 +75,7 @@ final class OfflinePointWriter implements PointWriter {
@Override
public void destroy() throws IOException {
- tempDir.deleteFile(out.getName());
+ tempDir.deleteFiles(Collections.singleton(out.getName()));
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
index 778a7eb..4b32ec8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
@@ -1103,7 +1103,6 @@ public class TestAddIndexes extends LuceneTestCase {
}
}
-
// LUCENE-2790: tests that the non CFS files were deleted by addIndexes
public void testNonCFSLeftovers() throws Exception {
Directory[] dirs = new Directory[2];
@@ -1121,7 +1120,6 @@ public class TestAddIndexes extends LuceneTestCase {
DirectoryReader[] readers = new DirectoryReader[] { DirectoryReader.open(dirs[0]), DirectoryReader.open(dirs[1]) };
MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), new RAMDirectory());
- dir.setEnableVirusScanner(false); // we check for specific list of files
IndexWriterConfig conf = new IndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy(true));
MergePolicy lmp = conf.getMergePolicy();
// Force creation of CFS:
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java
index 3031553..cafe0a3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesCheckIndexHeader.java
@@ -42,11 +42,6 @@ public class TestAllFilesCheckIndexHeader extends LuceneTestCase {
public void test() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // otherwise we can have unref'd files left in the index that won't be visited when opening a reader and lead to scary looking false failures:
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
-
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
conf.setCodec(TestUtil.getDefaultCodec());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java
index 347955d..bf5625a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestAllFilesDetectTruncation.java
@@ -42,11 +42,6 @@ public class TestAllFilesDetectTruncation extends LuceneTestCase {
public void test() throws Exception {
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // otherwise we can have unref'd files left in the index that won't be visited when opening a reader and lead to scary looking false failures:
- ((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
- }
-
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
conf.setCodec(TestUtil.getDefaultCodec());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java b/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
index e801bcc..acf1ebe 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestAtomicUpdate.java
@@ -181,6 +181,5 @@ public class TestAtomicUpdate extends LuceneTestCase {
directory = newFSDirectory(dirPath);
runTest(directory);
directory.close();
- IOUtils.rm(dirPath);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
index 9d72bd0..90d3c1c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBinaryDocValuesUpdates.java
@@ -1094,10 +1094,6 @@ public class TestBinaryDocValuesUpdates extends LuceneTestCase {
public void testDeleteUnusedUpdatesFiles() throws Exception {
Directory dir = newDirectory();
- // test explicitly needs files to always be actually deleted
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
IndexWriter writer = new IndexWriter(dir, conf);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
index 8077545..fa773fa 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecHoldsOpenFiles.java
@@ -18,6 +18,7 @@ package org.apache.lucene.index;
*/
import java.io.IOException;
+import java.util.Arrays;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.IntPoint;
@@ -47,15 +48,7 @@ public class TestCodecHoldsOpenFiles extends LuceneTestCase {
w.commit();
w.close();
- for(String fileName : d.listAll()) {
- try {
- d.deleteFile(fileName);
- // may succeed, e.g. if the file is completely read into RAM.
- } catch (IOException ioe) {
- // ignore: this means codec (correctly) is holding
- // the file open
- }
- }
+ d.deleteFiles(Arrays.asList(d.listAll()));
for(LeafReaderContext cxt : r.leaves()) {
TestUtil.checkReader(cxt.reader());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
index 083e426..a4b81de 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
@@ -184,10 +184,6 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
public void testNoExtraFiles() throws IOException {
Directory directory = newDirectory();
- if (directory instanceof MockDirectoryWrapper) {
- // test uses IW unref'ed helper which is unaware of retries
- ((MockDirectoryWrapper)directory).setEnableVirusScanner(false);
- }
IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(new MockAnalyzer(random()))
.setMaxBufferedDocs(2));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
index b56b1a0..6d7d1de 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDeletionPolicy.java
@@ -17,6 +17,15 @@ package org.apache.lucene.index;
* limitations under the License.
*/
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@@ -27,23 +36,16 @@ import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/*
Verify we can read the pre-2.1 file format, do searches
against it, and add documents to it.
*/
-
+@SuppressFileSystems("VirusCheckingFS")
public class TestDeletionPolicy extends LuceneTestCase {
private void verifyCommitOrder(List<? extends IndexCommit> commits) {
@@ -223,10 +225,6 @@ public class TestDeletionPolicy extends LuceneTestCase {
final double SECONDS = 2.0;
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test manually deletes files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()))
.setIndexDeletionPolicy(new ExpirationTimeDeletionPolicy(dir, SECONDS));
MergePolicy mp = conf.getMergePolicy();
@@ -299,7 +297,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
break;
}
- dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
+ dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
gen--;
}
@@ -319,10 +317,6 @@ public class TestDeletionPolicy extends LuceneTestCase {
boolean useCompoundFile = (pass % 2) != 0;
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test manually deletes files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()))
.setIndexDeletionPolicy(new KeepAllDeletionPolicy(dir))
@@ -381,7 +375,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
while(gen > 0) {
IndexReader reader = DirectoryReader.open(dir);
reader.close();
- dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
+ dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
gen--;
if (gen > 0) {
@@ -570,10 +564,6 @@ public class TestDeletionPolicy extends LuceneTestCase {
boolean useCompoundFile = (pass % 2) != 0;
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test manually deletes files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
KeepLastNDeletionPolicy policy = new KeepLastNDeletionPolicy(N);
for(int j=0;j<N+1;j++) {
@@ -612,7 +602,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
}
}
if (i < N) {
- dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
+ dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
}
gen--;
}
@@ -634,10 +624,6 @@ public class TestDeletionPolicy extends LuceneTestCase {
boolean useCompoundFile = (pass % 2) != 0;
Directory dir = newDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // test manually deletes files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
- }
IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()))
.setOpenMode(OpenMode.CREATE)
.setIndexDeletionPolicy(new KeepLastNDeletionPolicy(N))
@@ -730,7 +716,7 @@ public class TestDeletionPolicy extends LuceneTestCase {
}
}
if (i < N) {
- dir.deleteFile(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen));
+ dir.deleteFiles(Collections.singleton(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", gen)));
}
gen--;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
index 0d25f28..985606f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDemoParallelLeafReader.java
@@ -384,7 +384,7 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
final Directory dir = openDirectory(leafIndex);
- if (Files.exists(leafIndex.resolve("done")) == false) {
+ if (slowFileExists(dir, "done") == false) {
if (DEBUG) System.out.println(Thread.currentThread().getName() + ": TEST: build segment index for " + leaf + " " + segIDGen + " (source: " + info.getDiagnostics().get("source") + ") dir=" + leafIndex);
if (dir.listAll().length != 0) {
@@ -895,7 +895,9 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
AtomicLong currentSchemaGen = new AtomicLong();
// TODO: separate refresh thread, search threads, indexing threads
- ReindexingReader reindexer = getReindexerNewDVFields(createTempDir(), currentSchemaGen);
+ Path root = createTempDir();
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
+ ReindexingReader reindexer = getReindexerNewDVFields(root, currentSchemaGen);
reindexer.commit();
Document doc = new Document();
@@ -965,6 +967,7 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
int maxID = 0;
Path root = createTempDir();
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
int refreshEveryNumDocs = 100;
int commitCloseNumDocs = 1000;
for(int i=0;i<numDocs;i++) {
@@ -1050,6 +1053,7 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
int numDocs = atLeast(TEST_NIGHTLY ? 20000 : 1000);
int maxID = 0;
Path root = createTempDir();
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
int refreshEveryNumDocs = 100;
int commitCloseNumDocs = 1000;
@@ -1151,7 +1155,9 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
}
public void testBasic() throws Exception {
- ReindexingReader reindexer = getReindexer(createTempDir());
+ Path tempPath = createTempDir();
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(tempPath));
+ ReindexingReader reindexer = getReindexer(tempPath);
// Start with initial empty commit:
reindexer.commit();
@@ -1220,6 +1226,7 @@ public class TestDemoParallelLeafReader extends LuceneTestCase {
public void testRandom() throws Exception {
Path root = createTempDir();
+ assumeFalse("we directly delete files", TestUtil.hasVirusChecker(root));
ReindexingReader reindexer = null;
// TODO: separate refresh thread, search threads, indexing threads
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
index 00b424f..2c4f392 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReader.java
@@ -436,40 +436,43 @@ void assertTermDocsCount(String msg,
rmDir(fileDirName);
}*/
-public void testFilesOpenClose() throws IOException {
- // Create initial data set
- Path dirFile = createTempDir("TestIndexReader.testFilesOpenClose");
- Directory dir = newFSDirectory(dirFile);
- IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
- addDoc(writer, "test");
- writer.close();
- dir.close();
+ public void testFilesOpenClose() throws IOException {
+ // Create initial data set
+ Path dirFile = createTempDir("TestIndexReader.testFilesOpenClose");
+ assumeFalse("test directly deletes files", TestUtil.hasVirusChecker(dirFile));
+ Directory dir = newFSDirectory(dirFile);
+
+ IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random())));
+ addDoc(writer, "test");
+ writer.close();
+ dir.close();
- // Try to erase the data - this ensures that the writer closed all files
- IOUtils.rm(dirFile);
- dir = newFSDirectory(dirFile);
+ // Try to erase the data - this ensures that the writer closed all files
+ IOUtils.rm(dirFile);
+ dir = newFSDirectory(dirFile);
- // Now create the data set again, just as before
- writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.CREATE));
- addDoc(writer, "test");
- writer.close();
- dir.close();
+ // Now create the data set again, just as before
+ writer = new IndexWriter(dir, newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.CREATE));
+ addDoc(writer, "test");
+ writer.close();
+ dir.close();
- // Now open existing directory and test that reader closes all files
- dir = newFSDirectory(dirFile);
- DirectoryReader reader1 = DirectoryReader.open(dir);
- reader1.close();
- dir.close();
+ // Now open existing directory and test that reader closes all files
+ dir = newFSDirectory(dirFile);
+ DirectoryReader reader1 = DirectoryReader.open(dir);
+ reader1.close();
+ dir.close();
- // The following will fail if reader did not close
- // all files
- IOUtils.rm(dirFile);
+ // The following will fail if reader did not close
+ // all files
+ IOUtils.rm(dirFile);
}
public void testOpenReaderAfterDelete() throws IOException {
Path dirFile = createTempDir("deletetest");
Directory dir = newFSDirectory(dirFile);
+ assumeFalse("test deletes files directly", TestUtil.hasVirusChecker(dir));
if (dir instanceof BaseDirectoryWrapper) {
((BaseDirectoryWrapper)dir).setCheckIndexOnClose(false); // we will hit NoSuchFileException in MDW since we nuked it!
}
@@ -717,7 +720,6 @@ public void testFilesOpenClose() throws IOException {
// good exception
public void testNoDir() throws Throwable {
Path tempDir = createTempDir("doesnotexist");
- IOUtils.rm(tempDir);
Directory dir = newFSDirectory(tempDir);
try {
DirectoryReader.open(dir);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
index 2c3b134..934ec73 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java
@@ -19,6 +19,7 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -39,14 +40,12 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.MockDirectoryWrapper.FakeIOException;
+import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
-
-
public class TestDirectoryReaderReopen extends LuceneTestCase {
public void testReopen() throws Exception {
@@ -625,10 +624,6 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
public void testOverDecRefDuringReopen() throws Exception {
MockDirectoryWrapper dir = newMockDirectory();
- if (dir instanceof MockDirectoryWrapper) {
- // ensure we produce enough of our exceptions
- dir.setEnableVirusScanner(false);
- }
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
iwc.setCodec(TestUtil.getDefaultCodec());
@@ -713,7 +708,7 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
// Blow away the index:
for(String fileName : dir.listAll()) {
- dir.deleteFile(fileName);
+ dir.deleteFiles(Collections.singleton(fileName));
}
w = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
@@ -762,9 +757,7 @@ public class TestDirectoryReaderReopen extends LuceneTestCase {
DirectoryReader r = DirectoryReader.open(dir);
// Blow away the index:
- for(String fileName : dir.listAll()) {
- dir.deleteFile(fileName);
- }
+ dir.deleteFiles(Arrays.asList(dir.listAll()));
w = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())));
doc = new Document();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
index 39fbec8..24ce405 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestDoc.java
@@ -48,6 +48,7 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.StringHelper;
+import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.Version;
/** JUnit adaptation of an older test case DocTest. */
@@ -120,8 +121,6 @@ public class TestDoc extends LuceneTestCase {
// We create unreferenced files (we don't even write
// a segments file):
((MockDirectoryWrapper) directory).setAssertNoUnrefencedFilesOnClose(false);
- // this test itself deletes files (has no retry mechanism)
- ((MockDirectoryWrapper) directory).setEnableVirusScanner(false);
}
IndexWriter writer = new IndexWriter(
@@ -164,8 +163,6 @@ public class TestDoc extends LuceneTestCase {
// We create unreferenced files (we don't even write
// a segments file):
((MockDirectoryWrapper) directory).setAssertNoUnrefencedFilesOnClose(false);
- // this test itself deletes files (has no retry mechanism)
- ((MockDirectoryWrapper) directory).setEnableVirusScanner(false);
}
writer = new IndexWriter(
@@ -237,9 +234,7 @@ public class TestDoc extends LuceneTestCase {
Collection<String> filesToDelete = si.files();
codec.compoundFormat().write(dir, si, context);
si.setUseCompoundFile(true);
- for (final String fileToDelete : filesToDelete) {
- si1.info.dir.deleteFile(fileToDelete);
- }
+ si1.info.dir.deleteFiles(filesToDelete);
}
return new SegmentCommitInfo(si, 0, -1L, -1L, -1L);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
index d9a1d2e..2d33f71 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
@@ -188,42 +188,37 @@ public class TestFieldsReader extends LuceneTestCase {
public void testExceptions() throws Throwable {
Path indexDir = createTempDir("testfieldswriterexceptions");
- try {
- Directory fsDir = newFSDirectory(indexDir);
- FaultyFSDirectory dir = new FaultyFSDirectory(fsDir);
- IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()))
- .setOpenMode(OpenMode.CREATE);
- IndexWriter writer = new IndexWriter(dir, iwc);
- for(int i=0;i<2;i++)
- writer.addDocument(testDoc);
- writer.forceMerge(1);
- writer.close();
-
- IndexReader reader = DirectoryReader.open(dir);
- dir.startFailing();
-
- boolean exc = false;
-
- for(int i=0;i<2;i++) {
- try {
- reader.document(i);
- } catch (IOException ioe) {
- // expected
- exc = true;
- }
- try {
- reader.document(i);
- } catch (IOException ioe) {
- // expected
- exc = true;
- }
+ Directory fsDir = newFSDirectory(indexDir);
+ FaultyFSDirectory dir = new FaultyFSDirectory(fsDir);
+ IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()))
+ .setOpenMode(OpenMode.CREATE);
+ IndexWriter writer = new IndexWriter(dir, iwc);
+ for(int i=0;i<2;i++)
+ writer.addDocument(testDoc);
+ writer.forceMerge(1);
+ writer.close();
+
+ IndexReader reader = DirectoryReader.open(dir);
+ dir.startFailing();
+
+ boolean exc = false;
+
+ for(int i=0;i<2;i++) {
+ try {
+ reader.document(i);
+ } catch (IOException ioe) {
+ // expected
+ exc = true;
+ }
+ try {
+ reader.document(i);
+ } catch (IOException ioe) {
+ // expected
+ exc = true;
}
- assertTrue(exc);
- reader.close();
- dir.close();
- } finally {
- IOUtils.rm(indexDir);
}
-
+ assertTrue(exc);
+ reader.close();
+ dir.close();
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84f44589/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index 5fa777b..fa9f1a7 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -34,6 +34,7 @@ import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.InfoStream;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
/*
Verify we can read the pre-2.1 file format, do searches
@@ -46,8 +47,6 @@ public class TestIndexFileDeleter extends LuceneTestCase {
Directory dir = newDirectory();
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper)dir).setPreventDoubleWrite(false);
- // ensure we actually delete files
- ((MockDirectoryWrapper)dir).setEnableVirusScanner(false);
}
MergePolicy mergePolicy = newLogMergePolicy(true, 10);
@@ -222,7 +221,6 @@ public class TestIndexFileDeleter extends LuceneTestCase {
public void testVirusScannerDoesntCorruptIndex() throws IOException {
MockDirectoryWrapper dir = newMockDirectory();
dir.setPreventDoubleWrite(false); // we arent trying to test this
- dir.setEnableVirusScanner(false); // we have our own to make test reproduce always
// add empty commit
new IndexWriter(dir, new IndexWriterConfig(null)).close();
[16/17] lucene-solr git commit: fix javadoc errors
Posted by mi...@apache.org.
fix javadoc errors
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5b4c1d96
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5b4c1d96
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5b4c1d96
Branch: refs/heads/master
Commit: 5b4c1d963cc211f7125271eb7735db7d4f70ecdc
Parents: d2a5c10
Author: Mike McCandless <mi...@apache.org>
Authored: Sat Feb 6 04:47:16 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Sat Feb 6 04:47:16 2016 -0500
----------------------------------------------------------------------
.../src/java/org/apache/lucene/util/LuceneTestCase.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5b4c1d96/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index 2d1a48b..968c957 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -1271,7 +1271,7 @@ public abstract class LuceneTestCase extends Assert {
return newDirectory(random());
}
- /** Like {@link newDirectory} except randomly the {@link VirusCheckingFS} may be installed */
+ /** Like {@link #newDirectory} except randomly the {@link VirusCheckingFS} may be installed */
public static BaseDirectoryWrapper newMaybeVirusCheckingDirectory() {
if (random().nextInt(5) == 4) {
Path path = addVirusChecker(createTempDir());
@@ -1340,7 +1340,7 @@ public abstract class LuceneTestCase extends Assert {
return newFSDirectory(f, FSLockFactory.getDefault());
}
- /** Like {@link newFSDirectory(Path)}, but randomly insert {@link VirusCheckingFS} */
+ /** Like {@link #newFSDirectory(Path)}, but randomly insert {@link VirusCheckingFS} */
public static BaseDirectoryWrapper newMaybeVirusCheckingFSDirectory(Path f) {
if (random().nextInt(5) == 4) {
f = addVirusChecker(f);
[13/17] lucene-solr git commit: improve tests;
fix RAFDirectory.openInput to respect pending delete
Posted by mi...@apache.org.
improve tests; fix RAFDirectory.openInput to respect pending delete
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/24f55abf
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/24f55abf
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/24f55abf
Branch: refs/heads/master
Commit: 24f55abfd508d4d36aa697c77fcded534016ca1c
Parents: 85c546b
Author: Mike McCandless <mi...@apache.org>
Authored: Fri Feb 5 12:19:24 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Fri Feb 5 12:19:24 2016 -0500
----------------------------------------------------------------------
.../src/java/org/apache/lucene/index/IndexWriter.java | 5 ++---
.../src/java/org/apache/lucene/store/FSDirectory.java | 6 ++++--
.../test/org/apache/lucene/index/TestIndexWriter.java | 2 +-
.../index/TestIndexWriterOutOfFileDescriptors.java | 2 ++
.../org/apache/lucene/index/TestStressIndexing2.java | 6 +++---
.../src/test/org/apache/lucene/index/TestStressNRT.java | 2 +-
.../src/java/org/apache/lucene/store/RAFDirectory.java | 1 +
.../java/org/apache/lucene/mockfile/VirusCheckingFS.java | 7 ++++---
.../org/apache/lucene/store/BaseDirectoryTestCase.java | 11 +++++++++--
.../org/apache/lucene/store/BaseLockFactoryTestCase.java | 2 ++
10 files changed, 29 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index 7d72603..bd0de48 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -754,9 +754,8 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
* IO error
*/
public IndexWriter(Directory d, IndexWriterConfig conf) throws IOException {
- Directory unwrapped = FilterDirectory.unwrap(d);
- if (unwrapped instanceof FSDirectory && ((FSDirectory) unwrapped).checkPendingDeletions()) {
- throw new IllegalArgumentException("Directory still has pending deleted files; cannot initialize IndexWriter");
+ if (d instanceof FSDirectory && ((FSDirectory) d).checkPendingDeletions()) {
+ throw new IllegalArgumentException("Directory " + d + " is still has pending deleted files; cannot initialize IndexWriter");
}
conf.setIndexWriter(this); // prevent reuse by other instances
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
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 38c8fdc..9d0cfa7 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -280,11 +280,11 @@ public abstract class FSDirectory extends BaseDirectory {
@Override
public void sync(Collection<String> names) throws IOException {
ensureOpen();
- maybeDeletePendingFiles();
for (String name : names) {
fsync(name);
}
+ maybeDeletePendingFiles();
}
@Override
@@ -293,11 +293,12 @@ public abstract class FSDirectory extends BaseDirectory {
if (pendingDeletes.contains(source)) {
throw new NoSuchFileException("file \"" + source + "\" is pending delete and cannot be moved");
}
- maybeDeletePendingFiles();
+ pendingDeletes.remove(dest);
Files.move(directory.resolve(source), directory.resolve(dest), StandardCopyOption.ATOMIC_MOVE);
// TODO: should we move directory fsync to a separate 'syncMetadata' method?
// for example, to improve listCommits(), IndexFileDeleter could also call that after deleting segments_Ns
IOUtils.fsync(directory, true);
+ maybeDeletePendingFiles();
}
@Override
@@ -327,6 +328,7 @@ public abstract class FSDirectory extends BaseDirectory {
throw new NoSuchFileException("file \"" + name + "\" is already pending delete");
}
privateDeleteFile(name);
+ maybeDeletePendingFiles();
}
/** Tries to delete any pending deleted files, and returns true if
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index 1c3568a..d0008c9 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -2737,7 +2737,7 @@ public class TestIndexWriter extends LuceneTestCase {
try {
w = new IndexWriter(dir, iwc);
} catch (IllegalArgumentException iae) {
- assertEquals("Directory still has pending deleted files; cannot initialize IndexWriter", iae.getMessage());
+ assertTrue(iae.getMessage().contains("still has pending deleted files; cannot initialize IndexWriter"));
}
in.close();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
index 30aac07..c4f39a8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
@@ -26,10 +26,12 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LineFileDocs;
+import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.PrintStreamInfoStream;
import org.apache.lucene.util.TestUtil;
+@SuppressFileSystems("WindowsFS")
public class TestIndexWriterOutOfFileDescriptors extends LuceneTestCase {
public void test() throws Exception {
MockDirectoryWrapper dir = newMockFSDirectory(createTempDir("TestIndexWriterOutOfFileDescriptors"));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
index 6326209..931eea6 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
@@ -48,7 +48,7 @@ public class TestStressIndexing2 extends LuceneTestCase {
static int seed=0;
public void testRandomIWReader() throws Throwable {
- Directory dir = newDirectory();
+ Directory dir = newMaybeVirusCheckingDirectory();
// TODO: verify equals using IW.getReader
DocsAndWriter dw = indexRandomIWReader(5, 3, 100, dir);
@@ -61,8 +61,8 @@ public class TestStressIndexing2 extends LuceneTestCase {
}
public void testRandom() throws Throwable {
- Directory dir1 = newDirectory();
- Directory dir2 = newDirectory();
+ Directory dir1 = newMaybeVirusCheckingDirectory();
+ Directory dir2 = newMaybeVirusCheckingDirectory();
// mergeFactor=2; maxBufferedDocs=2; Map docs = indexRandom(1, 3, 2, dir1);
boolean doReaderPooling = random().nextBoolean();
Map<String,Document> docs = indexRandom(5, 3, 100, dir1, doReaderPooling);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
index b6cc489..3956613 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestStressNRT.java
@@ -104,7 +104,7 @@ public class TestStressNRT extends LuceneTestCase {
List<Thread> threads = new ArrayList<>();
- Directory dir = newDirectory();
+ Directory dir = newMaybeVirusCheckingDirectory();
final RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(new MockAnalyzer(random())));
writer.setDoRandomForceMergeAssert(false);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
index 94be104..c014060 100644
--- a/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
+++ b/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
@@ -66,6 +66,7 @@ public class RAFDirectory extends FSDirectory {
@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
ensureOpen();
+ ensureCanRead(name);
final File path = directory.resolve(name).toFile();
RandomAccessFile raf = new RandomAccessFile(path, "r");
return new RAFIndexInput("SimpleFSIndexInput(path=\"" + path.getPath() + "\")", raf, context);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
index 5d14a3b..2c24d10 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/mockfile/VirusCheckingFS.java
@@ -28,8 +28,9 @@ import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.util.LuceneTestCase;
/**
- * Acts like Windows, where random programs may open the files you just wrote in an unfriendly
- * way preventing deletion (e.g. not passing FILE_SHARE_DELETE) or renaming or overwriting etc.
+ * Acts like a virus checker on Windows, where random programs may open the files you just wrote in an unfriendly
+ * way preventing deletion (e.g. not passing FILE_SHARE_DELETE) or renaming or overwriting etc. This is more evil
+ * than WindowsFS which just prevents deletion of files you still old open.
*/
public class VirusCheckingFS extends FilterFileSystemProvider {
@@ -75,5 +76,5 @@ public class VirusCheckingFS extends FilterFileSystemProvider {
super.delete(path);
}
- // TODO: rename? createOutput? deleteIfExists?
+ // TODO: we could be more evil here, e.g. rename, createOutput, deleteIfExists
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
index 892da1e..fadd1d8 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
@@ -1282,8 +1282,15 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
// expected
}
- // write the file again
- try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+ if (random().nextBoolean()) {
+ try (IndexOutput out = fsDir.createOutput(fileName + "z", IOContext.DEFAULT)) {
+ }
+ // Make sure we can rename onto the deleted file:
+ fsDir.renameFile(fileName + "z", fileName);
+ } else {
+ // write the file again
+ try (IndexOutput out = dir.createOutput(fileName, IOContext.DEFAULT)) {
+ }
}
assertEquals(0, fsDir.fileLength(fileName));
assertTrue(Arrays.asList(fsDir.listAll()).contains(fileName));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f55abf/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index 2b6a6e3..7677bad 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@ -160,6 +160,8 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
// no unexpected exceptions are raised:
public void testStressLocks() throws Exception {
Path tempPath = createTempDir();
+ assumeFalse("cannot handle buggy Files.delete", TestUtil.hasWindowsFS(tempPath));
+
Directory dir = getDirectory(tempPath);
// First create a 1 doc index: