Class InternalProfileCollector

java.lang.Object
org.apache.lucene.sandbox.search.ProfilerCollector
org.elasticsearch.search.profile.query.InternalProfileCollector
All Implemented Interfaces:
org.apache.lucene.search.Collector, TwoPhaseCollector

public class InternalProfileCollector extends org.apache.lucene.sandbox.search.ProfilerCollector implements TwoPhaseCollector
This class wraps a Lucene Collector and times the execution of: - setScorer() - collect() - doSetNextReader() - needsScores()

InternalProfiler facilitates the linking of the Collector graph

  • Constructor Details

    • InternalProfileCollector

      public InternalProfileCollector(org.apache.lucene.search.Collector collector, String reason, InternalProfileCollector... children)
  • Method Details

    • getWrappedCollector

      public org.apache.lucene.search.Collector getWrappedCollector()
    • deriveCollectorName

      protected String deriveCollectorName(org.apache.lucene.search.Collector c)
      Creates a human-friendly representation of the Collector name.

      InternalBucket Collectors use the aggregation name in their toString() method, which makes the profiled output a bit nicer.

      Overrides:
      deriveCollectorName in class org.apache.lucene.sandbox.search.ProfilerCollector
      Parameters:
      c - The Collector to derive a name from
      Returns:
      A (hopefully) prettier name
    • getCollectorTree

      public CollectorResult getCollectorTree()
    • doPostCollection

      public void doPostCollection() throws IOException
      Description copied from interface: TwoPhaseCollector
      run post-collection phase
      Specified by:
      doPostCollection in interface TwoPhaseCollector
      Throws:
      IOException