lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1210486 - in /lucene/dev/branches/lucene3606/modules: benchmark/conf/ benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ benchmark/src/test/org/apache/lucene/benchmark/byTask/ facet/src/examples/org/apache/lucene/facet/example/si...
Date Mon, 05 Dec 2011 14:57:45 GMT
Author: rmuir
Date: Mon Dec  5 14:57:44 2011
New Revision: 1210486

URL: http://svn.apache.org/viewvc?rev=1210486&view=rev
Log:
LUCENE-3606: remove indexreader modification tasks from benchmark

Removed:
    lucene/dev/branches/lucene3606/modules/benchmark/conf/deletepercent.alg
    lucene/dev/branches/lucene3606/modules/benchmark/conf/deletes.alg
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteDocTask.java
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java
Modified:
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
    lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java
    lucene/dev/branches/lucene3606/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
    lucene/dev/branches/lucene3606/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleMain.java

Modified: lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java?rev=1210486&r1=1210485&r2=1210486&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java
(original)
+++ lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java
Mon Dec  5 14:57:44 2011
@@ -21,7 +21,6 @@ import java.util.Map;
 
 import org.apache.lucene.benchmark.byTask.PerfRunData;
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexReader;
 
 /**
  * Commits the IndexWriter.
@@ -51,14 +50,6 @@ public class CommitIndexTask extends Per
     IndexWriter iw = getRunData().getIndexWriter();
     if (iw != null) {
       iw.commit(commitUserData);
-    } else {
-      IndexReader r = getRunData().getIndexReader();
-      if (r != null) {
-        r.commit(commitUserData);
-        r.decRef();
-      } else {
-        throw new IllegalStateException("neither IndexWriter nor IndexReader is currently
open");
-      }
     }
     
     return 1;

Modified: lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java?rev=1210486&r1=1210485&r2=1210486&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
(original)
+++ lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
Mon Dec  5 14:57:44 2011
@@ -22,20 +22,17 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.apache.lucene.benchmark.byTask.PerfRunData;
-import org.apache.lucene.benchmark.byTask.utils.Config;
 import org.apache.lucene.index.IndexCommit;
-import org.apache.lucene.index.IndexDeletionPolicy;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.store.Directory;
 
 /**
  * Open an index reader.
  * <br>Other side effects: index reader object in perfRunData is set.
- * <br> Optional params readOnly,commitUserData eg. OpenReader(false,commit1)
+ * <br> Optional params commitUserData eg. OpenReader(false,commit1)
  */
 public class OpenReaderTask extends PerfTask {
   public static final String USER_DATA = "userData";
-  private boolean readOnly = true;
   private String commitUserData = null;
 
   public OpenReaderTask(PerfRunData runData) {
@@ -45,22 +42,11 @@ public class OpenReaderTask extends Perf
   @Override
   public int doLogic() throws IOException {
     Directory dir = getRunData().getDirectory();
-    Config config = getRunData().getConfig();
     IndexReader r = null;
-    final IndexDeletionPolicy deletionPolicy;
-    if (readOnly) {
-      deletionPolicy = null;
-    } else {
-      deletionPolicy = CreateIndexTask.getIndexDeletionPolicy(config);
-    }
     if (commitUserData != null) {
-      r = IndexReader.open(OpenReaderTask.findIndexCommit(dir, commitUserData),
-                           deletionPolicy,
-                           readOnly); 
+      r = IndexReader.open(OpenReaderTask.findIndexCommit(dir, commitUserData)); 
     } else {
-      r = IndexReader.open(dir,
-                           deletionPolicy,
-                           readOnly); 
+      r = IndexReader.open(dir); 
     }
     getRunData().setIndexReader(r);
     // We transfer reference to the run data
@@ -74,10 +60,7 @@ public class OpenReaderTask extends Perf
     if (params != null) {
       String[] split = params.split(",");
       if (split.length > 0) {
-        readOnly = Boolean.valueOf(split[0]).booleanValue();
-      }
-      if (split.length > 1) {
-        commitUserData = split[1];
+        commitUserData = split[0];
       }
     }
   }

Modified: lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java?rev=1210486&r1=1210485&r2=1210486&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java
(original)
+++ lucene/dev/branches/lucene3606/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java
Mon Dec  5 14:57:44 2011
@@ -44,11 +44,9 @@ public class PrintReaderTask extends Per
     Directory dir = getRunData().getDirectory();
     IndexReader r = null;
     if (userData == null) 
-      r = IndexReader.open(dir, true);
+      r = IndexReader.open(dir);
     else
-      r = IndexReader.open(OpenReaderTask.findIndexCommit(dir, userData),
-                           null,
-                           true);
+      r = IndexReader.open(OpenReaderTask.findIndexCommit(dir, userData));
     System.out.println("--> numDocs:"+r.numDocs()+" dels:"+r.numDeletedDocs());
     r.close();
     return 1;

Modified: lucene/dev/branches/lucene3606/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=1210486&r1=1210485&r2=1210486&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
(original)
+++ lucene/dev/branches/lucene3606/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Mon Dec  5 14:57:44 2011
@@ -167,7 +167,7 @@ public class TestPerfTasksLogic extends 
         "{ AddDoc } : 100",
         "ForceMerge(1)",
         "CloseIndex",
-        "OpenReader(true)",
+        "OpenReader",
         "{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body])
} : 200",
         "CloseReader",
     };
