Class AbstractInternalProfileTree<PB extends AbstractProfileBreakdown<?>,​E>

org.elasticsearch.search.profile.AbstractInternalProfileTree<PB,​E>
Direct Known Subclasses:
InternalAggregationProfileTree

public abstract class AbstractInternalProfileTree<PB extends AbstractProfileBreakdown<?>,​E> extends
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected <PB>
     
    protected <E>
    A list of the original queries, keyed by index position
    protected <>
    A list of top-level "roots".
    protected <>
    A temporary stack used to record where we are in the dependency tree.
    protected <<>>
    Maps the Query to it's list of children.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract PB
     
    protected abstract
     
    Returns a QueryProfileBreakdown for a scoring query.
    After the element 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
    getTypeFromElement​(E element)
     
    void
    Removes the last (e.g.

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Field Details

    • breakdowns

      protected <PB extends AbstractProfileBreakdown<?>> breakdowns
    • tree

      protected <<>> tree
      Maps the Query to it's list of children. This is basically the dependency tree
    • elements

      protected <E> elements
      A list of the original queries, keyed by index position
    • roots

      protected <> roots
      A list of top-level "roots". Each root can have its own tree of profiles
    • stack

      protected <> stack
      A temporary stack used to record where we are in the dependency tree.
  • Constructor Details

    • AbstractInternalProfileTree

      public AbstractInternalProfileTree()
  • Method Details

    • getProfileBreakdown

      public PB getProfileBreakdown(E query)
      Returns a 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 that
      Parameters:
      query - The scoring query we wish to profile
      Returns:
      A ProfileBreakdown for this query
    • createProfileBreakdown

      protected abstract PB createProfileBreakdown()
    • pollLast

      public void pollLast()
      Removes the last (e.g. most recent) value on the stack
    • getTree

      public <ProfileResult> getTree()
      After the element 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
      Returns:
      a hierarchical representation of the profiled query tree
    • getTypeFromElement

      protected abstract  getTypeFromElement(E element)
    • getDescriptionFromElement

      protected abstract  getDescriptionFromElement(E element)