Class GenericPlanNode

java.lang.Object
org.eclipse.rdf4j.query.explanation.GenericPlanNode

@Experimental public class GenericPlanNode extends Object
This is an experimental feature. The interface may be changed, moved or potentially removed in a future release.

The interface is used to implement query explanations (query plan)

Since:
3.2.0
  • Field Details

    • UNKNOWN

      public static final String UNKNOWN
      See Also:
    • uniqueIdPrefix

      private static final String uniqueIdPrefix
    • uniqueIdSuffix

      private static final AtomicLong uniqueIdSuffix
    • spoc

      private static final String[] spoc
    • newLine

      private static final String newLine
    • id

      private final String id
    • type

      private String type
    • timedOut

      private Boolean timedOut
    • costEstimate

      private Double costEstimate
    • resultSizeEstimate

      private Double resultSizeEstimate
    • resultSizeActual

      private Long resultSizeActual
    • totalTimeActual

      private Double totalTimeActual
    • newScope

      private Boolean newScope
    • algorithm

      private String algorithm
    • plans

      private List<GenericPlanNode> plans
    • prettyBoxDrawingType

      private static final int prettyBoxDrawingType
      See Also:
  • Constructor Details

    • GenericPlanNode

      public GenericPlanNode()
    • GenericPlanNode

      public GenericPlanNode(String type)
  • Method Details

    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getPlans

      public List<GenericPlanNode> getPlans()
    • setPlans

      public void setPlans(List<GenericPlanNode> plans)
    • addPlans

      public void addPlans(GenericPlanNode... children)
    • getCostEstimate

      public Double getCostEstimate()
      The cost estimate that the query planner calculated for this node. Value has no meaning outside of this explanation and is only used to compare and order the nodes in the query plan.
      Returns:
      a cost estimate as a double value
    • setCostEstimate

      public void setCostEstimate(Double costEstimate)
    • getResultSizeEstimate

      public Double getResultSizeEstimate()
      The number of results that this node was estimated to produce.
      Returns:
      result size estimate
    • setResultSizeEstimate

      public void setResultSizeEstimate(Double resultSizeEstimate)
    • getResultSizeActual

      public Long getResultSizeActual()
      The actual number of results that this node produced while the query was executed.
      Returns:
      number of results that this query produced
    • setResultSizeActual

      public void setResultSizeActual(Long resultSizeActual)
    • getTotalTimeActual

      public Double getTotalTimeActual()
      The total time in milliseconds that this node-tree (all children and so on) used while the query was executed.
      Returns:
      time in milliseconds that was used to execute the query
    • setTotalTimeActual

      public void setTotalTimeActual(Double totalTimeActual)
    • setTimedOut

      public void setTimedOut(Boolean timedOut)
    • getTimedOut

      public Boolean getTimedOut()
    • getSelfTimeActual

      public Double getSelfTimeActual()
      The time that this node used by itself (eg. totalTimeActual - sum of plans[0..n].totalTimeActual)
    • isNewScope

      public Boolean isNewScope()
      Returns:
      true if this node introduces a new scope
    • setNewScope

      public void setNewScope(boolean newScope)
    • getAlgorithm

      public String getAlgorithm()
      Join nodes can use various algorithms for joining data.
      Returns:
      the name of the algorithm.
    • setAlgorithm

      public void setAlgorithm(String algorithm)
    • toString

      public String toString()
      Human readable string. Do not attempt to parse this.
      Overrides:
      toString in class Object
      Returns:
      an unparsable string
    • getHumanReadable

      private String getHumanReadable(int prettyBoxDrawingType)
      Parameters:
      prettyBoxDrawingType - for deciding if we should use single or double walled character for drawing the connectors between nodes in the query plan. Eg. ├ or ╠ and ─ o
      Returns:
    • toHumanReadableNumber

      private static String toHumanReadableNumber(Double number)
      Returns:
      Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
    • toHumanReadableNumber

      private static String toHumanReadableNumber(Long number)
      Returns:
      Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
    • toHumanReadableTime

      private static String toHumanReadableTime(Double millis)
      Returns:
      Human readable time.
    • appendCostAnnotation

      private void appendCostAnnotation(StringBuilder sb)
    • toDot

      public String toDot()
    • getMaxTotalTime

      private static double getMaxTotalTime(GenericPlanNode genericPlanNode)
    • getMaxSelfTime

      private static double getMaxSelfTime(GenericPlanNode genericPlanNode)
    • getMaxResultSizeActual

      private static double getMaxResultSizeActual(GenericPlanNode genericPlanNode)
    • toDotInternal

      private String toDotInternal(double maxResultSizeActual, double maxTotalTime, double maxSelfTime)
    • getProportionalRedColor

      private String getProportionalRedColor(Double max, Double value)
    • getProportionalRedColor

      private String getProportionalRedColor(Double max, Long value)
    • getID

      public String getID()