mirror of https://github.com/apache/lucene.git
LUCENE-987: deprecate IndexModifier
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@570247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b4e5a82de
commit
bcb5b6ff24
|
@ -89,6 +89,7 @@ import java.io.PrintStream;
|
|||
* then add all the new documents.
|
||||
*
|
||||
* @author Daniel Naber
|
||||
* @deprecated Please use {@link IndexWriter} instead.
|
||||
*/
|
||||
public class IndexModifier {
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ import java.util.Stack;
|
|||
* same time.
|
||||
*
|
||||
* @author Daniel Naber
|
||||
* @deprecated
|
||||
*/
|
||||
public class TestIndexModifier extends TestCase {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.io.File;
|
|||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.lucene.index.IndexModifier;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
|
||||
/**
|
||||
* This tests the patch for issue #LUCENE-715 (IndexWriter does not
|
||||
|
@ -70,13 +70,13 @@ public class TestIndexWriterLockRelease extends TestCase {
|
|||
}
|
||||
|
||||
public void testIndexWriterLockRelease() throws IOException {
|
||||
IndexModifier im;
|
||||
IndexWriter im;
|
||||
|
||||
try {
|
||||
im = new IndexModifier(this.__test_dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false);
|
||||
im = new IndexWriter(this.__test_dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false);
|
||||
} catch (FileNotFoundException e) {
|
||||
try {
|
||||
im = new IndexModifier(this.__test_dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false);
|
||||
im = new IndexWriter(this.__test_dir, new org.apache.lucene.analysis.standard.StandardAnalyzer(), false);
|
||||
} catch (FileNotFoundException e1) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ public class TestStressIndexing extends TestCase {
|
|||
private static int RUN_TIME_SEC = 15;
|
||||
|
||||
private static class IndexerThread extends Thread {
|
||||
IndexModifier modifier;
|
||||
IndexWriter modifier;
|
||||
int nextID;
|
||||
public int count;
|
||||
boolean failed;
|
||||
|
||||
public IndexerThread(IndexModifier modifier) {
|
||||
public IndexerThread(IndexWriter modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class TestStressIndexing extends TestCase {
|
|||
stress test.
|
||||
*/
|
||||
public void runStressTest(Directory directory) throws Exception {
|
||||
IndexModifier modifier = new IndexModifier(directory, ANALYZER, true);
|
||||
IndexWriter modifier = new IndexWriter(directory, ANALYZER, true);
|
||||
|
||||
// One modifier that writes 10 docs then removes 5, over
|
||||
// and over:
|
||||
|
@ -141,7 +141,7 @@ public class TestStressIndexing extends TestCase {
|
|||
modifier.close();
|
||||
|
||||
assertTrue("hit unexpected exception in indexer", !indexerThread.failed);
|
||||
assertTrue("hit unexpected exception in indexer 2", !indexerThread2.failed);
|
||||
assertTrue("hit unexpected exception in indexer2", !indexerThread2.failed);
|
||||
assertTrue("hit unexpected exception in search1", !searcherThread1.failed);
|
||||
assertTrue("hit unexpected exception in search2", !searcherThread2.failed);
|
||||
//System.out.println(" Writer: " + indexerThread.count + " iterations");
|
||||
|
|
Loading…
Reference in New Issue