Package org.apache.blur.lucene.warmup

Examples of org.apache.blur.lucene.warmup.IndexWarmup


  @Override
  public void warm(AtomicReader reader) throws IOException {
    List<String> preCacheCols = shardContext.getTableContext().getDescriptor().getPreCacheCols();
    int maxSampleSize = 1000;
    IndexWarmup indexWarmup = new IndexWarmup(isClosed, maxSampleSize);
    String context = shardContext.getTableContext().getTable() + "/" + shardContext.getShard();
    Map<String, List<IndexTracerResult>> sampleIndex = indexWarmup.sampleIndex(reader, context);
    if (preCacheCols != null) {
      warm(reader, preCacheCols, indexWarmup, sampleIndex, context, isClosed);
    } else {
      Fields fields = reader.fields();
      warm(reader, fields, indexWarmup, sampleIndex, context, isClosed);
View Full Code Here


    try {
      if (reader instanceof FilterDirectoryReader) {
        reader = getBase((FilterDirectoryReader) reader);
      }
      int maxSampleSize = 1000;
      IndexWarmup indexWarmup = new IndexWarmup(isClosed, maxSampleSize, _warmupBandwidthThrottleBytesPerSec);
      String context = table.getName() + "/" + shard;
      Map<String, List<IndexTracerResult>> sampleIndex = indexWarmup.sampleIndex(reader, context);
      List<String> preCacheCols = table.getPreCacheCols();
      if (preCacheCols != null) {
        warm(reader, preCacheCols, indexWarmup, sampleIndex, context, isClosed, pauseWarmup);
      } else {
        warm(reader, getFields(reader), indexWarmup, sampleIndex, context, isClosed, pauseWarmup);
View Full Code Here

      }
      int maxSampleSize = 1000;
      synchronized (_stops) {
        _stops.add(stop);
      }
      IndexWarmup indexWarmup = new IndexWarmup(isClosed, stop, maxSampleSize, _warmupBandwidthThrottleBytesPerSec);
      String context = table.getName() + "/" + shard;
      Map<String, List<IndexTracerResult>> sampleIndex = indexWarmup.sampleIndex(reader, context);
      Iterable<String> preCacheCols = table.getPreCacheCols();
      if (preCacheCols == null) {
        // All fields.
        preCacheCols = getFields(reader);
      }
      boolean _oldWay = false;
      if (_oldWay) {
        warm(reader, preCacheCols, indexWarmup, sampleIndex, context, isClosed, pauseWarmup);
      } else {
        int blockSize = 8192;// @TODO
        int bufferSize = 1024 * 1024;// @TODO
        Map<String, OpenBitSet> filePartsToWarm = new HashMap<String, OpenBitSet>();
        for (String fieldName : preCacheCols) {
          indexWarmup.getFilePositionsToWarm(reader, sampleIndex, fieldName, context, filePartsToWarm, blockSize);
        }
        indexWarmup.warmFile(reader, filePartsToWarm, context, blockSize, bufferSize);
      }

    } finally {
      synchronized (_stops) {
        _stops.remove(stop);
View Full Code Here

TOP

Related Classes of org.apache.blur.lucene.warmup.IndexWarmup

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.