lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r727029 - in /lucene/java/trunk/contrib/benchmark: CHANGES.txt src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Date Tue, 16 Dec 2008 11:44:02 GMT
Author: mikemccand
Date: Tue Dec 16 03:44:01 2008
New Revision: 727029

URL: http://svn.apache.org/viewvc?rev=727029&view=rev
Log:
LUCENE-1492: add optional readOnly param to OpenReader task

Modified:
    lucene/java/trunk/contrib/benchmark/CHANGES.txt
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java

Modified: lucene/java/trunk/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/CHANGES.txt?rev=727029&r1=727028&r2=727029&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/benchmark/CHANGES.txt Tue Dec 16 03:44:01 2008
@@ -4,6 +4,9 @@
 
 $Id:$
 
+12/16/08
+  LUCENE-1492: Added optional readOnly param (default true) to OpenReader task.
+
 9/9/08
  LUCENE-1243: Added new sorting benchmark capabilities.  Also Reopen and commit tasks.  (Mark
Miller via Grant Ingersoll)
 

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java?rev=727029&r1=727028&r2=727029&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
Tue Dec 16 03:44:01 2008
@@ -29,15 +29,25 @@
  */
 public class OpenReaderTask extends PerfTask {
 
+  private boolean readOnly = true;
+
   public OpenReaderTask(PerfRunData runData) {
     super(runData);
   }
 
   public int doLogic() throws IOException {
     Directory dir = getRunData().getDirectory();
-    IndexReader reader = IndexReader.open(dir);
+    IndexReader reader = IndexReader.open(dir, readOnly);
     getRunData().setIndexReader(reader);
     return 1;
   }
 
+  public void setParams(String params) {
+    super.setParams(params);
+    readOnly = Boolean.valueOf(params).booleanValue();
+  }
+
+  public boolean supportsParams() {
+    return true;
+  }
 }

Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=727029&r1=727028&r2=727029&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Tue Dec 16 03:44:01 2008
@@ -109,7 +109,7 @@
         "{ AddDoc } : 1000",
         "Optimize",
         "CloseIndex",
-        "OpenReader",
+        "OpenReader(true)",
         "{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body])
} : 200",
         "CloseReader",
     };
@@ -147,7 +147,7 @@
         "{ AddDoc } : 1000",
         "Optimize",
         "CloseIndex",
-        "OpenReader",
+        "OpenReader(false)",
         "{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body])
} : 200",
         "CloseReader",
     };



Mime
View raw message