Search in sources :

Example 6 with PerfRunData

use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.

the class CreateIndexTaskTest method testNoMergeScheduler.

public void testNoMergeScheduler() throws Exception {
    PerfRunData runData = createPerfRunData(null);
    runData.getConfig().set("merge.scheduler", NoMergeScheduler.class.getName());
    new CreateIndexTask(runData).doLogic();
    new CloseIndexTask(runData).doLogic();
}
Also used : NoMergeScheduler(org.apache.lucene.index.NoMergeScheduler) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 7 with PerfRunData

use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.

the class CreateIndexTaskTest method testInfoStream_SystemOutErr.

public void testInfoStream_SystemOutErr() throws Exception {
    PrintStream curOut = System.out;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    System.setOut(new PrintStream(baos, false, Charset.defaultCharset().name()));
    try {
        PerfRunData runData = createPerfRunData("SystemOut");
        CreateIndexTask cit = new CreateIndexTask(runData);
        cit.doLogic();
        new CloseIndexTask(runData).doLogic();
        assertTrue(baos.size() > 0);
    } finally {
        System.setOut(curOut);
    }
    PrintStream curErr = System.err;
    baos.reset();
    System.setErr(new PrintStream(baos, false, Charset.defaultCharset().name()));
    try {
        PerfRunData runData = createPerfRunData("SystemErr");
        CreateIndexTask cit = new CreateIndexTask(runData);
        cit.doLogic();
        new CloseIndexTask(runData).doLogic();
        assertTrue(baos.size() > 0);
    } finally {
        System.setErr(curErr);
    }
}
Also used : PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 8 with PerfRunData

use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.

the class PerfTaskTest method createPerfRunData.

private PerfRunData createPerfRunData(boolean setLogStep, int logStepVal, boolean setTaskLogStep, int taskLogStepVal) throws Exception {
    Properties props = new Properties();
    if (setLogStep) {
        props.setProperty("log.step", Integer.toString(logStepVal));
    }
    if (setTaskLogStep) {
        props.setProperty("log.step.MyPerf", Integer.toString(taskLogStepVal));
    }
    // no accidental FS dir.
    props.setProperty("directory", "RAMDirectory");
    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 9 with PerfRunData

use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.

the class PerfTaskTest method doLogStepTest.

private void doLogStepTest(boolean setLogStep, int logStepVal, boolean setTaskLogStep, int taskLogStepVal, int expLogStepValue) throws Exception {
    PerfRunData runData = createPerfRunData(setLogStep, logStepVal, setTaskLogStep, taskLogStepVal);
    MyPerfTask mpt = new MyPerfTask(runData);
    assertEquals(expLogStepValue, mpt.getLogStep());
}
Also used : PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData)

Example 10 with PerfRunData

use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.

the class SearchWithSortTaskTest method testSetParams_docField.

public void testSetParams_docField() throws Exception {
    SearchWithSortTask task = new SearchWithSortTask(new PerfRunData(new Config(new Properties())));
    task.setParams("doc");
    assertEquals(SortField.Type.DOC, task.getSort().getSort()[0].getType());
}
Also used : Config(org.apache.lucene.benchmark.byTask.utils.Config) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData) Properties(java.util.Properties)

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