mirror of https://github.com/apache/lucene.git
LUCENE-1492: add optional readOnly param to OpenReader task
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@727029 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1f33d7c66a
commit
09f661c48c
|
@ -4,6 +4,9 @@ The Benchmark contrib package contains code for benchmarking Lucene in a variety
|
|||
|
||||
$Id:$
|
||||
|
||||
12/16/08
|
||||
LUCENE-1492: Added optional readOnly param (default true) to OpenReader task.
|
||||
|
||||
9/9/08
|
||||
LUCENE-1243: Added new sorting benchmark capabilities. Also Reopen and commit tasks. (Mark Miller via Grant Ingersoll)
|
||||
|
||||
|
|
|
@ -29,15 +29,25 @@ import org.apache.lucene.store.Directory;
|
|||
*/
|
||||
public class OpenReaderTask extends PerfTask {
|
||||
|
||||
private boolean readOnly = true;
|
||||
|
||||
public OpenReaderTask(PerfRunData runData) {
|
||||
super(runData);
|
||||
}
|
||||
|
||||
public int doLogic() throws IOException {
|
||||
Directory dir = getRunData().getDirectory();
|
||||
IndexReader reader = IndexReader.open(dir);
|
||||
IndexReader reader = IndexReader.open(dir, readOnly);
|
||||
getRunData().setIndexReader(reader);
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void setParams(String params) {
|
||||
super.setParams(params);
|
||||
readOnly = Boolean.valueOf(params).booleanValue();
|
||||
}
|
||||
|
||||
public boolean supportsParams() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class TestPerfTasksLogic extends TestCase {
|
|||
"{ AddDoc } : 1000",
|
||||
"Optimize",
|
||||
"CloseIndex",
|
||||
"OpenReader",
|
||||
"OpenReader(true)",
|
||||
"{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body]) } : 200",
|
||||
"CloseReader",
|
||||
};
|
||||
|
@ -147,7 +147,7 @@ public class TestPerfTasksLogic extends TestCase {
|
|||
"{ AddDoc } : 1000",
|
||||
"Optimize",
|
||||
"CloseIndex",
|
||||
"OpenReader",
|
||||
"OpenReader(false)",
|
||||
"{ CountingHighlighterTest(size[1],highlight[1],mergeContiguous[true],maxFrags[1],fields[body]) } : 200",
|
||||
"CloseReader",
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue