InternalAggregationProfileTree
public abstract class AbstractInternalProfileTree<PB extends AbstractProfileBreakdown<?>,E>
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected java.util.ArrayList<E> |
elements |
A list of the original queries, keyed by index position
|
protected java.util.ArrayList<java.lang.Integer> |
roots |
A list of top-level "roots".
|
protected java.util.Deque<java.lang.Integer> |
stack |
A temporary stack used to record where we are in the dependency tree.
|
protected java.util.ArrayList<PB> |
timings |
|
protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
tree |
Maps the Query to it's list of children.
|
Constructor | Description |
---|---|
AbstractInternalProfileTree() |
Modifier and Type | Method | Description |
---|---|---|
protected abstract PB |
createProfileBreakdown() |
|
protected abstract java.lang.String |
getDescriptionFromElement(E element) |
|
PB |
getProfileBreakdown(E query) |
Returns a
QueryProfileBreakdown for a scoring query. |
java.util.List<ProfileResult> |
getTree() |
After the query has been run and profiled, we need to merge the flat timing map
with the dependency graph to build a data structure that mirrors the original
query tree
|
protected abstract java.lang.String |
getTypeFromElement(E element) |
|
void |
pollLast() |
Removes the last (e.g.
|
protected java.util.ArrayList<PB extends AbstractProfileBreakdown<?>> timings
protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> tree
protected java.util.ArrayList<E> elements
protected java.util.ArrayList<java.lang.Integer> roots
protected java.util.Deque<java.lang.Integer> stack
public PB getProfileBreakdown(E query)
QueryProfileBreakdown
for a scoring query. Scoring queries (e.g. those
that are past the rewrite phase and are now being wrapped by createWeight() ) follow
a recursive progression. We can track the dependency tree by a simple stack
The only hiccup is that the first scoring query will be identical to the last rewritten
query, so we need to take special care to fix thatquery
- The scoring query we wish to profileprotected abstract PB createProfileBreakdown()
public void pollLast()
public java.util.List<ProfileResult> getTree()
protected abstract java.lang.String getTypeFromElement(E element)
protected abstract java.lang.String getDescriptionFromElement(E element)