@@ -206,7 +206,7 @@ public class TestPerfTasksLogic extends 
         "{ AddDoc } : 1000",
         "ForceMerge(1)",
         "CloseIndex",
-        "OpenReader(false)",
+        "OpenReader",
         "{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body])
} : 200",
         "CloseReader",
     };
@@ -623,40 +623,6 @@ public class TestPerfTasksLogic extends 
     }
   }
 
-  public void testDeleteByPercent() throws Exception {
-    // 1. alg definition (required in every "logic" test)
-    String algLines[] = {
-        "# ----- properties ",
-        "content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource",
-        "docs.file=" + getReuters20LinesFile(),
-        "ram.flush.mb=-1",
-        "max.buffered=2",
-        "content.source.log.step=3",
-        "doc.term.vector=false",
-        "content.source.forever=false",
-        "directory=RAMDirectory",
-        "doc.stored=false",
-        "doc.tokenized=false",
-        "debug.level=1",
-        "# ----- alg ",
-        "CreateIndex",
-        "{ \"AddDocs\"  AddDoc > : * ",
-        "CloseIndex()",
-        "OpenReader(false)",
-        "DeleteByPercent(20)",
-        "CloseReader"
-    };
-    
-    // 2. execute the algorithm  (required in every "logic" test)
-    Benchmark benchmark = execBenchmark(algLines);
-
-    // 3. test number of docs in the index
-    IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory());
-    int ndocsExpected = 16; // first 20 reuters docs, minus 20%
-    assertEquals("wrong number of docs in the index!", ndocsExpected, ir.numDocs());
-    ir.close();
-  }
-
   /**
    * Test that we can set merge scheduler".
    */

Modified: lucene/dev/branches/lucene3606/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleMain.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3606/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleMain.java?rev=1210486&r1=1210485&r2=1210486&view=diff
==============================================================================
--- lucene/dev/branches/lucene3606/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleMain.java
(original)
+++ lucene/dev/branches/lucene3606/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleMain.java
Mon Dec  5 14:57:44 2011
@@ -57,7 +57,7 @@ public class SimpleMain {
 
     // open readers
     TaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
-    IndexReader indexReader = IndexReader.open(indexDir, true);
+    IndexReader indexReader = IndexReader.open(indexDir);
 
     ExampleUtils.log("search the sample documents...");
     List<FacetResult> facetRes = SimpleSearcher.searchWithFacets(indexReader, taxo);
@@ -82,7 +82,7 @@ public class SimpleMain {
 
     // open readers
     TaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
-    IndexReader indexReader = IndexReader.open(indexDir, true);
+    IndexReader indexReader = IndexReader.open(indexDir);
 
     ExampleUtils.log("search the sample documents...");
     List<FacetResult> facetRes = SimpleSearcher.searchWithDrillDown(indexReader, taxo);



Mime
View raw message