You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by do...@apache.org on 2007/04/13 21:30:04 UTC
svn commit: r528617 - in /lucene/java/trunk/contrib/benchmark: ./
src/java/org/apache/lucene/benchmark/byTask/
src/java/org/apache/lucene/benchmark/byTask/tasks/
src/java/org/apache/lucene/benchmark/byTask/utils/
Author: doronc
Date: Fri Apr 13 12:30:03 2007
New Revision: 528617
URL: http://svn.apache.org/viewvc?view=rev&rev=528617
Log:
contrib/benchmark: better error handling and javadocs around "exhaustive" doc making.
Modified:
lucene/java/trunk/contrib/benchmark/CHANGES.txt
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java
lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
Modified: lucene/java/trunk/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/CHANGES.txt?view=diff&rev=528617&r1=528616&r2=528617
==============================================================================
--- lucene/java/trunk/contrib/benchmark/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/benchmark/CHANGES.txt Fri Apr 13 12:30:03 2007
@@ -4,6 +4,10 @@
$Id:$
+4/13/07
+
+Better error handling and javadocs around "exhaustive" doc making.
+
3/25/07
LUCENE-849:
Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html?view=diff&rev=528617&r1=528616&r2=528617
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html (original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html Fri Apr 13 12:30:03 2007
@@ -212,11 +212,12 @@
<br>Example - <font color="#FF0066">{ AddDoc AddDoc } : 30</font> - would do
addDoc 60 times in a row.
<br><b>Exhaustive repeating</b>: use <font color="#FF0066">*</font> instead of
- a number to repeat forever.
+ a number to repeat exhaustively.
This is sometimes useful, for adding as many files as a doc maker can create,
- without iterating over the same files again, but in the case that the exact
- number of files is not known in advance. For insance, TREC files extracted
- from a zip file.
+ without iterating over the same file again, especially when the exact
+ number of documents is not known in advance. For insance, TREC files extracted
+ from a zip file. Note: when using this, you must also set
+ <font color="#FF0066">doc.maker.forever</font> to false.
<br>Example - <font color="#FF0066">{ AddDoc } : *</font> - would add docs
until the doc maker is "exhausted".
</li>
Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java?view=diff&rev=528617&r1=528616&r2=528617
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java (original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java Fri Apr 13 12:30:03 2007
@@ -67,8 +67,13 @@
*/
public void setRepetitions(int repetitions) throws Exception {
this.repetitions = repetitions;
- if (repetitions==REPEAT_EXHAUST && isParallel()) {
- throw new Exception("REPEAT_EXHAUST is not allowed for parallel tasks");
+ if (repetitions==REPEAT_EXHAUST) {
+ if (isParallel()) {
+ throw new Exception("REPEAT_EXHAUST is not allowed for parallel tasks");
+ }
+ if (getRunData().getConfig().get("doc.maker.forever",true)) {
+ throw new Exception("REPEAT_EXHAUST requires setting doc.maker.forever=false");
+ }
}
setSequenceName();
}
Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java?view=diff&rev=528617&r1=528616&r2=528617
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java (original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java Fri Apr 13 12:30:03 2007
@@ -195,9 +195,11 @@
public int newRound () {
roundNumber++;
+ StringBuffer sb = new StringBuffer("--> Round ").append(roundNumber-1).append("-->").append(roundNumber);
+
// log changes in values
if (valByRound.size()>0) {
- StringBuffer sb = new StringBuffer("--> Round ").append(roundNumber-1).append("-->").append(roundNumber).append(": ");
+ sb.append(": ");
for (Iterator iter = valByRound.keySet().iterator(); iter.hasNext();) {
String name = (String) iter.next();
Object a = valByRound.get(name);
@@ -213,10 +215,11 @@
sb.append(" ").append(name).append(":").append(ab[n1]).append("-->").append(ab[n2]);
}
}
- System.out.println();
- System.out.println(sb.toString());
- System.out.println();
}
+
+ System.out.println();
+ System.out.println(sb.toString());
+ System.out.println();
return roundNumber;
}