Package org.apache.lucene.sandbox.search
Class ProfilerCollector
- java.lang.Object
-
- org.apache.lucene.sandbox.search.ProfilerCollector
-
-
Constructor Summary
Constructors Constructor Description ProfilerCollector(Collector collector, String reason, List<ProfilerCollector> children)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringderiveCollectorName(Collector c)Creates a human-friendly representation of the Collector name.LeafCollectorgetLeafCollector(LeafReaderContext context)StringgetName()ProfilerCollectorResultgetProfileResult()StringgetReason()longgetTime()ScoreModescoreMode()voidsetWeight(Weight weight)
-
-
-
Constructor Detail
-
ProfilerCollector
public ProfilerCollector(Collector collector, String reason, List<ProfilerCollector> children)
-
-
Method Detail
-
getTime
public long getTime()
- Returns:
- the profiled time for this collector (inclusive of children)
-
getReason
public String getReason()
- Returns:
- a human readable "hint" about what this collector was used for
-
getName
public String getName()
- Returns:
- the lucene class name of the collector
-
deriveCollectorName
protected String deriveCollectorName(Collector c)
Creates a human-friendly representation of the Collector name. Override to customize how the name is derived.- Parameters:
c- The Collector to derive a name from- Returns:
- A (hopefully) prettier name
-
getLeafCollector
public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException
- Specified by:
getLeafCollectorin interfaceCollector- Throws:
IOException
-
getProfileResult
public ProfilerCollectorResult getProfileResult()
-
-