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

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


  public int doLogic() throws IOException {
    Directory dir = getRunData().getDirectory();
    Analyzer analyzer = getRunData().getAnalyzer();
   
    Config config = getRunData().getConfig();
   
    boolean cmpnd = config.get("compound",true);
    int mrgf = config.get("merge.factor",DEFAULT_MERGE_PFACTOR);
    int mxbf = config.get("max.buffered",DEFAULT_MAX_BUFFERED);
    int mxfl = config.get("max.field.length",DEFAULT_MAX_FIELD_LENGTH);
    double flushAtRAMUsage = config.get("ram.flush.mb", DEFAULT_RAM_FLUSH_MB);
    boolean autoCommit = config.get("autocommit", DEFAULT_AUTO_COMMIT);
    IndexWriter writer = new IndexWriter(dir, autoCommit, analyzer, false);

    // must update params for newly opened writer
    writer.setRAMBufferSizeMB(flushAtRAMUsage);
    writer.setMaxBufferedDocs(mxbf);
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

    Properties props = new Properties();
    props.setProperty("writer.version", TEST_VERSION_CURRENT.toString());
    props.setProperty("print.props", "false"); // don't print anything
    props.setProperty("directory", "RAMDirectory");
    props.setProperty(AddIndexesTask.ADDINDEXES_INPUT_DIR, inputDir.getAbsolutePath());
    Config config = new Config(props);
    return new PerfRunData(config);
  }
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

  private PerfRunData createPerfRunData(File file, String docMakerName) throws Exception {
    Properties props = new Properties();
    props.setProperty("doc.maker", docMakerName);
    props.setProperty("line.file.out", file.getAbsolutePath());
    props.setProperty("directory", "RAMDirectory"); // no accidental FS dir.
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here

import java.util.Properties;

public class SearchWithSortTaskTest extends BenchmarkTestCase {

  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());
  }
View Full Code Here

    }
    if (docMakerName.equals(LegalJustDateDocMaker.class.getName())) {
      props.setProperty("line.fields", DocMaker.DATE_FIELD);
      props.setProperty("sufficient.fields", DocMaker.DATE_FIELD);
    }
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here

    props.setProperty("print.props", "false"); // don't print anything
    props.setProperty("directory", "RAMDirectory");
    if (infoStreamValue != null) {
      props.setProperty("writer.info.stream", infoStreamValue);
    }
    Config config = new Config(props);
    return new PerfRunData(config);
  }
View Full Code Here

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

    }
  }

  public int doLogic() throws IOException {
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    IndexWriter writer = new IndexWriter(runData.getDirectory(),
                                         runData.getConfig().get("autocommit", OpenIndexTask.DEFAULT_AUTO_COMMIT),
                                         runData.getAnalyzer(),
                                         true);
    CreateIndexTask.setIndexWriterConfig(writer, config);
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.