Package org.apache.lucene.benchmark.byTask.utils

Examples of org.apache.lucene.benchmark.byTask.utils.Config


    props.setProperty("line.file.out", file.getAbsolutePath());
    if (setBZCompress) {
      props.setProperty("bzip.compression", bz2CompressVal);
    }
    props.setProperty("directory", "RAMDirectory"); // no accidental FS dir.
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here


  }
 
  public PerfTask(PerfRunData runData) {
    this();
    this.runData = runData;
    Config config = runData.getConfig();
    this.maxDepthLogStart = config.get("task.max.depth.log",0);

    String logStepAtt = "log.step";
    // TODO (1.5): call getClass().getSimpleName() instead.
    String taskName = getClass().getName();
    int idx = taskName.lastIndexOf('.');
    // To support test internal classes. when we move to getSimpleName, this can be removed.
    int idx2 = taskName.indexOf('$', idx);
    if (idx2 != -1) idx = idx2;
    String taskLogStepAtt = "log.step." + taskName.substring(idx + 1, taskName.length() - 4 /* w/o the 'Task' part */);
    if (config.get(taskLogStepAtt, null) != null) {
      logStepAtt = taskLogStepAtt;
    }

    // It's important to read this from Config, to support vals-by-round.
    logStep = config.get(logStepAtt, DEFAULT_LOG_STEP);
    // To avoid the check 'if (logStep > 0)' in tearDown(). This effectively
    // turns logging off.
    if (logStep <= 0) {
      logStep = Integer.MAX_VALUE;
    }
View Full Code Here

    return true;
  }
 
  public int doLogic() throws Exception {
    Directory dir = getRunData().getDirectory();
    Config config = getRunData().getConfig();
    IndexReader r = null;
    if (userData == null)
      r = IndexReader.open(dir);
    else
      r = OpenReaderTask.openCommitPoint(userData, dir, config, true);
View Full Code Here

  private PerfRunData createPerfRunData(String infoStreamValue) throws Exception {
    Properties props = new Properties();
    props.setProperty("print.props", "false"); // don't print anything
    props.setProperty("directory", "RAMDirectory");
    props.setProperty("writer.info.stream", infoStreamValue);
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here

    super(runData);
  }

  public int doLogic() throws IOException {
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    IndexWriter writer = new IndexWriter(runData.getDirectory(),
                                         config.get("autocommit", DEFAULT_AUTO_COMMIT),
                                         runData.getAnalyzer(),
                                         false);
    CreateIndexTask.setIndexWriterConfig(writer, config);
    runData.setIndexWriter(writer);
    return 1;
View Full Code Here

    }
    if (setTaskLogStep) {
      props.setProperty("log.step.MyPerf", Integer.toString(taskLogStepVal));
    }
    props.setProperty("directory", "RAMDirectory"); // no accidental FS dir.
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here

   * @throws Exception
   * @throws IOException
   */
  public static void main(String[] args) throws Exception {
    Properties p = initProps();
    Config conf = new Config(p);
    PerfRunData runData = new PerfRunData(conf);
   
    // 1. top sequence
    TaskSequence top = new TaskSequence(runData,null,null,false); // top level, not parallel
   
View Full Code Here

    props.setProperty("analyzer", SimpleAnalyzer.class.getName());
    props.setProperty("content.source", LineDocSource.class.getName());
    props.setProperty("directory", "RAMDirectory");
   
    // Create PerfRunData
    Config config = new Config(props);
    PerfRunData runData = new PerfRunData(config);

    TaskSequence tasks = new TaskSequence(runData, "testBzip2", null, false);
    tasks.addTask(new CreateIndexTask(runData));
    tasks.addTask(new AddDocTask(runData));
View Full Code Here

    if (setIndexProps) {
      props.setProperty("doc.index.props", Boolean.toString(indexPropsVal));
    }
   
    // Create PerfRunData
    Config config = new Config(props);
    PerfRunData runData = new PerfRunData(config);

    TaskSequence tasks = new TaskSequence(runData, getName(), null, false);
    tasks.addTask(new CreateIndexTask(runData));
    tasks.addTask(new AddDocTask(runData));
View Full Code Here

    if (setBodyNormsProp) {
      props.setProperty("doc.body.tokenized.norms", Boolean.toString(bodyNormsVal));
    }
   
    // Create PerfRunData
    Config config = new Config(props);
   
    DocMaker dm = new DocMaker();
    dm.setConfig(config);
    return dm.makeDocument();
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.benchmark.byTask.utils.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.