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 Summary
ConstructorsConstructorDescriptionInternalProfileCollector
(org.apache.lucene.search.Collector collector, String reason, List<? extends InternalProfileComponent> children) -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends InternalProfileComponent>
children()
org.apache.lucene.search.Collector
org.apache.lucene.search.LeafCollector
getLeafCollector
(org.apache.lucene.index.LeafReaderContext context) getName()
long
getTime()
org.apache.lucene.search.ScoreMode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.Collector
setWeight
-
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 interfaceInternalProfileComponent
- Returns:
- the profiled time for this collector (inclusive of children)
-
getReason
- Specified by:
getReason
in interfaceInternalProfileComponent
- Returns:
- a human readable "hint" about what this collector was used for
-
getName
- Specified by:
getName
in interfaceInternalProfileComponent
- 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 interfaceorg.apache.lucene.search.Collector
- Throws:
IOException
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()- Specified by:
scoreMode
in interfaceorg.apache.lucene.search.Collector
-
children
- Specified by:
children
in interfaceInternalProfileComponent
- Returns:
- the children of this profile component (if any)
-
getCollectorTree
- Specified by:
getCollectorTree
in interfaceInternalProfileComponent
- Returns:
- the profiling results for this profile component
-