Example usage for org.apache.lucene.index IndexWriter hasPendingMerges

List of usage examples for org.apache.lucene.index IndexWriter hasPendingMerges

Introduction

In this page you can find the example usage for org.apache.lucene.index IndexWriter hasPendingMerges.

Prototype

public synchronized boolean hasPendingMerges() 

Source Link

Document

Expert: returns true if there are merges waiting to be scheduled.

Usage

From source file:org.elasticsearch.index.engine.internal.AsynchronousEngine.java

License:Apache License

@Override
public boolean possibleMergeNeeded() {
    IndexWriter writer = this.indexWriter;
    if (writer == null) {
        return false;
    }//from  ww w.j ava  2s .  c  o m
    // a merge scheduler might bail without going through all its pending merges
    // so make sure we also check if there are pending merges
    return this.possibleMergeNeeded || writer.hasPendingMerges();
}