use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CommitIndexTaskTest method createPerfRunData.
private PerfRunData createPerfRunData() 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");
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 WriteEnwikiLineDocTaskTest method createPerfRunData.
private PerfRunData createPerfRunData(Path file, String docMakerName) throws Exception {
Properties props = new Properties();
props.setProperty("doc.maker", docMakerName);
props.setProperty("line.file.out", file.toAbsolutePath().toString());
// no accidental FS dir.
props.setProperty("directory", "RAMDirectory");
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 WriteEnwikiLineDocTaskTest method testCategoryLines.
public void testCategoryLines() throws Exception {
// WriteLineDocTask replaced only \t characters w/ a space, since that's its
// separator char. However, it didn't replace newline characters, which
// resulted in errors in LineDocSource.
Path file = getWorkDir().resolve("two-lines-each.txt");
PerfRunData runData = createPerfRunData(file, WriteLineCategoryDocMaker.class.getName());
WriteLineDocTask wldt = new WriteEnwikiLineDocTask(runData);
for (int i = 0; i < 4; i++) {
// four times so that each file should have 2 lines.
wldt.doLogic();
}
wldt.close();
doReadTest(file, "title text", "date text", "body text");
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class WriteLineDocTaskTest method testEmptyTitle.
public void testEmptyTitle() throws Exception {
Path file = getWorkDir().resolve("one-line");
PerfRunData runData = createPerfRunData(file, false, NoTitleDocMaker.class.getName());
WriteLineDocTask wldt = new WriteLineDocTask(runData);
wldt.doLogic();
wldt.close();
doReadTest(file, Type.PLAIN, "", "date", "body");
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class WriteLineDocTaskTest method testLegalJustDate.
public void testLegalJustDate() throws Exception {
Path file = getWorkDir().resolve("one-line");
PerfRunData runData = createPerfRunData(file, false, LegalJustDateDocMaker.class.getName());
WriteLineDocTask wldt = new WriteLineDocTask(runData);
wldt.doLogic();
wldt.close();
try (BufferedReader br = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
String line = br.readLine();
assertHeaderLine(line);
line = br.readLine();
assertNotNull(line);
}
}
Aggregations