LUCENE-6399: Benchmark's QueryMaker.resetInputs should call setConfig

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1672742 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2015-04-10 20:04:22 +00:00
parent 489f56def8
commit 09ddb7d912
4 changed files with 16 additions and 5 deletions

View File

@ -92,6 +92,9 @@ Other
when resolving deleted terms to matched docids. (Robert Muir, Adrien
Grand, Mike McCandless)
* LUCENE-6399: Benchmark module's QueryMaker.resetInputs should call setConfig
so queries can react to property changes in new rounds. (David Smiley)
======================= Lucene 5.1.0 =======================
New Features

View File

@ -421,7 +421,13 @@ public class PerfRunData implements Closeable {
docMaker.resetInputs();
facetSource.resetInputs();
for (final QueryMaker queryMaker : readTaskQueryMaker.values()) {
queryMaker.resetInputs();
try {
queryMaker.resetInputs();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -15,8 +15,8 @@ package org.apache.lucene.benchmark.byTask.feeds;
* limitations under the License.
*/
import org.apache.lucene.search.Query;
import org.apache.lucene.benchmark.byTask.utils.Config;
import org.apache.lucene.search.Query;
/**
* Abstract base query maker.
@ -29,8 +29,10 @@ public abstract class AbstractQueryMaker implements QueryMaker {
protected Config config;
@Override
public void resetInputs() {
public void resetInputs() throws Exception {
qnum = 0;
// re-initialize since properties by round may have changed.
setConfig(config);
}
protected abstract Query[] prepareQueries() throws Exception;

View File

@ -18,8 +18,8 @@ package org.apache.lucene.benchmark.byTask.feeds;
*/
import org.apache.lucene.search.Query;
import org.apache.lucene.benchmark.byTask.utils.Config;
import org.apache.lucene.search.Query;
/**
@ -41,7 +41,7 @@ public interface QueryMaker {
public void setConfig (Config config) throws Exception;
/** Reset inputs so that the test run would behave, input wise, as if it just started. */
public void resetInputs();
public void resetInputs() throws Exception;
/** Print the queries */
public String printQueries();