Package org.apache.blur.utils

Examples of org.apache.blur.utils.SimpleTimer


    DirectoryReferenceCounter referenceCounter = new DirectoryReferenceCounter(directory, gc, closer);
    // This directory allows for warm up by adding tracing ability.
    TraceableDirectory dir = new TraceableDirectory(referenceCounter);
   
    SimpleTimer simpleTimer = new SimpleTimer();
    simpleTimer.start("writerOpen");
    _writer = new BlurIndexWriter(dir, conf, true);
    simpleTimer.stop("writerOpen");
    simpleTimer.start("nrtSetup");
    _recorder = new TransactionRecorder(shardContext);
    _recorder.replay(_writer);

    _searcherFactory = new SearcherFactory() {
      @Override
      public IndexSearcher newSearcher(IndexReader reader) throws IOException {
        return new IndexSearcherClosableNRT(reader, searchExecutor, _nrtManagerRef, _directory);
      }
    };

    _trackingWriter = new TrackingIndexWriter(_writer);
    _indexImporter = new IndexImporter(_trackingWriter, _lock, _shardContext, TimeUnit.SECONDS, 10);
    _nrtManagerRef.set(new NRTManager(_trackingWriter, _searcherFactory, APPLY_ALL_DELETES));
    // start commiter

    _committer = new Thread(new Committer());
    _committer.setDaemon(true);
    _committer.setName("Commit Thread [" + _tableContext.getTable() + "/" + shardContext.getShard() + "]");
    _committer.start();

    // start refresher
    double targetMinStaleSec = _tableContext.getTimeBetweenRefreshs() / 1000.0;
    _refresher = new NRTManagerReopenThread(getNRTManager(), targetMinStaleSec * 10, targetMinStaleSec);
    _refresher.setName("Refresh Thread [" + _tableContext.getTable() + "/" + shardContext.getShard() + "]");
    _refresher.setDaemon(true);
    _refresher.start();
    simpleTimer.stop("nrtSetup");
    simpleTimer.log(LOG);
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.utils.SimpleTimer

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.