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

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


   
    Properties properties = new Properties();
    properties.setProperty("docs.file", wikipedia.getAbsolutePath());
    properties.setProperty("content.source.forever", "false");
    properties.setProperty("keep.image.only.docs", String.valueOf(keepImageOnlyDocs));
    Config config = new Config(properties);

    ContentSource source = new EnwikiContentSource();
    source.setConfig(config);
   
    DocMaker docMaker = new DocMaker();
View Full Code Here


  @Override
  public void setup() throws Exception {
    super.setup();
    //check to make sure either the doc is being stored
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    clnName = config.get("collector.class", "");
  }
View Full Code Here

  private final boolean checkSufficientFields;

 
  public WriteLineDocTask(PerfRunData runData) throws Exception {
    super(runData);
    Config config = runData.getConfig();
    fname = config.get("line.file.out", null);
    if (fname == null) {
      throw new IllegalArgumentException("line.file.out must be set");
    }
    OutputStream out = StreamUtils.outputStream(new File(fname));
    lineFileOut = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8), StreamUtils.BUFFER_SIZE));
    docMaker = runData.getDocMaker();
   
    // init fields
    String f2r = config.get("line.fields",null);
    if (f2r == null) {
      fieldsToWrite = DEFAULT_FIELDS;
    } else {
      if (f2r.indexOf(SEP)>=0) {
        throw new IllegalArgumentException("line.fields "+f2r+" should not contain the separator char: "+SEP);
      }
      fieldsToWrite = f2r.split(",");
    }
   
    // init sufficient fields
    sufficientFields = new boolean[fieldsToWrite.length];
    String suff = config.get("sufficient.fields",DEFAULT_SUFFICIENT_FIELDS);
    if (",".equals(suff)) {
      checkSufficientFields = false;
    } else {
      checkSufficientFields = true;
      HashSet<String> sf = new HashSet<>(Arrays.asList(suff.split(",")));
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";
    String taskLogStepAtt = "log.step." + name;
    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

  }

  @Override
  public int doLogic() throws IOException {
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    final IndexCommit ic;
    if (commitUserData != null) {
      ic = OpenReaderTask.findIndexCommit(runData.getDirectory(), commitUserData);
    } else {
      ic = null;
View Full Code Here

  }
 
  @Override
  public int doLogic() throws IOException {
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    runData.setIndexWriter(configureWriter(config, runData, OpenMode.CREATE, null));
    return 1;
  }
View Full Code Here

    props.setProperty("content.source.excludeIteration", "true");
    props.setProperty("doc.maker.forever", "false");
    props.setProperty("docs.dir", dataDir.getCanonicalPath().replace('\\','/'));
    props.setProperty("trec.doc.parser", TrecParserByPath.class.getName());
    props.setProperty("content.source.forever", "false");
    tcs.setConfig(new Config(props));
    tcs.resetInputs();
    DocData dd = new DocData();
    int n = 0;
    boolean gotExpectedException = false;
    HashSet<ParsePathType> unseenTypes = new HashSet<>(Arrays.asList(ParsePathType.values()));
View Full Code Here

  private EnwikiContentSource createContentSource(String docs, boolean foreverthrows IOException {
   
    Properties props = new Properties();
    props.setProperty("print.props", "false");
    props.setProperty("content.source.forever", Boolean.toString(forever));
    Config config = new Config(props);
   
    EnwikiContentSource source = new StringableEnwikiSource(docs);
    source.setConfig(config);
   
    // doc-maker just for initiating content source inputs
View Full Code Here

  private boolean executed;
 
  public Benchmark (Reader algReader) throws Exception {
    // prepare run data
    try {
      runData = new PerfRunData(new Config(algReader));
    } catch (Exception e) {
      e.printStackTrace();
      throw new Exception("Error: cannot init PerfRunData!",e);
    }
   
View Full Code Here

      props.setProperty("directory", "RAMDirectory");
      props.setProperty("doc.stored", "true");
      props.setProperty("doc.index.props", "true");
     
      // Create PerfRunData
      Config config = new Config(props);
      runData = new PerfRunData(config);

      TaskSequence tasks = new TaskSequence(runData, "testBzip2", null, false);
      tasks.addTask(new CreateIndexTask(runData));
      for (int i=0; i<numAdds; i++) {
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.