lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r833968 [3/10] - in /lucene/java/branches/flex_1458: ./ contrib/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/ contrib/analyzers/common/src/java/org/apache/...
Date Mon, 09 Nov 2009 04:02:02 GMT
Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java Mon Nov  9 04:01:50 2009
@@ -20,7 +20,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -39,9 +38,9 @@
  */
 class BiSegGraph {
 
-  private Map tokenPairListTable = new HashMap();
+  private Map<Integer,ArrayList<SegTokenPair>> tokenPairListTable = new HashMap<Integer,ArrayList<SegTokenPair>>();
 
-  private List segTokenList;
+  private List<SegToken> segTokenList;
 
   private static BigramDictionary bigramDict = BigramDictionary.getInstance();
 
@@ -65,15 +64,14 @@
     segTokenList = segGraph.makeIndex();
     // Because the beginning position of startToken is -1, therefore startToken can be obtained when key = -1
     int key = -1;
-    List nextTokens = null;
+    List<SegToken> nextTokens = null;
     while (key < maxStart) {
       if (segGraph.isStartExist(key)) {
 
-        List tokenList = segGraph.getStartList(key);
+        List<SegToken> tokenList = segGraph.getStartList(key);
 
         // Calculate all tokens for a given key.
-        for (Iterator iter = tokenList.iterator(); iter.hasNext();) {
-          SegToken t1 = (SegToken) iter.next();
+        for (SegToken t1 : tokenList) {
           oneWordFreq = t1.weight;
           next = t1.endOffset;
           nextTokens = null;
@@ -91,8 +89,7 @@
           if (nextTokens == null) {
             break;
           }
-          for (Iterator iter2 = nextTokens.iterator(); iter2.hasNext();) {
-            SegToken t2 = (SegToken) iter2.next();
+          for (SegToken t2 : nextTokens) {
             idBuffer = new char[t1.charArray.length + t2.charArray.length + 1];
             System.arraycopy(t1.charArray, 0, idBuffer, 0, t1.charArray.length);
             idBuffer[t1.charArray.length] = BigramDictionary.WORD_SEGMENT_CHAR;
@@ -139,8 +136,8 @@
    * @param to index of the second token in the token pair
    * @return {@link List} of token pairs.
    */
-  public List getToList(int to) {
-    return (List) tokenPairListTable.get(Integer.valueOf(to));
+  public List<SegTokenPair> getToList(int to) {
+    return tokenPairListTable.get(to);
   }
 
   /**
@@ -151,11 +148,11 @@
   public void addSegTokenPair(SegTokenPair tokenPair) {
     int to = tokenPair.to;
     if (!isToExist(to)) {
-      ArrayList newlist = new ArrayList();
+      ArrayList<SegTokenPair> newlist = new ArrayList<SegTokenPair>();
       newlist.add(tokenPair);
-      tokenPairListTable.put(Integer.valueOf(to), newlist);
+      tokenPairListTable.put(to, newlist);
     } else {
-      List tokenPairList = (List) tokenPairListTable.get(Integer.valueOf(to));
+      List<SegTokenPair> tokenPairList = tokenPairListTable.get(to);
       tokenPairList.add(tokenPair);
     }
   }
@@ -172,24 +169,23 @@
    * Find the shortest path with the Viterbi algorithm.
    * @return {@link List}
    */
-  public List getShortPath() {
+  public List<SegToken> getShortPath() {
     int current;
     int nodeCount = getToCount();
-    List path = new ArrayList();
+    List<PathNode> path = new ArrayList<PathNode>();
     PathNode zeroPath = new PathNode();
     zeroPath.weight = 0;
     zeroPath.preNode = 0;
     path.add(zeroPath);
     for (current = 1; current <= nodeCount; current++) {
       double weight;
-      List edges = getToList(current);
+      List<SegTokenPair> edges = getToList(current);
 
       double minWeight = Double.MAX_VALUE;
       SegTokenPair minEdge = null;
-      for (Iterator iter1 = edges.iterator(); iter1.hasNext();) {
-        SegTokenPair edge = (SegTokenPair) iter1.next();
+      for (SegTokenPair edge : edges) {
         weight = edge.weight;
-        PathNode preNode = (PathNode) path.get(edge.from);
+        PathNode preNode = path.get(edge.from);
         if (preNode.weight + weight < minWeight) {
           minWeight = preNode.weight + weight;
           minEdge = edge;
@@ -205,10 +201,10 @@
     int preNode, lastNode;
     lastNode = path.size() - 1;
     current = lastNode;
-    List rpath = new ArrayList();
-    List resultPath = new ArrayList();
+    List<Integer> rpath = new ArrayList<Integer>();
+    List<SegToken> resultPath = new ArrayList<SegToken>();
 
-    rpath.add(Integer.valueOf(current));
+    rpath.add(current);
     while (current != 0) {
       PathNode currentPathNode = (PathNode) path.get(current);
       preNode = currentPathNode.preNode;
@@ -218,20 +214,19 @@
     for (int j = rpath.size() - 1; j >= 0; j--) {
       Integer idInteger = (Integer) rpath.get(j);
       int id = idInteger.intValue();
-      SegToken t = (SegToken) segTokenList.get(id);
+      SegToken t = segTokenList.get(id);
       resultPath.add(t);
     }
     return resultPath;
 
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
-    Collection values = tokenPairListTable.values();
-    for (Iterator iter1 = values.iterator(); iter1.hasNext();) {
-      List segList = (List) iter1.next();
-      for (Iterator iter2 = segList.iterator(); iter2.hasNext();) {
-        SegTokenPair pair = (SegTokenPair) iter2.next();
+    Collection<ArrayList<SegTokenPair>>  values = tokenPairListTable.values();
+    for (ArrayList<SegTokenPair> segList : values) {
+      for (SegTokenPair pair : segList) {
         sb.append(pair + "\n");
       }
     }

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java Mon Nov  9 04:01:50 2009
@@ -22,7 +22,7 @@
 import org.apache.lucene.analysis.cn.smart.CharType;
 import org.apache.lucene.analysis.cn.smart.Utility;
 import org.apache.lucene.analysis.cn.smart.WordType;
-import org.apache.lucene.analysis.cn.smart.hhmm.PathNode;//javadoc @link
+import org.apache.lucene.analysis.cn.smart.hhmm.SegToken;//javadoc @link
 
 /**
  * Finds the optimal segmentation of a sentence into Chinese words
@@ -196,14 +196,14 @@
   }
 
   /**
-   * Return a list of {@link PathNode} representing the best segmentation of a sentence
+   * Return a list of {@link SegToken} representing the best segmentation of a sentence
    * @param sentence input sentence
    * @return best segmentation as a {@link List}
    */
-  public List process(String sentence) {
+  public List<SegToken> process(String sentence) {
     SegGraph segGraph = createSegGraph(sentence);
     BiSegGraph biSegGraph = new BiSegGraph(segGraph);
-    List shortPath = biSegGraph.getShortPath();
+    List<SegToken> shortPath = biSegGraph.getShortPath();
     return shortPath;
   }
 }

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java Mon Nov  9 04:01:50 2009
@@ -28,13 +28,12 @@
  * supported anymore in such a case.</font>
  * </p>
  */
-class PathNode implements Comparable {
+class PathNode implements Comparable<PathNode> {
   public double weight;
 
   public int preNode;
 
-  public int compareTo(Object p) {
-    PathNode pn = (PathNode) p;
+  public int compareTo(PathNode pn) {
     if (weight < pn.weight)
       return -1;
     else if (weight == pn.weight)
@@ -46,6 +45,7 @@
   /**
    * @see java.lang.Object#hashCode()
    */
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = 1;
@@ -59,6 +59,7 @@
   /**
    * @see java.lang.Object#equals(java.lang.Object)
    */
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java Mon Nov  9 04:01:50 2009
@@ -19,7 +19,6 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -39,7 +38,7 @@
   /**
    * Map of start offsets to ArrayList of tokens at that position
    */
-  private Map /* <Integer, ArrayList<SegToken>> */ tokenListTable = new HashMap();
+  private Map<Integer,ArrayList<SegToken>> tokenListTable = new HashMap<Integer,ArrayList<SegToken>>();
 
   private int maxStart = -1;
 
@@ -50,7 +49,7 @@
    * @return true if there are tokens for the startOffset
    */
   public boolean isStartExist(int s) {
-    return tokenListTable.get(Integer.valueOf(s)) != null;
+    return tokenListTable.get(s) != null;
   }
 
   /**
@@ -59,8 +58,8 @@
    * @param s startOffset
    * @return List of tokens at the specified start offset.
    */
-  public List getStartList(int s) {
-    return (List) tokenListTable.get(Integer.valueOf(s));
+  public List<SegToken> getStartList(int s) {
+    return tokenListTable.get(s);
   }
 
   /**
@@ -76,16 +75,15 @@
    * Set the {@link SegToken#index} for each token, based upon its order by startOffset. 
    * @return a {@link List} of these ordered tokens.
    */
-  public List makeIndex() {
-    List result = new ArrayList();
+  public List<SegToken> makeIndex() {
+    List<SegToken> result = new ArrayList<SegToken>();
     int s = -1, count = 0, size = tokenListTable.size();
-    List tokenList;
+    List<SegToken> tokenList;
     short index = 0;
     while (count < size) {
       if (isStartExist(s)) {
-        tokenList = (List) tokenListTable.get(Integer.valueOf(s));
-        for (Iterator iter = tokenList.iterator(); iter.hasNext();) {
-          SegToken st = (SegToken) iter.next();
+        tokenList = tokenListTable.get(s);
+        for (SegToken st : tokenList) {
           st.index = index;
           result.add(st);
           index++;
@@ -104,11 +102,11 @@
   public void addToken(SegToken token) {
     int s = token.startOffset;
     if (!isStartExist(s)) {
-      ArrayList newlist = new ArrayList();
+      ArrayList<SegToken> newlist = new ArrayList<SegToken>();
       newlist.add(token);
-      tokenListTable.put((Object) (Integer.valueOf(s)), newlist);
+      tokenListTable.put(s, newlist);
     } else {
-      List tokenList = (List) tokenListTable.get((Object) (Integer.valueOf(s)));
+      List<SegToken> tokenList = tokenListTable.get(s);
       tokenList.add(token);
     }
     if (s > maxStart)
@@ -120,16 +118,15 @@
    * 
    * @return {@link List} of all tokens in the map.
    */
-  public List toTokenList() {
-    List result = new ArrayList();
+  public List<SegToken> toTokenList() {
+    List<SegToken> result = new ArrayList<SegToken>();
     int s = -1, count = 0, size = tokenListTable.size();
-    List tokenList;
+    List<SegToken> tokenList;
 
     while (count < size) {
       if (isStartExist(s)) {
-        tokenList = (List) tokenListTable.get(Integer.valueOf(s));
-        for (Iterator iter = tokenList.iterator(); iter.hasNext();) {
-          SegToken st = (SegToken) iter.next();
+        tokenList = tokenListTable.get(s);
+        for (SegToken st : tokenList) {
           result.add(st);
         }
         count++;
@@ -139,11 +136,11 @@
     return result;
   }
 
+  @Override
   public String toString() {
-    List tokenList = this.toTokenList();
+    List<SegToken> tokenList = this.toTokenList();
     StringBuilder sb = new StringBuilder();
-    for (Iterator iter = tokenList.iterator(); iter.hasNext();) {
-      SegToken t = (SegToken) iter.next();
+    for (SegToken t : tokenList) {
       sb.append(t + "\n");
     }
     return sb.toString();

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java Mon Nov  9 04:01:50 2009
@@ -36,12 +36,12 @@
   public char[] charArray;
 
   /**
-   * start offset into {@link #charArray}
+   * start offset into original sentence
    */
   public int startOffset;
 
   /**
-   * end offset into {@link #charArray}
+   * end offset into original sentence
    */
   public int endOffset;
 
@@ -64,8 +64,8 @@
    * Create a new SegToken from a character array.
    * 
    * @param idArray character array containing text
-   * @param start start offset into idArray
-   * @param end end offset of idArray
+   * @param start start offset of SegToken in original sentence
+   * @param end end offset of SegToken in original sentence
    * @param wordType {@link WordType} of the text
    * @param weight word frequency
    */
@@ -80,6 +80,7 @@
   /**
    * @see java.lang.Object#hashCode()
    */
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = 1;
@@ -97,6 +98,7 @@
   /**
    * @see java.lang.Object#equals(java.lang.Object)
    */
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java Mon Nov  9 04:01:50 2009
@@ -53,6 +53,7 @@
   /**
    * @see java.lang.Object#hashCode()
    */
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = 1;
@@ -70,6 +71,7 @@
   /**
    * @see java.lang.Object#equals(java.lang.Object)
    */
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java (original)
+++ lucene/java/branches/flex_1458/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java Mon Nov  9 04:01:50 2009
@@ -80,6 +80,20 @@
     }
   }
   
+  /*
+   * Check that position increments after stopwords are correct,
+   * when stopfilter is configured with enablePositionIncrements
+   */
+  public void testChineseStopWords2() throws Exception {
+    Analyzer ca = new SmartChineseAnalyzer(Version.LUCENE_CURRENT); /* will load stopwords */
+    String sentence = "Title:San"; // : is a stopword
+    String result[] = { "titl", "san"};
+    int startOffsets[] = { 0, 6 };
+    int endOffsets[] = { 5, 9 };
+    int posIncr[] = { 1, 2 };
+    assertAnalyzesTo(ca, sentence, result, startOffsets, endOffsets, posIncr);
+  }
+  
   public void testChineseAnalyzer() throws Exception {
     Analyzer ca = new SmartChineseAnalyzer(Version.LUCENE_CURRENT, true);
     String sentence = "我购买了道具和服装。";

Modified: lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/DocumentHandlerException.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/DocumentHandlerException.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/DocumentHandlerException.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/DocumentHandlerException.java Mon Nov  9 04:01:50 2009
@@ -53,10 +53,12 @@
         return cause;
     }
 
+    @Override
     public void printStackTrace() {
         printStackTrace(System.err);
     }
 
+    @Override
     public void printStackTrace(PrintStream ps) {
         synchronized (ps) {
             super.printStackTrace(ps);
@@ -67,6 +69,7 @@
         }
     }
 
+    @Override
     public void printStackTrace(PrintWriter pw) {
         synchronized (pw) {
             super.printStackTrace(pw);

Modified: lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java Mon Nov  9 04:01:50 2009
@@ -220,6 +220,7 @@
    *@exception  BuildException  If an error occurs indexing the
    *      fileset
    */
+  @Override
   public void execute() throws BuildException {
 
     // construct handler and analyzer dynamically
@@ -426,6 +427,7 @@
     /**
      * @see EnumeratedAttribute#getValues
      */
+    @Override
     public String[] getValues() {
       Set keys = analyzerLookup.keySet();
       return (String[]) keys.toArray(new String[0]);

Modified: lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/HtmlDocumentTest.java Mon Nov  9 04:01:50 2009
@@ -30,6 +30,7 @@
     
     HtmlDocument doc;
     
+    @Override
     public void setUp() throws IOException {
         doc = new HtmlDocument(getFile("test.html"));
     }
@@ -39,6 +40,7 @@
         assertTrue("Body", doc.getBody().startsWith("This is some test"));
     }
     
+    @Override
     public void tearDown() {
         doc = null;
     }

Modified: lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java Mon Nov  9 04:01:50 2009
@@ -54,6 +54,7 @@
      *
      *@exception  IOException  Description of Exception
      */
+    @Override
     public void setUp() throws Exception {
         Project project = new Project();
 
@@ -86,6 +87,7 @@
      *  The teardown method for JUnit
      * TODO: remove indexDir?
      */
+    @Override
     public void tearDown() throws IOException {
         searcher.close();
         dir.close();

Modified: lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java (original)
+++ lucene/java/branches/flex_1458/contrib/ant/src/test/org/apache/lucene/ant/TextDocumentTest.java Mon Nov  9 04:01:50 2009
@@ -30,6 +30,7 @@
     
     TextDocument doc;
     
+    @Override
     public void setUp() throws IOException {
         doc = new TextDocument(getFile("test.txt"));
     }
@@ -38,6 +39,7 @@
         assertEquals("Contents", "Test Contents", doc.getContents());
     }
     
+    @Override
     public void tearDown() {
         doc = null;
     }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt Mon Nov  9 04:01:50 2009
@@ -4,6 +4,22 @@
 
 $Id:$
 
+11/08/2009
+  LUCENE-2044: Added delete.percent.rand.seed to seed the Random instance
+  used by DeleteByPercentTask.  (Mike McCandless)
+
+11/07/2009
+  LUCENE-2043: Fix CommitIndexTask to also commit pending IndexReader
+  changes (Mike McCandless)
+
+11/07/2009
+  LUCENE-2042: Added print.hits.field, to print each hit from the
+  Search* tasks.  (Mike McCandless)
+
+11/04/2009
+  LUCENE-2029: Added doc.body.stored and doc.body.tokenized; each
+  falls back to the non-body variant as its default.  (Mike McCandless)
+
 10/28/2009
   LUCENE-1994: Fix thread safety of EnwikiContentSource and DocMaker
   when doc.reuse.fields is false.  Also made docs.reuse.fields=true

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DirContentSource.java Mon Nov  9 04:01:50 2009
@@ -174,10 +174,12 @@
     return dfi.df.parse(dateStr.trim(), dfi.pos);
   }
 
+  @Override
   public void close() throws IOException {
     inputFiles = null;
   }
   
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
     File f = null;
     String name = null;
@@ -219,12 +221,14 @@
     return docData;
   }
   
+  @Override
   public synchronized void resetInputs() throws IOException {
     super.resetInputs();
     inputFiles = new Iterator(dataDir);
     iteration = 0;
   }
 
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java Mon Nov  9 04:01:50 2009
@@ -40,8 +40,12 @@
  * (default <b>SingleDocSource</b>).
  * <li><b>doc.stored</b> - specifies whether fields should be stored (default
  * <b>false</b>).
+ * <li><b>doc.body.stored</b> - specifies whether the body field should be stored (default
+ * = <b>doc.stored</b>).
  * <li><b>doc.tokenized</b> - specifies whether fields should be tokenized
  * (default <b>true</b>).
+ * <li><b>doc.body.tokenized</b> - specifies whether the
+ * body field should be tokenized (default = <b>doc.tokenized</b>).
  * <li><b>doc.tokenized.norms</b> - specifies whether norms should be stored in
  * the index or not. (default <b>false</b>).
  * <li><b>doc.body.tokenized.norms</b> - specifies whether norms should be
@@ -82,7 +86,7 @@
     final Document doc;
     DocData docData = new DocData();
     
-    public DocState(boolean reuseFields, Store store, Index index, Index bodyIndex, TermVector termVector) {
+    public DocState(boolean reuseFields, Store store, Store bodyStore, Index index, Index bodyIndex, TermVector termVector) {
 
       this.reuseFields = reuseFields;
       
@@ -90,7 +94,7 @@
         fields =  new HashMap<String,Field>();
         
         // Initialize the map with the default fields.
-        fields.put(BODY_FIELD, new Field(BODY_FIELD, "", store, bodyIndex, termVector));
+        fields.put(BODY_FIELD, new Field(BODY_FIELD, "", bodyStore, bodyIndex, termVector));
         fields.put(TITLE_FIELD, new Field(TITLE_FIELD, "", store, index, termVector));
         fields.put(DATE_FIELD, new Field(DATE_FIELD, "", store, index, termVector));
         fields.put(ID_FIELD, new Field(ID_FIELD, "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
@@ -139,6 +143,7 @@
   protected Config config;
 
   protected Store storeVal = Store.NO;
+  protected Store bodyStoreVal = Store.NO;
   protected Index indexVal = Index.ANALYZED_NO_NORMS;
   protected Index bodyIndexVal = Index.ANALYZED;
   protected TermVector termVecVal = TermVector.NO;
@@ -207,7 +212,7 @@
         bdy = body.substring(0, size); // use part
         docData.setBody(body.substring(size)); // some left
       }
-      Field bodyField = ds.getField(BODY_FIELD, storeVal, bodyIndexVal, termVecVal);
+      Field bodyField = ds.getField(BODY_FIELD, bodyStoreVal, bodyIndexVal, termVecVal);
       bodyField.setValue(bdy);
       doc.add(bodyField);
       
@@ -241,7 +246,7 @@
   protected DocState getDocState() {
     DocState ds = docState.get();
     if (ds == null) {
-      ds = new DocState(reuseFields, storeVal, indexVal, bodyIndexVal, termVecVal);
+      ds = new DocState(reuseFields, storeVal, bodyStoreVal, indexVal, bodyIndexVal, termVecVal);
       docState.set(ds);
     }
     return ds;
@@ -375,18 +380,26 @@
     }
 
     boolean stored = config.get("doc.stored", false);
+    boolean bodyStored = config.get("doc.body.stored", stored);
     boolean tokenized = config.get("doc.tokenized", true);
+    boolean bodyTokenized = config.get("doc.body.tokenized", tokenized);
     boolean norms = config.get("doc.tokenized.norms", false);
     boolean bodyNorms = config.get("doc.body.tokenized.norms", true);
     boolean termVec = config.get("doc.term.vector", false);
     storeVal = (stored ? Field.Store.YES : Field.Store.NO);
+    bodyStoreVal = (bodyStored ? Field.Store.YES : Field.Store.NO);
     if (tokenized) {
       indexVal = norms ? Index.ANALYZED : Index.ANALYZED_NO_NORMS;
-      bodyIndexVal = bodyNorms ? Index.ANALYZED : Index.ANALYZED_NO_NORMS;
     } else {
       indexVal = norms ? Index.NOT_ANALYZED : Index.NOT_ANALYZED_NO_NORMS;
+    }
+
+    if (bodyTokenized) {
+      bodyIndexVal = bodyNorms ? Index.ANALYZED : Index.ANALYZED_NO_NORMS;
+    } else {
       bodyIndexVal = bodyNorms ? Index.NOT_ANALYZED : Index.NOT_ANALYZED_NO_NORMS;
     }
+
     boolean termVecPositions = config.get("doc.term.vector.positions", false);
     boolean termVecOffsets = config.get("doc.term.vector.offsets", false);
     if (termVecPositions && termVecOffsets) {

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java Mon Nov  9 04:01:50 2009
@@ -103,10 +103,12 @@
       return buffer.toString();
     }
     
+    @Override
     public void characters(char[] ch, int start, int length) {
       contents.append(ch, start, length);
     }
 
+    @Override
     public void endElement(String namespace, String simple, String qualified)
       throws SAXException {
       int elemType = getElementType(qualified);
@@ -197,6 +199,7 @@
       }
     }
 
+    @Override
     public void startElement(String namespace, String simple, String qualified,
                              Attributes attributes) {
       int elemType = getElementType(qualified);
@@ -257,6 +260,7 @@
   private InputStream is;
   private Parser parser = new Parser();
   
+  @Override
   public void close() throws IOException {
     synchronized (EnwikiContentSource.this) {
       if (is != null) {
@@ -266,6 +270,7 @@
     }
   }
   
+  @Override
   public synchronized DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
     String[] tuple = parser.next();
     docData.clear();
@@ -276,11 +281,13 @@
     return docData;
   }
 
+  @Override
   public void resetInputs() throws IOException {
     super.resetInputs();
     is = getInputStream(file);
   }
   
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     keepImages = config.get("keep.image.only.docs", true);

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java Mon Nov  9 04:01:50 2009
@@ -26,6 +26,7 @@
  * @deprecated Please use {@link DocMaker} instead, with content.source=EnwikiContentSource
  */
 public class EnwikiDocMaker extends DocMaker {
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     // Override whatever content source was set in the config

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java Mon Nov  9 04:01:50 2009
@@ -122,6 +122,7 @@
     return queries.toArray(new Query[0]);
   }
 
+  @Override
   protected Query[] prepareQueries() throws Exception {
     // analyzer (default is standard analyzer)
     Analyzer anlzr = NewAnalyzerTask.createAnalyzer(config.get("analyzer", StandardAnalyzer.class.getName()));

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java Mon Nov  9 04:01:50 2009
@@ -44,6 +44,7 @@
 public class FileBasedQueryMaker extends AbstractQueryMaker implements QueryMaker{
 
 
+  @Override
   protected Query[] prepareQueries() throws Exception {
 
     Analyzer anlzr = NewAnalyzerTask.createAnalyzer(config.get("analyzer",

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java Mon Nov  9 04:01:50 2009
@@ -39,6 +39,7 @@
  * @deprecated Please use {@link DocMaker} instead, with content.source=LineDocSource
  */
 public class LineDocMaker extends DocMaker {
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     source = new LineDocSource();

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocSource.java Mon Nov  9 04:01:50 2009
@@ -61,6 +61,7 @@
     }
   }
 
+  @Override
   public void close() throws IOException {
     if (reader != null) {
       reader.close();
@@ -68,6 +69,7 @@
     }
   }
   
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
     String line;
     synchronized(this) {
@@ -100,11 +102,13 @@
     return docData;
   }
 
+  @Override
   public void resetInputs() throws IOException {
     super.resetInputs();
     openFile();
   }
   
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     String fileName = config.get("docs.file", null);

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersContentSource.java Mon Nov  9 04:01:50 2009
@@ -53,6 +53,7 @@
   private int nextFile = 0;
   private int iteration = 0;
   
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     File workDir = new File(config.get("work.dir", "work"));
@@ -89,10 +90,12 @@
   }
 
 
+  @Override
   public void close() throws IOException {
     // TODO implement?
   }
   
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
     File f = null;
     String name = null;
@@ -138,6 +141,7 @@
     }
   }
 
+  @Override
   public synchronized void resetInputs() throws IOException {
     super.resetInputs();
     nextFile = 0;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ReutersQueryMaker.java Mon Nov  9 04:01:50 2009
@@ -102,6 +102,7 @@
     return queries.toArray(new Query[0]);
   }
   
+  @Override
   protected Query[] prepareQueries() throws Exception {
     // analyzer (default is standard analyzer)
     Analyzer anlzr= NewAnalyzerTask.createAnalyzer(config.get("analyzer",

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleQueryMaker.java Mon Nov  9 04:01:50 2009
@@ -42,6 +42,7 @@
    * @return prepared queries.
    * @throws Exception if cannot prepare the queries.
    */
+  @Override
   protected Query[] prepareQueries() throws Exception {
     // analyzer (default is standard analyzer)
     Analyzer anlzr= NewAnalyzerTask.createAnalyzer(config.get("analyzer",

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleSloppyPhraseQueryMaker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleSloppyPhraseQueryMaker.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleSloppyPhraseQueryMaker.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SimpleSloppyPhraseQueryMaker.java Mon Nov  9 04:01:50 2009
@@ -32,6 +32,7 @@
   /* (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.feeds.SimpleQueryMaker#prepareQueries()
    */
+  @Override
   protected Query[] prepareQueries() throws Exception {
     // extract some 100 words from doc text to an array
     String words[];

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SingleDocSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SingleDocSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SingleDocSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SingleDocSource.java Mon Nov  9 04:01:50 2009
@@ -50,8 +50,10 @@
     return docID++;
   }
 
+  @Override
   public void close() throws IOException {}
   
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException {
     int id = newdocid();
     addBytes(DOC_TEXT.length());
@@ -61,6 +63,7 @@
     return docData;
   }
 
+  @Override
   public synchronized void resetInputs() throws IOException {
     super.resetInputs();
     docID = 0;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SortableSingleDocSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SortableSingleDocSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SortableSingleDocSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/SortableSingleDocSource.java Mon Nov  9 04:01:50 2009
@@ -78,6 +78,7 @@
   private int sortRange;
   private Random r;
 
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException {
     docData = super.getNextDocData(docData);
     Properties props = new Properties();
@@ -103,6 +104,7 @@
     return start + r.nextInt(end - start);
   }
 
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     sortRange = config.get("sort.rng", 20000);

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecContentSource.java Mon Nov  9 04:01:50 2009
@@ -216,6 +216,7 @@
     return null; 
   }
   
+  @Override
   public void close() throws IOException {
     if (reader == null) {
       return;
@@ -232,6 +233,7 @@
     reader = null;
   }
 
+  @Override
   public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
     String dateStr = null, name = null;
     Reader r = null;
@@ -306,6 +308,7 @@
     return docData;
   }
 
+  @Override
   public void resetInputs() throws IOException {
     synchronized (lock) {
       super.resetInputs();
@@ -315,6 +318,7 @@
     }
   }
 
+  @Override
   public void setConfig(Config config) {
     super.setConfig(config);
     File workDir = new File(config.get("work.dir", "work"));

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/stats/TaskStats.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/stats/TaskStats.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/stats/TaskStats.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/stats/TaskStats.java Mon Nov  9 04:01:50 2009
@@ -102,6 +102,7 @@
   /* (non-Javadoc)
    * @see java.lang.Object#toString()
    */
+  @Override
   public String toString() {
     StringBuffer res = new StringBuffer(task.getName());
     res.append(" ");
@@ -178,6 +179,7 @@
   /* (non-Javadoc)
    * @see java.lang.Object#clone()
    */
+  @Override
   public Object clone() throws CloneNotSupportedException {
     return super.clone();
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/AddDocTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/AddDocTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/AddDocTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/AddDocTask.java Mon Nov  9 04:01:50 2009
@@ -37,6 +37,7 @@
   // volatile data passed between setup(), doLogic(), tearDown().
   private Document doc = null;
   
+  @Override
   public void setup() throws Exception {
     super.setup();
     DocMaker docMaker = getRunData().getDocMaker();
@@ -47,15 +48,18 @@
     }
   }
 
+  @Override
   public void tearDown() throws Exception {
     doc = null;
     super.tearDown();
   }
 
+  @Override
   protected String getLogMessage(int recsCount) {
     return "added " + recsCount + " docs";
   }
   
+  @Override
   public int doLogic() throws Exception {
     getRunData().getIndexWriter().addDocument(doc);
     return 1;
@@ -65,6 +69,7 @@
    * Set the params (docSize only)
    * @param params docSize, or 0 for no limit.
    */
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     docSize = (int) Float.parseFloat(params); 
@@ -73,6 +78,7 @@
   /* (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#supportsParams()
    */
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ClearStatsTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ClearStatsTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ClearStatsTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ClearStatsTask.java Mon Nov  9 04:01:50 2009
@@ -29,6 +29,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     getRunData().getPoints().clearData();
     return 0;
@@ -37,6 +38,7 @@
   /* (non-Javadoc)
    * @see PerfTask#shouldNotRecordStats()
    */
+  @Override
   protected boolean shouldNotRecordStats() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseIndexTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseIndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseIndexTask.java Mon Nov  9 04:01:50 2009
@@ -36,6 +36,7 @@
 
   boolean doWait = true;
 
+  @Override
   public int doLogic() throws IOException {
     IndexWriter iw = getRunData().getIndexWriter();
     if (iw != null) {
@@ -51,11 +52,13 @@
     return 1;
   }
 
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     doWait = Boolean.valueOf(params).booleanValue();
   }
 
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CloseReaderTask.java Mon Nov  9 04:01:50 2009
@@ -33,6 +33,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws IOException {
     IndexReader reader= getRunData().getIndexReader();
     if (reader!=null) {

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java Mon Nov  9 04:01:50 2009
@@ -21,34 +21,41 @@
 
 import org.apache.lucene.benchmark.byTask.PerfRunData;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexReader;
 
 /**
  * Commits the IndexWriter.
  *
  */
 public class CommitIndexTask extends PerfTask {
-  String commitUserData = null;
-  
+  Map<String,String> commitUserData;
+
   public CommitIndexTask(PerfRunData runData) {
     super(runData);
   }
   
+  @Override
   public boolean supportsParams() {
     return true;
   }
   
+  @Override
   public void setParams(String params) {
-    commitUserData = params;
+    commitUserData = new HashMap<String,String>();
+    commitUserData.put(OpenReaderTask.USER_DATA, params);
   }
   
+  @Override
   public int doLogic() throws Exception {
     IndexWriter iw = getRunData().getIndexWriter();
     if (iw != null) {
-      if (commitUserData == null) iw.commit();
-      else {
-        Map<String,String> map = new HashMap<String,String>();
-        map.put(OpenReaderTask.USER_DATA, commitUserData);
-        iw.commit(map);
+      iw.commit(commitUserData);
+    } else {
+      IndexReader r = getRunData().getIndexReader();
+      if (r != null) {
+        r.commit(commitUserData);
+      } else {
+        throw new IllegalStateException("neither IndexWriter nor IndexReader is currently open");
       }
     }
     

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ConsumeContentSourceTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ConsumeContentSourceTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ConsumeContentSourceTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ConsumeContentSourceTask.java Mon Nov  9 04:01:50 2009
@@ -50,15 +50,18 @@
     }
   }
 
+  @Override
   protected String getLogMessage(int recsCount) {
     return "read " + recsCount + " documents from the content source";
   }
   
+  @Override
   public void close() throws Exception {
     source.close();
     super.close();
   }
 
+  @Override
   public int doLogic() throws Exception {
     dd = source.getNextDocData(dd);
     return 1;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java Mon Nov  9 04:01:50 2009
@@ -122,6 +122,7 @@
     return indexDeletionPolicy;
   }
   
+  @Override
   public int doLogic() throws IOException {
     PerfRunData runData = getRunData();
     Config config = runData.getConfig();

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java Mon Nov  9 04:01:50 2009
@@ -32,29 +32,40 @@
  * <p><b>NOTE</b>: the param is an absolute percentage of
  * maxDoc().  This means if you delete 50%, and then delete
  * 50% again, the 2nd delete will do nothing.
+ *
+ * <p> Parameters:
+ * <ul>
+ * <li> delete.percent.rand.seed - defines the seed to
+ * initialize Random (default 1717)
+ * </ul>
  */
 public class DeleteByPercentTask extends PerfTask {
   double percent;
   int numDeleted = 0;
-  Random random = new Random(System.currentTimeMillis());
+  final Random random;
 
   public DeleteByPercentTask(PerfRunData runData) {
     super(runData);
+    random = new Random(runData.getConfig().get("delete.percent.rand.seed", 1717));
   }
   
+  @Override
   public void setup() throws Exception {
     super.setup();
   }
 
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     percent = Double.parseDouble(params)/100;
   }
 
+  @Override
   public boolean supportsParams() {
     return true;
   }
 
+  @Override
   public int doLogic() throws Exception {
     IndexReader r = getRunData().getIndexReader();
     int maxDoc = r.maxDoc();

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteDocTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteDocTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteDocTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteDocTask.java Mon Nov  9 04:01:50 2009
@@ -40,6 +40,7 @@
   private int docid = -1;
   private boolean byStep = true;
   
+  @Override
   public int doLogic() throws Exception {
     getRunData().getIndexReader().deleteDocument(docid);
     lastDeleted = docid;
@@ -49,6 +50,7 @@
   /* (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#setup()
    */
+  @Override
   public void setup() throws Exception {
     super.setup();
     if (deleteStep<0) {
@@ -58,6 +60,7 @@
     docid = (byStep ? lastDeleted + deleteStep : docid);
   }
 
+  @Override
   protected String getLogMessage(int recsCount) {
     return "deleted " + recsCount + " docs, last deleted: " + lastDeleted;
   }
@@ -66,6 +69,7 @@
    * Set the params (docid only)
    * @param params docid to delete, or -1 for deleting by delete gap settings.
    */
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     docid = (int) Float.parseFloat(params);
@@ -75,6 +79,7 @@
   /* (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#supportsParams()
    */
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java Mon Nov  9 04:01:50 2009
@@ -31,15 +31,18 @@
     super(runData);
   }
   
+  @Override
   public boolean supportsParams() {
     return true;
   }
   
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     userData = params;
   }
   
+  @Override
   public int doLogic() throws IOException {
     IndexReader reader = getRunData().getIndexReader();
     if (userData != null) {

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NearRealtimeReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NearRealtimeReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NearRealtimeReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NearRealtimeReaderTask.java Mon Nov  9 04:01:50 2009
@@ -59,6 +59,7 @@
       setDaemon(true);
     }
 
+    @Override
     public void run() {
 
       IndexReader reader = null;
@@ -106,6 +107,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws IOException {
     if (t == null) {
       IndexWriter w = getRunData().getIndexWriter();
@@ -115,16 +117,19 @@
     return 1;
   }
 
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     pauseSec = Float.parseFloat(params);
   }
 
+  @Override
   public boolean supportsParams() {
     return true;
   }
 
   // Close the thread
+  @Override
   public void close() throws InterruptedException {
     if (t != null) {
       t.done = true;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java Mon Nov  9 04:01:50 2009
@@ -50,6 +50,7 @@
     }
   }
 
+  @Override
   public int doLogic() throws IOException {
     String className = null;
     try {
@@ -81,6 +82,7 @@
    * Example Declaration: {"NewAnalyzer" NewAnalyzer(WhitespaceAnalyzer, SimpleAnalyzer, StopAnalyzer, standard.StandardAnalyzer) >
    * @param params analyzerClassName, or empty for the StandardAnalyzer
    */
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     for (StringTokenizer tokenizer = new StringTokenizer(params, ","); tokenizer.hasMoreTokens();) {
@@ -92,6 +94,7 @@
   /* (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#supportsParams()
    */
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewRoundTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewRoundTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewRoundTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewRoundTask.java Mon Nov  9 04:01:50 2009
@@ -30,6 +30,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     getRunData().getConfig().newRound();
     return 0;
@@ -38,6 +39,7 @@
   /* (non-Javadoc)
    * @see PerfTask#shouldNotRecordStats()
    */
+  @Override
   protected boolean shouldNotRecordStats() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java Mon Nov  9 04:01:50 2009
@@ -42,6 +42,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws IOException {
     PerfRunData runData = getRunData();
     Config config = runData.getConfig();

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenReaderTask.java Mon Nov  9 04:01:50 2009
@@ -42,6 +42,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws IOException {
     Directory dir = getRunData().getDirectory();
     Config config = getRunData().getConfig();
@@ -75,6 +76,7 @@
     return r;
   }
   
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     if (params != null) {
@@ -88,6 +90,7 @@
     }
   }
 
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OptimizeTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OptimizeTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OptimizeTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OptimizeTask.java Mon Nov  9 04:01:50 2009
@@ -32,6 +32,7 @@
 
   int maxNumSegments = 1;
 
+  @Override
   public int doLogic() throws Exception {
     IndexWriter iw = getRunData().getIndexWriter();
     iw.optimize(maxNumSegments);
@@ -39,11 +40,13 @@
     return 1;
   }
 
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     maxNumSegments = Double.valueOf(params).intValue();
   }
 
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java Mon Nov  9 04:01:50 2009
@@ -117,6 +117,7 @@
     checkObsoleteSettings(config);
   }
   
+  @Override
   protected Object clone() throws CloneNotSupportedException {
     // tasks having non primitive data structures should override this.
     // otherwise parallel running of a task sequence might not run correctly. 
@@ -208,6 +209,7 @@
   /* (non-Javadoc)
    * @see java.lang.Object#toString()
    */
+  @Override
   public String toString() {
     String padd = getPadding();
     StringBuffer sb = new StringBuffer(padd);

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PrintReaderTask.java Mon Nov  9 04:01:50 2009
@@ -29,15 +29,18 @@
     super(runData);
   }
   
+  @Override
   public void setParams(String params) {
     super.setParams(params);
     userData = params;
   }
   
+  @Override
   public boolean supportsParams() {
     return true;
   }
   
+  @Override
   public int doLogic() throws Exception {
     Directory dir = getRunData().getDirectory();
     Config config = getRunData().getConfig();

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java Mon Nov  9 04:01:50 2009
@@ -32,6 +32,7 @@
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.MultiTermQuery;
 import org.apache.lucene.search.TopFieldCollector;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.IndexSearcher;
@@ -51,7 +52,10 @@
  * Otherwise a reader is opened at start and closed at the end.
  * <p>
  * The <code>search.num.hits</code> config parameter sets
- * the top number of hits to collect during searching.
+ * the top number of hits to collect during searching.  If
+ * <code>print.hits.field</code> is set, then each hit is
+ * printed along with the value of that field.</p>
+ *
  * <p>Other side effects: none.
  */
 public abstract class ReadTask extends PerfTask {
@@ -59,6 +63,7 @@
   public ReadTask(PerfRunData runData) {
     super(runData);
   }
+  @Override
   public int doLogic() throws Exception {
     int res = 0;
     boolean closeReader = false;
@@ -107,6 +112,23 @@
         } else {
           hits = searcher.search(q, numHits);
         }
+
+        final String printHitsField = getRunData().getConfig().get("print.hits.field", null);
+        if (printHitsField != null && printHitsField.length() > 0) {
+          final IndexReader r = searcher.getIndexReader();
+          if (q instanceof MultiTermQuery) {
+            System.out.println("MultiTermQuery term count = " + ((MultiTermQuery) q).getTotalNumberOfTerms());
+          }
+          System.out.println("totalHits = " + hits.totalHits);
+          System.out.println("maxDoc()  = " + r.maxDoc());
+          System.out.println("numDocs() = " + r.numDocs());
+          for(int i=0;i<hits.scoreDocs.length;i++) {
+            final int docID = hits.scoreDocs[i].doc;
+            final Document doc = r.document(docID);
+            System.out.println("  " + i + ": doc=" + docID + " score=" + hits.scoreDocs[i].score + " " + printHitsField + " =" + doc.get(printHitsField));
+          }
+        }
+
         //System.out.println("q=" + q + ":" + hits.totalHits + " total hits"); 
 
         if (withTraverse()) {
@@ -203,6 +225,7 @@
   static final int DEFAULT_SEARCH_NUM_HITS = 10;
   private int numHits;
 
+  @Override
   public void setup() throws Exception {
     super.setup();
     numHits = getRunData().getConfig().get("search.num.hits", DEFAULT_SEARCH_NUM_HITS);

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTokensTask.java Mon Nov  9 04:01:50 2009
@@ -43,21 +43,25 @@
   // volatile data passed between setup(), doLogic(), tearDown().
   private Document doc = null;
   
+  @Override
   public void setup() throws Exception {
     super.setup();
     DocMaker docMaker = getRunData().getDocMaker();
     doc = docMaker.makeDocument();
   }
 
+  @Override
   protected String getLogMessage(int recsCount) {
     return "read " + recsCount + " docs; " + totalTokenCount + " tokens";
   }
   
+  @Override
   public void tearDown() throws Exception {
     doc = null;
     super.tearDown();
   }
 
+  @Override
   public int doLogic() throws Exception {
     List<Fieldable> fields = doc.getFields();
     Analyzer analyzer = getRunData().getAnalyzer();
@@ -112,9 +116,11 @@
       left = s.length();
       this.upto = 0;
     }
+    @Override
     public int read(char[] c) {
       return read(c, 0, c.length);
     }
+    @Override
     public int read(char[] c, int off, int len) {
       if (left > len) {
         s.getChars(upto, upto+len, c, off);
@@ -131,6 +137,7 @@
         return r;
       }
     }
+    @Override
     public void close() {};
   }
 }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReopenReaderTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReopenReaderTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReopenReaderTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReopenReaderTask.java Mon Nov  9 04:01:50 2009
@@ -31,6 +31,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws IOException {
     IndexReader ir = getRunData().getIndexReader();
     IndexReader or = ir;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepAllTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepAllTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepAllTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepAllTask.java Mon Nov  9 04:01:50 2009
@@ -33,6 +33,7 @@
     super(runData);
    }
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportAll(getRunData().getPoints().taskStats());
     

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSelectByPrefTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSelectByPrefTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSelectByPrefTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSelectByPrefTask.java Mon Nov  9 04:01:50 2009
@@ -33,6 +33,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportSelectByPrefix(getRunData().getPoints().taskStats());
     

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameRoundTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameRoundTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameRoundTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameRoundTask.java Mon Nov  9 04:01:50 2009
@@ -34,6 +34,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportSumByNameRound(getRunData().getPoints().taskStats());
 

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByNameTask.java Mon Nov  9 04:01:50 2009
@@ -34,6 +34,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportSumByName(getRunData().getPoints().taskStats());
 

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefRoundTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefRoundTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefRoundTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefRoundTask.java Mon Nov  9 04:01:50 2009
@@ -34,6 +34,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportSumByPrefixRound(getRunData().getPoints().taskStats());
     

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/RepSumByPrefTask.java Mon Nov  9 04:01:50 2009
@@ -36,6 +36,7 @@
 
   protected String prefix;
 
+  @Override
   public int doLogic() throws Exception {
     Report rp = reportSumByPrefix(getRunData().getPoints().taskStats());
     
@@ -81,6 +82,7 @@
   /* (non-Javadoc)
    * @see PerfTask#toString()
    */
+  @Override
   public String toString() {
     return super.toString()+" "+prefix;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReportTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReportTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReportTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReportTask.java Mon Nov  9 04:01:50 2009
@@ -36,6 +36,7 @@
   /* (non-Javadoc)
    * @see PerfTask#shouldNeverLogAtStart()
    */
+  @Override
   protected boolean shouldNeverLogAtStart() {
     return true;
   }
@@ -43,6 +44,7 @@
   /* (non-Javadoc)
    * @see PerfTask#shouldNotRecordStats()
    */
+  @Override
   protected boolean shouldNotRecordStats() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetInputsTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetInputsTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetInputsTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetInputsTask.java Mon Nov  9 04:01:50 2009
@@ -31,6 +31,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     getRunData().resetInputs();
     return 0;
@@ -40,6 +41,7 @@
    * (non-Javadoc)
    * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#shouldNotRecordStats()
    */
+  @Override
   protected boolean shouldNotRecordStats() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemEraseTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemEraseTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemEraseTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemEraseTask.java Mon Nov  9 04:01:50 2009
@@ -34,6 +34,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     getRunData().reinit(true);
     return 0;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemSoftTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemSoftTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemSoftTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ResetSystemSoftTask.java Mon Nov  9 04:01:50 2009
@@ -34,6 +34,7 @@
     super(runData);
   }
 
+  @Override
   public int doLogic() throws Exception {
     getRunData().reinit(false);
     return 0;

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTask.java Mon Nov  9 04:01:50 2009
@@ -32,22 +32,27 @@
     super(runData);
   }
 
+  @Override
   public boolean withRetrieve() {
     return false;
   }
 
+  @Override
   public boolean withSearch() {
     return true;
   }
 
+  @Override
   public boolean withTraverse() {
     return false;
   }
 
+  @Override
   public boolean withWarm() {
     return false;
   }
 
+  @Override
   public QueryMaker getQueryMaker() {
     return getRunData().getQueryMaker(this);
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java Mon Nov  9 04:01:50 2009
@@ -73,6 +73,7 @@
     super(runData);
   }
 
+  @Override
   public void setup() throws Exception {
     super.setup();
     //check to make sure either the doc is being stored
@@ -83,18 +84,22 @@
     maxDocCharsToAnalyze = data.getConfig().get("highlighter.maxDocCharsToAnalyze", Highlighter.DEFAULT_MAX_CHARS_TO_ANALYZE);
   }
 
+  @Override
   public boolean withRetrieve() {
     return true;
   }
 
+  @Override
   public int numToHighlight() {
     return numToHighlight;
   }
   
+  @Override
   protected BenchmarkHighlighter getBenchmarkHighlighter(Query q){
     highlighter = new Highlighter(new SimpleHTMLFormatter(), new QueryScorer(q));
     highlighter.setMaxDocCharsToAnalyze(maxDocCharsToAnalyze);
     return new BenchmarkHighlighter(){
+      @Override
       public int doHighlight(IndexReader reader, int doc, String field,
           Document document, Analyzer analyzer, String text) throws Exception {
         TokenStream ts = TokenSources.getAnyTokenStream(reader, doc, field, document, analyzer);
@@ -104,6 +109,7 @@
     };
   }
 
+  @Override
   protected Collection<String> getFieldsToHighlight(Document document) {
     Collection<String> result = super.getFieldsToHighlight(document);
     //if stored is false, then result will be empty, in which case just get all the param fields
@@ -115,6 +121,7 @@
     return result;
   }
 
+  @Override
   public void setParams(String params) {
     String [] splits = params.split(",");
     for (int i = 0; i < splits.length; i++) {

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetLoadFieldSelectorTask.java Mon Nov  9 04:01:50 2009
@@ -47,15 +47,18 @@
     
   }
 
+  @Override
   public boolean withRetrieve() {
     return true;
   }
 
 
+  @Override
   protected Document retrieveDoc(IndexReader ir, int id) throws IOException {
     return ir.document(id, fieldSelector);
   }
 
+  @Override
   public void setParams(String params) {
     this.params = params; // cannot just call super.setParams(), b/c it's params differ.
     Set<String> fieldsToLoad = new HashSet<String>();
@@ -70,6 +73,7 @@
   /* (non-Javadoc)
   * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#supportsParams()
   */
+  @Override
   public boolean supportsParams() {
     return true;
   }

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetTask.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetTask.java?rev=833968&r1=833967&r2=833968&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetTask.java (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetTask.java Mon Nov  9 04:01:50 2009
@@ -37,6 +37,7 @@
     super(runData);
   }
 
+  @Override
   public boolean withRetrieve() {
     return true;
   }



Mime
View raw message