Class CancellableCollector

  • All Implemented Interfaces:
    org.apache.lucene.search.Collector

    public class CancellableCollector
    extends org.apache.lucene.search.FilterCollector
    Collector that checks if the task it is executed under is cancelled.
    • Field Summary

      • Fields inherited from class org.apache.lucene.search.FilterCollector

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      CancellableCollector​(java.util.function.BooleanSupplier cancelled, org.apache.lucene.search.Collector in)
      Constructor
    • Method Summary

      Modifier and Type Method Description
      org.apache.lucene.search.LeafCollector getLeafCollector​(org.apache.lucene.index.LeafReaderContext context)  
      • Methods inherited from class org.apache.lucene.search.FilterCollector

        needsScores, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CancellableCollector

        public CancellableCollector​(java.util.function.BooleanSupplier cancelled,
                                    org.apache.lucene.search.Collector in)
        Constructor
        Parameters:
        cancelled - supplier of the cancellation flag, the supplier will be called for each segment
        in - wrapped collector
    • Method Detail

      • getLeafCollector

        public org.apache.lucene.search.LeafCollector getLeafCollector​(org.apache.lucene.index.LeafReaderContext context)
                                                                throws java.io.IOException
        Specified by:
        getLeafCollector in interface org.apache.lucene.search.Collector
        Overrides:
        getLeafCollector in class org.apache.lucene.search.FilterCollector
        Throws:
        java.io.IOException