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.1We 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 classVariableProcessor.VariableResponseThis type is essentially a way to return theVariableIDand to indicate if we need to process the children of this variable.
-
Field Summary
Fields Modifier and Type Field Description protected FrameConfigframeConfigSome 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 voidappendChild(String parentId, VariableID variableId)protected voidappendVariable(String varId, Variable variable)protected booleancheckDepth(int depth)protected StringcheckId(String identity)protected booleancheckVarCount()protected Map<String,Variable>closeLookup()voidconfigureSelf(Iterable<TracePointConfig> configs)We need to configure theframeConfigbased on the tracepoints we are capturing.protected StringnewVarId(String identity)protected Set<Node>processChildNodes(VariableID variableId, Object value, int depth)protected VariableProcessor.VariableResponseprocessVariable(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. ThisFrameConfigcalculates the most encompassing config for all triggered tracepoints.
-
-
Method Detail
-
configureSelf
public void configureSelf(Iterable<TracePointConfig> configs)
We need to configure theframeConfigbased 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 thevarCachethen 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()
-
-