Index: common-build.xml
===================================================================
--- common-build.xml (revision 550894)
+++ common-build.xml (working copy)
@@ -310,8 +310,9 @@
-
+
+
Index: contrib/benchmark/CHANGES.txt
===================================================================
--- contrib/benchmark/CHANGES.txt (revision 550905)
+++ contrib/benchmark/CHANGES.txt (working copy)
@@ -5,8 +5,9 @@
$Id:$
6/25/07
-- LUCENE-940: Multi-threaded issues fixed: SimpleDateFormat;
- logging for addDoc/deleteDoc tasks. (Doron Cohen)
+- LUCENE-940: Multi-threaded issues fixed: SimpleDateFormat; logging for addDoc/deleteDoc tasks.
+- LUCENE-945: tests fail to find data dirs. Added sys-prop benchmark.work.dir and cfg-prop work.dir.
+(Doron Cohen)
4/17/07
- LUCENE-863: Deprecated StandardBenchmarker in favour of byTask code.
Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
===================================================================
--- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java (revision 550894)
+++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java (working copy)
@@ -29,9 +29,17 @@
/**
* Perf run configuration properties.
+ *
* Numeric peroperty containing ":", e.g. "10:100:5" is interpreted
* as array of numeric values. It is extracted once, on first use, and
- * maintain an round number to return the appropriate value.
+ * maintain a round number to return the appropriate value.
+ *
+ * The config property "work.dir" tells where is the root of
+ * docs data dirs and indexes dirs. It is set to either of:
+ * - value supplied for it in the alg file;
+ * - otherwise, value of System property "benchmark.work.dir";
+ * - otherwise, "work".
+ *
*/
public class Config {
@@ -70,6 +78,11 @@
this.props = new Properties();
props.load(new ByteArrayInputStream(sb.toString().getBytes()));
+ // make sure work dir is set properly
+ if (props.get("work.dir")==null) {
+ props.setProperty("work.dir",System.getProperty("benchmark.work.dir","work"));
+ }
+
if (Boolean.valueOf(props.getProperty("print.props","true")).booleanValue()) {
printProps();
}
Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersDocMaker.java
===================================================================
--- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersDocMaker.java (revision 550905)
+++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersDocMaker.java (working copy)
@@ -31,11 +31,11 @@
/**
* A DocMaker using the Reuters collection for its input.
- *
- * Config properties:
- * docs.dir=<path to the docs dir| Default: reuters-out>
-
- *
+ *
+ * Config properties:
+ * - work.dir=<path to the root of docs and indexes dirs| Default: work>
+ * - docs.dir=<path to the docs dir| Default: reuters-out>
+ *
*/
public class ReutersDocMaker extends BasicDocMaker {
@@ -50,10 +50,10 @@
*/
public void setConfig(Config config) {
super.setConfig(config);
+ File workDir = new File(config.get("work.dir","work"));
String d = config.get("docs.dir","reuters-out");
- dataDir = new File(new File("work"),d);
+ dataDir = new File(workDir,d);
-
collectFiles(dataDir,inputFiles);
if (inputFiles.size()==0) {
throw new RuntimeException("No txt files in dataDir: "+dataDir.getAbsolutePath());
Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java
===================================================================
--- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java (revision 550905)
+++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocMaker.java (working copy)
@@ -36,6 +36,11 @@
/**
* A DocMaker using the (compressed) Trec collection for its input.
+ *
+ * Config properties:
+ * - work.dir=<path to the root of docs and indexes dirs| Default: work>
+ * - docs.dir=<path to the docs dir| Default: trec>
+ *
*/
public class TrecDocMaker extends BasicDocMaker {
@@ -61,8 +66,9 @@
*/
public void setConfig(Config config) {
super.setConfig(config);
+ File workDir = new File(config.get("work.dir","work"));
String d = config.get("docs.dir","trec");
- dataDir = new File(new File("work"),d);
+ dataDir = new File(workDir,d);
collectFiles(dataDir,inputFiles);
if (inputFiles.size()==0) {
throw new RuntimeException("No txt files in dataDir: "+dataDir.getAbsolutePath());
Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
===================================================================
--- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java (revision 550894)
+++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java (working copy)
@@ -48,6 +48,8 @@
* Analyzer.
* Statistics data which updated during the run.
*
+ * Config properties: work.dir=<path to root of docs and index dirs| Default: work>
+ *
*/
public class PerfRunData {
@@ -117,7 +119,7 @@
// directory (default is ram-dir).
if ("FSDirectory".equals(config.get("directory","RAMDirectory"))) {
- File workDir = new File("work");
+ File workDir = new File(config.get("work.dir","work"));
File indexDir = new File(workDir,"index");
if (eraseIndex && indexDir.exists()) {
FileUtils.fullyDelete(indexDir);
Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html
===================================================================
--- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html (revision 550894)
+++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html (working copy)
@@ -506,6 +506,11 @@
+ - Root directory for data and indexes:
+ - work.dir (default is System proprety "benchmark.work.dir" or "work".)
+
+
+
Docs and queries creation:
- analyzer
- doc.maker
Index: contrib/benchmark/build.xml
===================================================================
--- contrib/benchmark/build.xml (revision 550894)
+++ contrib/benchmark/build.xml (working copy)
@@ -28,7 +28,6 @@
-
@@ -152,4 +151,9 @@
+
+
+
+
+