Class QueryModelTreePrinter

  • All Implemented Interfaces:
    QueryModelVisitor<java.lang.RuntimeException>

    public class QueryModelTreePrinter
    extends AbstractQueryModelVisitor<java.lang.RuntimeException>
    QueryModelVisitor implementation that "prints" a tree representation of a query model. The tree representations is printed to an internal character buffer and can be retrieved using getTreeString(). As an alternative, the static utility method printTree(QueryModelNode) can be used.
    • Field Detail

      • LINE_SEPARATOR

        private static final java.lang.String LINE_SEPARATOR
      • sb

        private final java.lang.StringBuilder sb
      • indentLevel

        private int indentLevel
    • Constructor Detail

      • QueryModelTreePrinter

        public QueryModelTreePrinter()
    • Method Detail

      • printTree

        public static java.lang.String printTree​(QueryModelNode node)
      • getTreeString

        public java.lang.String getTreeString()
      • meetNode

        protected void meetNode​(QueryModelNode node)
        Description copied from class: AbstractQueryModelVisitor
        Method called by all of the other meet methods that are not overridden in subclasses. This method can be overridden in subclasses to define default behaviour when visiting nodes. The default behaviour of this method is to visit the node's children.
        Overrides:
        meetNode in class AbstractQueryModelVisitor<java.lang.RuntimeException>
        Parameters:
        node - The node that is being visited.
      • toHumanReadableNumber

        static java.lang.String toHumanReadableNumber​(double number)
        Returns:
        Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
      • toHumanReadableTime

        static java.lang.String toHumanReadableTime​(long nanos)
        Returns:
        Human readable time.
      • appendCostAnnotation

        private static void appendCostAnnotation​(QueryModelNode node,
                                                 java.lang.StringBuilder sb)