mirror of https://github.com/apache/lucene.git
LUCENE-3583: more safety changes to benchmark
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1204851 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
67db0ed9d1
commit
cfe863797c
|
@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTask;
|
|||
* 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>=<type of directory for taxonomy index| Default: RAMDirectory>
|
||||
* </ul>
|
||||
*/
|
||||
public class PerfRunData {
|
||||
public class PerfRunData implements Closeable {
|
||||
|
||||
private Points points;
|
||||
|
||||
|
@ -124,6 +125,12 @@ public class PerfRunData {
|
|||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTask.feeds;
|
|||
* 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.byTask.utils.Format;
|
|||
* 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;
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.lucene.benchmark.byTask.feeds;
|
|||
* 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.TextField;
|
|||
* {@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;
|
||||
|
|
|
@ -155,6 +155,7 @@ public class LineDocSourceTest extends BenchmarkTestCase {
|
|||
|
||||
searcher.close();
|
||||
reader.close();
|
||||
runData.close();
|
||||
}
|
||||
|
||||
/* Tests LineDocSource with a bzip2 input stream. */
|
||||
|
|
Loading…
Reference in New Issue