Search in sources :

Example 1 with RepSumByNameTask

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

the class Sample method main.

public static void main(String[] args) throws Exception {
    Properties p = initProps();
    Config conf = new Config(p);
    PerfRunData runData = new PerfRunData(conf);
    // 1. top sequence
    // top level, not parallel
    TaskSequence top = new TaskSequence(runData, null, null, false);
    // 2. task to create the index
    CreateIndexTask create = new CreateIndexTask(runData);
    top.addTask(create);
    // 3. task seq to add 500 docs (order matters - top to bottom - add seq to top, only then add to seq)
    TaskSequence seq1 = new TaskSequence(runData, "AddDocs", top, false);
    seq1.setRepetitions(500);
    seq1.setNoChildReport();
    top.addTask(seq1);
    // 4. task to add the doc
    AddDocTask addDoc = new AddDocTask(runData);
    //addDoc.setParams("1200"); // doc size limit if supported
    // order matters 9see comment above)
    seq1.addTask(addDoc);
    // 5. task to close the index
    CloseIndexTask close = new CloseIndexTask(runData);
    top.addTask(close);
    // task to report
    RepSumByNameTask rep = new RepSumByNameTask(runData);
    top.addTask(rep);
    // print algorithm
    System.out.println(top.toString());
    // execute
    top.doLogic();
}
Also used : CloseIndexTask(org.apache.lucene.benchmark.byTask.tasks.CloseIndexTask) RepSumByNameTask(org.apache.lucene.benchmark.byTask.tasks.RepSumByNameTask) TaskSequence(org.apache.lucene.benchmark.byTask.tasks.TaskSequence) Config(org.apache.lucene.benchmark.byTask.utils.Config) CreateIndexTask(org.apache.lucene.benchmark.byTask.tasks.CreateIndexTask) PerfRunData(org.apache.lucene.benchmark.byTask.PerfRunData) Properties(java.util.Properties) AddDocTask(org.apache.lucene.benchmark.byTask.tasks.AddDocTask)

Aggregations

Properties (java.util.Properties)1 PerfRunData (org.apache.lucene.benchmark.byTask.PerfRunData)1 AddDocTask (org.apache.lucene.benchmark.byTask.tasks.AddDocTask)1 CloseIndexTask (org.apache.lucene.benchmark.byTask.tasks.CloseIndexTask)1 CreateIndexTask (org.apache.lucene.benchmark.byTask.tasks.CreateIndexTask)1 RepSumByNameTask (org.apache.lucene.benchmark.byTask.tasks.RepSumByNameTask)1 TaskSequence (org.apache.lucene.benchmark.byTask.tasks.TaskSequence)1 Config (org.apache.lucene.benchmark.byTask.utils.Config)1