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.Stringalgorithmprivate java.lang.DoublecostEstimateprivate java.lang.Stringidprivate static java.lang.StringnewLineprivate java.lang.BooleannewScopeprivate java.util.List<GenericPlanNode>plansprivate static intprettyBoxDrawingTypeprivate java.lang.LongresultSizeActualprivate java.lang.DoubleresultSizeEstimateprivate static java.lang.String[]spocprivate java.lang.BooleantimedOutprivate java.lang.DoubletotalTimeActualprivate java.lang.Stringtypeprivate static java.lang.StringuniqueIdPrefixprivate static java.util.concurrent.atomic.AtomicLonguniqueIdSuffixstatic java.lang.StringUNKNOWN
-
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 voidaddPlans(GenericPlanNode... children)private voidappendCostAnnotation(java.lang.StringBuilder sb)java.lang.StringgetAlgorithm()Join nodes can use various algorithms for joining data.java.lang.DoublegetCostEstimate()The cost estimate that the query planner calculated for this node.private java.lang.StringgetHumanReadable(int prettyBoxDrawingType)java.lang.StringgetID()private static doublegetMaxResultSizeActual(GenericPlanNode genericPlanNode)private static doublegetMaxSelfTime(GenericPlanNode genericPlanNode)private static doublegetMaxTotalTime(GenericPlanNode genericPlanNode)java.util.List<GenericPlanNode>getPlans()private java.lang.StringgetProportionalRedColor(java.lang.Double max, java.lang.Double value)private java.lang.StringgetProportionalRedColor(java.lang.Double max, java.lang.Long value)java.lang.LonggetResultSizeActual()The actual number of results that this node produced while the query was executed.java.lang.DoublegetResultSizeEstimate()The number of results that this node was estimated to produce.java.lang.DoublegetSelfTimeActual()The time that this node used by itself (eg.java.lang.BooleangetTimedOut()java.lang.DoublegetTotalTimeActual()The total time in milliseconds that this node-tree (all children and so on) used while the query was executed.java.lang.StringgetType()java.lang.BooleanisNewScope()voidsetAlgorithm(java.lang.String algorithm)voidsetCostEstimate(java.lang.Double costEstimate)voidsetNewScope(boolean newScope)voidsetPlans(java.util.List<GenericPlanNode> plans)voidsetResultSizeActual(java.lang.Long resultSizeActual)voidsetResultSizeEstimate(java.lang.Double resultSizeEstimate)voidsetTimedOut(java.lang.Boolean timedOut)voidsetTotalTimeActual(java.lang.Double totalTimeActual)voidsetType(java.lang.String type)java.lang.StringtoDot()private java.lang.StringtoDotInternal(double maxResultSizeActual, double maxTotalTime, double maxSelfTime)private static java.lang.StringtoHumanReadableNumber(java.lang.Double number)private static java.lang.StringtoHumanReadableNumber(java.lang.Long number)private static java.lang.StringtoHumanReadableTime(java.lang.Double millis)java.lang.StringtoString()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:
toStringin 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()
-
-