lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1204851 - in /lucene/dev/trunk/modules/benchmark/src: java/org/apache/lucene/benchmark/byTask/ java/org/apache/lucene/benchmark/byTask/feeds/ test/org/apache/lucene/benchmark/byTask/feeds/
Date Tue, 22 Nov 2011 08:14:51 GMT
Author: shaie
Date: Tue Nov 22 08:14:50 2011
New Revision: 1204851

URL: http://svn.apache.org/viewvc?rev=1204851&view=rev
Log:
LUCENE-3583: more safety changes to benchmark

Modified:
    lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
    lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java
    lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java
    lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java

Modified: lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java?rev=1204851&r1=1204850&r2=1204851&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/PerfRunData.java
Tue Nov 22 08:14:50 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTa
  * limitations under the License.
  */
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
@@ -66,7 +67,7 @@ import org.apache.lucene.util.IOUtils;
  *  <li><b>taxonomy.directory</b>=&lt;type of directory for taxonomy
index| Default: RAMDirectory&gt;
  * </ul>
  */
-public class PerfRunData {
+public class PerfRunData implements Closeable {
 
   private Points points;
   
@@ -123,6 +124,12 @@ public class PerfRunData {
       System.out.println(getQueryMaker(new SearchTask(this)).printQueries());
     }
   }
+  
+  public void close() throws IOException {
+    IOUtils.close(indexWriter, indexReader, indexSearcher, directory, 
+                  taxonomyWriter, taxonomyReader, taxonomyDir, 
+                  docMaker, facetSource);
+  }
 
   // clean old stuff, reopen 
   public void reinit(boolean eraseIndex) throws Exception {

Modified: lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java?rev=1204851&r1=1204850&r2=1204851&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java
Tue Nov 22 08:14:50 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTa
  * limitations under the License.
  */
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -46,7 +47,7 @@ import org.apache.lucene.benchmark.byTas
  * logStep is not 0 (<b>default=0</b>).
  * </ul>
  */
-public abstract class ContentItemsSource {
+public abstract class ContentItemsSource implements Closeable {
   
   private long bytesCount;
   private long totalBytesCount;

Modified: lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java?rev=1204851&r1=1204850&r2=1204851&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java
Tue Nov 22 08:14:50 2011
@@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTa
  * limitations under the License.
  */
 
+import java.io.Closeable;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
@@ -75,7 +76,7 @@ import org.apache.lucene.document.TextFi
  * {@link DocData#getProps()} will be indexed. (default <b>false</b>).
  * </ul>
  */
-public class DocMaker {
+public class DocMaker implements Closeable {
 
   private static class LeftOver {
     private DocData docdata;

Modified: lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java?rev=1204851&r1=1204850&r2=1204851&view=diff
==============================================================================
--- lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
(original)
+++ lucene/dev/trunk/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
Tue Nov 22 08:14:50 2011
@@ -155,6 +155,7 @@ public class LineDocSourceTest extends B
 
     searcher.close();
     reader.close();
+    runData.close();
   }
   
   /* Tests LineDocSource with a bzip2 input stream. */



Mime
View raw message