Class VariableProcessor
- java.lang.Object
-
- com.intergral.deep.agent.tracepoint.handler.VariableProcessor
-
- Direct Known Subclasses:
FrameCollector
public abstract class VariableProcessor extends Object
This type deals with processing the variables. Dealing with:- type definition - how the type of the variable is captured
- string values - how the string representation of the variable value is captured
- child variables - how many child variables are processed
- variable limits - total limits on how many variables are processed
- depth limits - how deep will process down the reference chain
- variable deduplication - ensuring we do not process the same variable multiple times
- variable referencing - using variable ids to reference already processed variables
While processing a variable or frame, we will process using a Breadth first approach. These means given the tree:
1 -> 1.1 1.2 1.3 -> 1.3.1 2 -> 2.1 3 -> 3.1 -> 3.1.1
We will attempt to gather the variables in the order:- 1
- 2
- 3
- 1.1
- 1.2
- 1.3
- 2.1
- 3.1
- 1.3.1
- 3.1.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
VariableProcessor.VariableResponse
This type is essentially a way to return theVariableID
and to indicate if we need to process the children of this variable.
-
Field Summary
Fields Modifier and Type Field Description protected FrameConfig
frameConfig
Some config values from the triggered tracepoints affect all tracepoints at the point of collection.
-
Constructor Summary
Constructors Constructor Description VariableProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendChild(String parentId, VariableID variableId)
protected void
appendVariable(String varId, Variable variable)
protected boolean
checkDepth(int depth)
protected String
checkId(String identity)
protected boolean
checkVarCount()
protected Map<String,Variable>
closeLookup()
void
configureSelf(Iterable<TracePointConfig> configs)
We need to configure theframeConfig
based on the tracepoints we are capturing.protected String
newVarId(String identity)
protected Set<Node>
processChildNodes(VariableID variableId, Object value, int depth)
protected VariableProcessor.VariableResponse
processVariable(Node.NodeValue value)
Process the given node into aVariableProcessor.VariableResponse
.
-
-
-
Field Detail
-
frameConfig
protected final FrameConfig frameConfig
Some config values from the triggered tracepoints affect all tracepoints at the point of collection. ThisFrameConfig
calculates the most encompassing config for all triggered tracepoints.
-
-
Method Detail
-
configureSelf
public void configureSelf(Iterable<TracePointConfig> configs)
We need to configure theframeConfig
based on the tracepoints we are capturing.- Parameters:
configs
- the tracepoints to configure with
-
processChildNodes
protected Set<Node> processChildNodes(VariableID variableId, Object value, int depth)
-
processVariable
protected VariableProcessor.VariableResponse processVariable(Node.NodeValue value)
Process the given node into aVariableProcessor.VariableResponse
.If the provided value has already been processed, ie the
System.identityHashCode(Object)
of the object is already in thevarCache
then we do not process the variable, and simply return a pointer to the reference.If the value has not already been process then we must gather the type, value, children etc. Then process the data into the
varLookup
.- Parameters:
value
- the node value to process- Returns:
- the
VariableProcessor.VariableResponse
-
appendChild
protected void appendChild(String parentId, VariableID variableId)
-
checkDepth
protected boolean checkDepth(int depth)
-
checkVarCount
protected boolean checkVarCount()
-
-