Class GenericPlanNode
- java.lang.Object
-
- org.eclipse.rdf4j.query.explanation.GenericPlanNode
-
@Experimental public class GenericPlanNode extends java.lang.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 Summary
Fields Modifier and Type Field Description private java.lang.String
algorithm
private java.lang.Double
costEstimate
private java.lang.String
id
private static java.lang.String
newLine
private java.lang.Boolean
newScope
private java.util.List<GenericPlanNode>
plans
private static int
prettyBoxDrawingType
private java.lang.Long
resultSizeActual
private java.lang.Double
resultSizeEstimate
private static java.lang.String[]
spoc
private java.lang.Boolean
timedOut
private java.lang.Double
totalTimeActual
private java.lang.String
type
private static java.lang.String
uniqueIdPrefix
private static java.util.concurrent.atomic.AtomicLong
uniqueIdSuffix
static java.lang.String
UNKNOWN
-
Constructor Summary
Constructors Constructor Description GenericPlanNode()
GenericPlanNode(java.lang.String type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPlans(GenericPlanNode... children)
private void
appendCostAnnotation(java.lang.StringBuilder sb)
java.lang.String
getAlgorithm()
Join nodes can use various algorithms for joining data.java.lang.Double
getCostEstimate()
The cost estimate that the query planner calculated for this node.private java.lang.String
getHumanReadable(int prettyBoxDrawingType)
java.lang.String
getID()
private static double
getMaxResultSizeActual(GenericPlanNode genericPlanNode)
private static double
getMaxSelfTime(GenericPlanNode genericPlanNode)
private static double
getMaxTotalTime(GenericPlanNode genericPlanNode)
java.util.List<GenericPlanNode>
getPlans()
private java.lang.String
getProportionalRedColor(java.lang.Double max, java.lang.Double value)
private java.lang.String
getProportionalRedColor(java.lang.Double max, java.lang.Long value)
java.lang.Long
getResultSizeActual()
The actual number of results that this node produced while the query was executed.java.lang.Double
getResultSizeEstimate()
The number of results that this node was estimated to produce.java.lang.Double
getSelfTimeActual()
The time that this node used by itself (eg.java.lang.Boolean
getTimedOut()
java.lang.Double
getTotalTimeActual()
The total time in milliseconds that this node-tree (all children and so on) used while the query was executed.java.lang.String
getType()
java.lang.Boolean
isNewScope()
void
setAlgorithm(java.lang.String algorithm)
void
setCostEstimate(java.lang.Double costEstimate)
void
setNewScope(boolean newScope)
void
setPlans(java.util.List<GenericPlanNode> plans)
void
setResultSizeActual(java.lang.Long resultSizeActual)
void
setResultSizeEstimate(java.lang.Double resultSizeEstimate)
void
setTimedOut(java.lang.Boolean timedOut)
void
setTotalTimeActual(java.lang.Double totalTimeActual)
void
setType(java.lang.String type)
java.lang.String
toDot()
private java.lang.String
toDotInternal(double maxResultSizeActual, double maxTotalTime, double maxSelfTime)
private static java.lang.String
toHumanReadableNumber(java.lang.Double number)
private static java.lang.String
toHumanReadableNumber(java.lang.Long number)
private static java.lang.String
toHumanReadableTime(java.lang.Double millis)
java.lang.String
toString()
Human readable string.
-
-
-
Field Detail
-
UNKNOWN
public static final java.lang.String UNKNOWN
- See Also:
- Constant Field Values
-
uniqueIdPrefix
private static final java.lang.String uniqueIdPrefix
-
uniqueIdSuffix
private static final java.util.concurrent.atomic.AtomicLong uniqueIdSuffix
-
spoc
private static final java.lang.String[] spoc
-
newLine
private static final java.lang.String newLine
-
id
private final java.lang.String id
-
type
private java.lang.String type
-
timedOut
private java.lang.Boolean timedOut
-
costEstimate
private java.lang.Double costEstimate
-
resultSizeEstimate
private java.lang.Double resultSizeEstimate
-
resultSizeActual
private java.lang.Long resultSizeActual
-
totalTimeActual
private java.lang.Double totalTimeActual
-
newScope
private java.lang.Boolean newScope
-
algorithm
private java.lang.String algorithm
-
plans
private java.util.List<GenericPlanNode> plans
-
prettyBoxDrawingType
private static final int prettyBoxDrawingType
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public java.lang.String getType()
-
setType
public void setType(java.lang.String type)
-
getPlans
public java.util.List<GenericPlanNode> getPlans()
-
setPlans
public void setPlans(java.util.List<GenericPlanNode> plans)
-
addPlans
public void addPlans(GenericPlanNode... children)
-
getCostEstimate
public java.lang.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(java.lang.Double costEstimate)
-
getResultSizeEstimate
public java.lang.Double getResultSizeEstimate()
The number of results that this node was estimated to produce.- Returns:
- result size estimate
-
setResultSizeEstimate
public void setResultSizeEstimate(java.lang.Double resultSizeEstimate)
-
getResultSizeActual
public java.lang.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(java.lang.Long resultSizeActual)
-
getTotalTimeActual
public java.lang.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(java.lang.Double totalTimeActual)
-
setTimedOut
public void setTimedOut(java.lang.Boolean timedOut)
-
getTimedOut
public java.lang.Boolean getTimedOut()
-
getSelfTimeActual
public java.lang.Double getSelfTimeActual()
The time that this node used by itself (eg. totalTimeActual - sum of plans[0..n].totalTimeActual)
-
isNewScope
public java.lang.Boolean isNewScope()
- Returns:
- true if this node introduces a new scope
-
setNewScope
public void setNewScope(boolean newScope)
-
getAlgorithm
public java.lang.String getAlgorithm()
Join nodes can use various algorithms for joining data.- Returns:
- the name of the algorithm.
-
setAlgorithm
public void setAlgorithm(java.lang.String algorithm)
-
toString
public java.lang.String toString()
Human readable string. Do not attempt to parse this.- Overrides:
toString
in classjava.lang.Object
- Returns:
- an unparsable string
-
getHumanReadable
private java.lang.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 java.lang.String toHumanReadableNumber(java.lang.Double number)
- Returns:
- Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
-
toHumanReadableNumber
private static java.lang.String toHumanReadableNumber(java.lang.Long number)
- Returns:
- Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
-
toHumanReadableTime
private static java.lang.String toHumanReadableTime(java.lang.Double millis)
- Returns:
- Human readable time.
-
appendCostAnnotation
private void appendCostAnnotation(java.lang.StringBuilder sb)
-
toDot
public java.lang.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 java.lang.String toDotInternal(double maxResultSizeActual, double maxTotalTime, double maxSelfTime)
-
getProportionalRedColor
private java.lang.String getProportionalRedColor(java.lang.Double max, java.lang.Double value)
-
getProportionalRedColor
private java.lang.String getProportionalRedColor(java.lang.Double max, java.lang.Long value)
-
getID
public java.lang.String getID()
-
-