Example usage for org.apache.lucene.index ConcurrentMergeScheduler disableAutoIOThrottle

List of usage examples for org.apache.lucene.index ConcurrentMergeScheduler disableAutoIOThrottle

Introduction

In this page you can find the example usage for org.apache.lucene.index ConcurrentMergeScheduler disableAutoIOThrottle.

Prototype

public synchronized void disableAutoIOThrottle() 

Source Link

Document

Turn off auto IO throttling.

Usage

From source file:perf.Indexer.java

License:Apache License

private static MergeScheduler getMergeScheduler(AtomicBoolean indexingFailed, boolean useCMS,
        int maxConcurrentMerges, boolean disableIOThrottle) {
    if (useCMS) {
        ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler() {
            @Override//from   w  w w  . j a v  a 2  s.  c o  m
            protected void handleMergeException(Directory dir, Throwable exc) {
                System.out.println("ERROR: CMS hit exception during merging; aborting...");
                indexingFailed.set(true);
                exc.printStackTrace(System.out);
                super.handleMergeException(dir, exc);
            }
        };
        cms.setMaxMergesAndThreads(maxConcurrentMerges + 4, maxConcurrentMerges);
        if (disableIOThrottle) {
            cms.disableAutoIOThrottle();
        }
        return cms;
    } else {
        // Gives better repeatability because if you use CMS, the order in which the merges complete can impact how the merge policy later
        // picks merges so you can easily get a very different index structure when you are comparing two indices:
        return new SerialMergeScheduler();
    }
}