- java.lang.Object
-
- org.apache.lucene.sandbox.search.ProfilerCollector
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ProfilerCollector>
children
A list of "embedded" children collectorsprivate ProfilerCollectorWrapper
collector
The wrapped collectorprivate java.lang.String
collectorName
A more friendly representation of the Collector's class nameprivate java.lang.String
reason
A "hint" to help provide some context about this Collector
-
Constructor Summary
Constructors Constructor Description ProfilerCollector(Collector collector, java.lang.String reason, java.util.List<ProfilerCollector> children)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
deriveCollectorName(Collector c)
Creates a human-friendly representation of the Collector name.private static ProfilerCollectorResult
doGetCollectorTree(ProfilerCollector collector)
LeafCollector
getLeafCollector(LeafReaderContext context)
Create a newcollector
to collect the given context.java.lang.String
getName()
ProfilerCollectorResult
getProfileResult()
java.lang.String
getReason()
long
getTime()
ScoreMode
scoreMode()
Indicates what features are required from the scorer.void
setWeight(Weight weight)
Set theWeight
that will be used to produce scorers that will feedLeafCollector
s.
-
-
-
Field Detail
-
collectorName
private final java.lang.String collectorName
A more friendly representation of the Collector's class name
-
reason
private final java.lang.String reason
A "hint" to help provide some context about this Collector
-
collector
private final ProfilerCollectorWrapper collector
The wrapped collector
-
children
private final java.util.List<ProfilerCollector> children
A list of "embedded" children collectors
-
-
Constructor Detail
-
ProfilerCollector
public ProfilerCollector(Collector collector, java.lang.String reason, java.util.List<ProfilerCollector> children)
-
-
Method Detail
-
getTime
public long getTime()
- Returns:
- the profiled time for this collector (inclusive of children)
-
getReason
public java.lang.String getReason()
- Returns:
- a human readable "hint" about what this collector was used for
-
getName
public java.lang.String getName()
- Returns:
- the lucene class name of the collector
-
deriveCollectorName
protected java.lang.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 java.io.IOException
Description copied from interface:Collector
Create a newcollector
to collect the given context.- Specified by:
getLeafCollector
in interfaceCollector
- Parameters:
context
- next atomic reader context- Throws:
java.io.IOException
-
setWeight
public void setWeight(Weight weight)
Description copied from interface:Collector
Set theWeight
that will be used to produce scorers that will feedLeafCollector
s. This is typically useful to have access toWeight.count(org.apache.lucene.index.LeafReaderContext)
fromCollector.getLeafCollector(org.apache.lucene.index.LeafReaderContext)
.
-
scoreMode
public ScoreMode scoreMode()
Description copied from interface:Collector
Indicates what features are required from the scorer.
-
getProfileResult
public ProfilerCollectorResult getProfileResult()
-
doGetCollectorTree
private static ProfilerCollectorResult doGetCollectorTree(ProfilerCollector collector)
-
-