use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class WriteLineDocTaskTest method testGZip.
/* Tests WriteLineDocTask with a gzip format. */
public void testGZip() throws Exception {
// Create a document in gz format.
Path file = getWorkDir().resolve("one-line.gz");
PerfRunData runData = createPerfRunData(file, false, WriteLineDocMaker.class.getName());
WriteLineDocTask wldt = new WriteLineDocTask(runData);
wldt.doLogic();
wldt.close();
doReadTest(file, Type.GZIP, "title", "date", "body");
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CommitIndexTaskTest method testCommitData.
public void testCommitData() throws Exception {
PerfRunData runData = createPerfRunData();
new CreateIndexTask(runData).doLogic();
CommitIndexTask task = new CommitIndexTask(runData);
task.setParams("params");
task.doLogic();
SegmentInfos infos = SegmentInfos.readLatestCommit(runData.getDirectory());
assertEquals("params", infos.getUserData().get(OpenReaderTask.USER_DATA));
new CloseIndexTask(runData).doLogic();
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CreateIndexTaskTest method testNoMergePolicy.
public void testNoMergePolicy() throws Exception {
PerfRunData runData = createPerfRunData(null);
runData.getConfig().set("merge.policy", NoMergePolicy.class.getName());
new CreateIndexTask(runData).doLogic();
new CloseIndexTask(runData).doLogic();
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CreateIndexTaskTest method createPerfRunData.
private PerfRunData createPerfRunData(String infoStreamValue) throws Exception {
Properties props = new Properties();
props.setProperty("writer.version", Version.LATEST.toString());
// don't print anything
props.setProperty("print.props", "false");
props.setProperty("directory", "RAMDirectory");
if (infoStreamValue != null) {
props.setProperty("writer.info.stream", infoStreamValue);
}
Config config = new Config(props);
return new PerfRunData(config);
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CreateIndexTaskTest method testInfoStream_File.
public void testInfoStream_File() throws Exception {
Path outFile = getWorkDir().resolve("infoStreamTest");
PerfRunData runData = createPerfRunData(outFile.toAbsolutePath().toString());
new CreateIndexTask(runData).doLogic();
new CloseIndexTask(runData).doLogic();
assertTrue(Files.size(outFile) > 0);
}
Aggregations