Class InternalProfileCollector

java.lang.Object
org.opensearch.search.profile.query.InternalProfileCollector
All Implemented Interfaces:
org.apache.lucene.search.Collector, InternalProfileComponent

public class InternalProfileCollector extends Object implements org.apache.lucene.search.Collector, InternalProfileComponent
This class wraps a Lucene Collector and times the execution of: - setScorer() - collect() - doSetNextReader() - needsScores() InternalProfiler facilitates the linking of the Collector graph
Opensearch.internal:
  • Constructor Details

    • InternalProfileCollector

      public InternalProfileCollector(org.apache.lucene.search.Collector collector, String reason, List<? extends InternalProfileComponent> children)
  • Method Details

    • getTime

      public long getTime()
      Specified by:
      getTime in interface InternalProfileComponent
      Returns:
      the profiled time for this collector (inclusive of children)
    • getReason

      public String getReason()
      Specified by:
      getReason in interface InternalProfileComponent
      Returns:
      a human readable "hint" about what this collector was used for
    • getName

      public String getName()
      Specified by:
      getName in interface InternalProfileComponent
      Returns:
      the lucene class name of the collector
    • getCollector

      public org.apache.lucene.search.Collector getCollector()
      Returns:
      the underlying collector instance being profiled
    • getLeafCollector

      public org.apache.lucene.search.LeafCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext context) throws IOException
      Specified by:
      getLeafCollector in interface org.apache.lucene.search.Collector
      Throws:
      IOException
    • scoreMode

      public org.apache.lucene.search.ScoreMode scoreMode()
      Specified by:
      scoreMode in interface org.apache.lucene.search.Collector
    • children

      public Collection<? extends InternalProfileComponent> children()
      Specified by:
      children in interface InternalProfileComponent
      Returns:
      the children of this profile component (if any)
    • getCollectorTree

      public CollectorResult getCollectorTree()
      Specified by:
      getCollectorTree in interface InternalProfileComponent
      Returns:
      the profiling results for this profile component