|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDProcessingDAG
public class ALDProcessingDAG
This class handles the construction of a processing DAG from opNode instances and writing this processing history as extended graphml to file.
Nested Class Summary | |
---|---|
static class |
ALDProcessingDAG.HistoryType
Type of the processing history to be generated. |
Field Summary | |
---|---|
private java.util.Vector<ALDDataPort> |
allDataports
|
private java.util.Vector<ALDEdge> |
allEdges
|
private java.util.Vector<ALDOpNode> |
allOpNodes
|
private static boolean |
debug
debug flag for debugging output. |
private int |
graphIndex
This index is the index used to build the prefix for all Ids for elements for the next history to add to the current graphml. |
private ALDProcessingDAG.HistoryType |
historyType
Type of the history to be genrerated. |
static char |
idSeparator
Character separating graphId prefix from rest |
private boolean |
ignoreHiding
Ignore hidden flag of opnodes when creating a processing history. |
private java.util.Vector<ALDOpNodePort> |
opNodePortsTraced
|
private java.util.Vector<ALDOpNode> |
opNodesClone
|
private java.util.Vector<ALDOpNode> |
opNodesInGraph
|
private java.util.Vector<ALDDataPort> |
writtenDataports
|
Constructor Summary | |
---|---|
ALDProcessingDAG()
|
Method Summary | |
---|---|
private void |
addAttrToEdge(org.graphdrawing.graphml.xmlns.EdgeType edge,
java.lang.String key,
java.lang.String value)
Add an attribute to a graphml edge |
private void |
addAttrToGraph(org.graphdrawing.graphml.xmlns.GraphType graph,
java.lang.String key,
java.lang.String value)
Add an attribute to a graphml graph |
private void |
addAttrToGraphml(org.graphdrawing.graphml.xmlns.GraphmlType graphml,
java.lang.String key,
java.lang.String value)
Add an attribute to a graphml element |
private void |
addAttrToNode(org.graphdrawing.graphml.xmlns.NodeType node,
java.lang.String key,
java.lang.String value)
Add an attribute to a graphml node |
private void |
addAttrToPort(org.graphdrawing.graphml.xmlns.PortType port,
java.lang.String key,
java.lang.String value)
Add an attribute to a graphml port |
private org.graphdrawing.graphml.xmlns.NodeType |
addDataPortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDDataPort dataport)
Add a data port to the graphML graph |
private void |
addEdge(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDPort sourcePort,
ALDPort targetPort,
int idx)
Add an graphml edge to graph with index idx |
private void |
addGraphmlHistory(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDDataPort dataport)
Add the complete history of an object represented by a data port, which was read from a graphml file, to a graph object. |
private void |
addKey(org.graphdrawing.graphml.xmlns.GraphmlType graphml,
java.lang.String id,
org.graphdrawing.graphml.xmlns.KeyForType.Enum domain,
java.lang.String name,
org.graphdrawing.graphml.xmlns.KeyTypeType.Enum keyType)
add a key definition to graphml |
private org.graphdrawing.graphml.xmlns.NodeType |
addOpNodePortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDOpNodePort port)
Add a opNode port object to the graphML graph |
private org.graphdrawing.graphml.xmlns.NodeType |
addOpNodeToGraph(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDOpNode opNode)
Add an opNode to the graph of the enclosing opNode. |
private void |
addParameterHash(org.graphdrawing.graphml.xmlns.NodeType node,
ALDOpNode opNode)
Add the parameter hash to to a graphml node. |
private void |
addXmlHistory(org.graphdrawing.graphml.xmlns.NodeType node,
org.apache.xmlbeans.XmlObject xmlHistory)
Add the complete history of a ALDData from a generic XML file to a graphml node. |
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(java.lang.Object sourceObjOfHistory)
Create the processing history for sourceObjOfHistory and convert to graphml object. |
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(java.lang.Object sourceObjOfHistory,
ALDProcessingDAG.HistoryType historyType)
Create the processing history for sourceObjOfHistory and convert to graphml object. |
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(java.lang.Object sourceObjOfHistory,
ALDProcessingDAG.HistoryType historyType,
boolean ignoreHiding)
Create the processing history for sourceObjOfHistory and convert to graphml object. |
private void |
fatal(java.lang.String msg)
Output fatal error to stderr and throw an exception |
private void |
findSibblingsAndParent(ALDOpNode opNode,
java.util.Vector<ALDInputPort> inputPorts,
int depth)
Find all sibblings and the parent of opNode. |
private java.lang.String |
getDataPortId(ALDDataPort dataport)
Return an ID used in graphml for a data port |
static boolean |
getDebug()
Return the debug state |
(package private) static java.lang.String |
getGraphId(java.lang.String id)
Get the graphIP at the beginning of an id up (exculing) idSeparator |
(package private) static java.lang.String |
getGraphName(int idx)
Return an ID used in graphml for graph |
private java.lang.String |
getOpNodeId(ALDOpNode opNode)
Return an ID used in graphml an opNode |
private java.lang.String |
getPortId(ALDPort p)
Return an ID used in graphml for a port |
private void |
handleInputPorts(ALDOpNode parentOpNode,
java.util.Vector<ALDInputPort> inputPorts,
java.util.Vector<ALDInputPort> parentsInputports,
java.util.LinkedList<ALDOutputPort> outputPortToTraceback)
Trace back each port of inputPorts which are input ports of a child of parentOpNode. |
private void |
handlePort(ALDOpNode opNode,
ALDPort port)
Handle a port to register the incoming edge and to potentially register dataport to opNode. |
private void |
inconsistent(java.lang.String msg)
Output error to stderr |
private boolean |
isCompleteOpnode(ALDOpNode opNode)
Is a complete history to be created for this opNode? |
private boolean |
isHiddenOpnode(ALDOpNode opNode)
Should we hide this opnode. |
private boolean |
isToplevelOpnode(ALDOpNode opNode)
Is this an opNode of the toplevel operator. |
private void |
outputOpNode(ALDOpNode opNode,
org.graphdrawing.graphml.xmlns.GraphType graph)
Output opNode and it ports, and recursively its children to the graph . |
private void |
register(ALDOpNode opNode,
ALDDataPort dataport)
Register the dataport as directly included in opNode. |
private void |
register(ALDOpNode parentOpNode,
ALDOpNode opNode)
Register an opNode as child to its parents if not already found directly or indirectly before. |
(package private) static java.lang.String |
removeGraphId(java.lang.String id)
Remove the graphIP including idSeparator at the beginning of an id |
static void |
setDebug(boolean value)
Set the debug state |
private void |
tracebackDAG(java.lang.Object sourceObjOfHistory)
Trace back the implicit DAG created during processing for sourceObjOfHistory. |
private java.util.Vector<ALDInputPort> |
visitOpNode(ALDOpNode opNode,
ALDOutputPort portOfInterest,
int depth)
Visit the opNode either completely or according to data dependency as define by the opNode and the globale state of the processing DAG. |
private java.util.Vector<ALDInputPort> |
visitOpNodeComplete(ALDOpNode opNode,
int depth)
Completely visits this opNode. |
private java.util.Vector<ALDInputPort> |
visitOpNodeDatadependency(ALDOpNode opNode,
ALDOutputPort portOfInterest,
int depth)
Visit the opNode detecting all inner children and data ports on which the output port of interest portOfInterest depends on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<ALDDataPort> allDataports
private java.util.Vector<ALDEdge> allEdges
private java.util.Vector<ALDOpNode> allOpNodes
private static boolean debug
private int graphIndex
private ALDProcessingDAG.HistoryType historyType
public static final char idSeparator
private boolean ignoreHiding
private java.util.Vector<ALDOpNodePort> opNodePortsTraced
private java.util.Vector<ALDOpNode> opNodesClone
private java.util.Vector<ALDOpNode> opNodesInGraph
private java.util.Vector<ALDDataPort> writtenDataports
Constructor Detail |
---|
public ALDProcessingDAG()
Method Detail |
---|
private void addAttrToEdge(org.graphdrawing.graphml.xmlns.EdgeType edge, java.lang.String key, java.lang.String value)
private void addAttrToGraph(org.graphdrawing.graphml.xmlns.GraphType graph, java.lang.String key, java.lang.String value)
private void addAttrToGraphml(org.graphdrawing.graphml.xmlns.GraphmlType graphml, java.lang.String key, java.lang.String value)
private void addAttrToNode(org.graphdrawing.graphml.xmlns.NodeType node, java.lang.String key, java.lang.String value)
private void addAttrToPort(org.graphdrawing.graphml.xmlns.PortType port, java.lang.String key, java.lang.String value)
private org.graphdrawing.graphml.xmlns.NodeType addDataPortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph, ALDDataPort dataport) throws ALDProcessingDAGException
ALDProcessingDAGException
private void addEdge(org.graphdrawing.graphml.xmlns.GraphType graph, ALDPort sourcePort, ALDPort targetPort, int idx) throws ALDProcessingDAGException
graph
with index idx
ALDProcessingDAGException
private void addGraphmlHistory(org.graphdrawing.graphml.xmlns.GraphType graph, ALDDataPort dataport) throws ALDProcessingDAGException
graph
- Graph to add the history read from filedataport
-
ALDProcessingDAGException
private void addKey(org.graphdrawing.graphml.xmlns.GraphmlType graphml, java.lang.String id, org.graphdrawing.graphml.xmlns.KeyForType.Enum domain, java.lang.String name, org.graphdrawing.graphml.xmlns.KeyTypeType.Enum keyType)
private org.graphdrawing.graphml.xmlns.NodeType addOpNodePortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph, ALDOpNodePort port) throws ALDProcessingDAGException
ALDProcessingDAGException
private org.graphdrawing.graphml.xmlns.NodeType addOpNodeToGraph(org.graphdrawing.graphml.xmlns.GraphType graph, ALDOpNode opNode)
private void addParameterHash(org.graphdrawing.graphml.xmlns.NodeType node, ALDOpNode opNode)
private void addXmlHistory(org.graphdrawing.graphml.xmlns.NodeType node, org.apache.xmlbeans.XmlObject xmlHistory)
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(java.lang.Object sourceObjOfHistory) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.
The complete history according is created. This method is
equivalent to createGraphmlDocument( sourceObjOfHistory, HistoryType.COMPLETE, false)
.
sourceObjOfHistory
- for which the processing history to be created.
ALDProcessingDAGException
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(java.lang.Object sourceObjOfHistory, ALDProcessingDAG.HistoryType historyType) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.
This method is equivalent to createGraphmlDocument( sourceObjOfHistory, historyType, false)
.
sourceObjOfHistory
- for which the processing history to be written.historyType
- type/moude of history to be created.
ALDProcessingDAGException
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(java.lang.Object sourceObjOfHistory, ALDProcessingDAG.HistoryType historyType, boolean ignoreHiding) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.
sourceObjOfHistory
- for which the processing history to be written.historyType
- type/moude of history to be created.ignoreHiding
- if true hiding of opnodes is ignores, i.e. all opnodes
added to the history.
ALDProcessingDAGException
private void fatal(java.lang.String msg) throws ALDProcessingDAGException
ALDProcessingDAGException
private void findSibblingsAndParent(ALDOpNode opNode, java.util.Vector<ALDInputPort> inputPorts, int depth) throws ALDProcessingDAGException
findSibblingsAndParent invokes itself recursively using the input ports of the parent on which the history of the parent depends on. These are all input ports if we visit the parent completely, otherwise the data dependencies of the inputPorts. The recursion terminates at the toplevel operator.
ALDProcessingDAGException
private java.lang.String getDataPortId(ALDDataPort dataport)
public static boolean getDebug()
static java.lang.String getGraphId(java.lang.String id)
static java.lang.String getGraphName(int idx)
private java.lang.String getOpNodeId(ALDOpNode opNode)
private java.lang.String getPortId(ALDPort p) throws ALDProcessingDAGException
ALDProcessingDAGException
private void handleInputPorts(ALDOpNode parentOpNode, java.util.Vector<ALDInputPort> inputPorts, java.util.Vector<ALDInputPort> parentsInputports, java.util.LinkedList<ALDOutputPort> outputPortToTraceback) throws ALDProcessingDAGException
ALDProcessingDAGException
private void handlePort(ALDOpNode opNode, ALDPort port) throws ALDProcessingDAGException
ALDProcessingDAGException
private void inconsistent(java.lang.String msg)
private boolean isCompleteOpnode(ALDOpNode opNode)
private boolean isHiddenOpnode(ALDOpNode opNode)
private boolean isToplevelOpnode(ALDOpNode opNode)
private void outputOpNode(ALDOpNode opNode, org.graphdrawing.graphml.xmlns.GraphType graph) throws ALDProcessingDAGException
opNode
and it ports, and recursively its children to the graph
.
An opNode is represented by an node and contains a (graphml) graph as
is containts nested ports and further opNodes.
ALDProcessingDAGException
private void register(ALDOpNode opNode, ALDDataPort dataport)
private void register(ALDOpNode parentOpNode, ALDOpNode opNode)
static java.lang.String removeGraphId(java.lang.String id)
public static void setDebug(boolean value)
value
- New debug stateprivate void tracebackDAG(java.lang.Object sourceObjOfHistory) throws ALDProcessingDAGException
sourceObjOfHistory
- Object for which the processing history is to be created
ALDProcessingDAGException
private java.util.Vector<ALDInputPort> visitOpNode(ALDOpNode opNode, ALDOutputPort portOfInterest, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
private java.util.Vector<ALDInputPort> visitOpNodeComplete(ALDOpNode opNode, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
private java.util.Vector<ALDInputPort> visitOpNodeDatadependency(ALDOpNode opNode, ALDOutputPort portOfInterest, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |