Search in sources :

Example 36 with PerfRunData

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");
}
Also used : Path(java.nio.file.Path) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 37 with PerfRunData

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();
}
Also used : SegmentInfos(org.apache.lucene.index.SegmentInfos) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 38 with PerfRunData

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();
}
Also used : NoMergePolicy(org.apache.lucene.index.NoMergePolicy) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 39 with PerfRunData

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);
}
Also used : Config(org.apache.lucene.benchmark.byTask.utils.Config) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData) Properties(java.util.Properties)

Example 40 with PerfRunData

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);
}
Also used : Path(java.nio.file.Path) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Aggregations

PerfRunData (org.apache.lucene.benchmark.byTask.PerfRunData)40 Config (org.apache.lucene.benchmark.byTask.utils.Config)13 Path (java.nio.file.Path)12 Properties (java.util.Properties)10 BufferedReader (java.io.BufferedReader)4 AddDocTask (org.apache.lucene.benchmark.byTask.tasks.AddDocTask)3 CloseIndexTask (org.apache.lucene.benchmark.byTask.tasks.CloseIndexTask)3 CreateIndexTask (org.apache.lucene.benchmark.byTask.tasks.CreateIndexTask)3 TaskSequence (org.apache.lucene.benchmark.byTask.tasks.TaskSequence)3 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)3 WhitespaceAnalyzer (org.apache.lucene.analysis.core.WhitespaceAnalyzer)2 DirectoryTaxonomyWriter (org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter)2 IndexReader (org.apache.lucene.index.IndexReader)2 IndexWriter (org.apache.lucene.index.IndexWriter)2 Term (org.apache.lucene.index.Term)2 IndexSearcher (org.apache.lucene.search.IndexSearcher)2 TermQuery (org.apache.lucene.search.TermQuery)2 TopDocs (org.apache.lucene.search.TopDocs)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1