| java.lang.Object org.griphyn.vdl.router.BookKeeper
BookKeeper | public class BookKeeper (Code) | | This class stores state when constructing the DAG for output. It
is expected that for each DAG generation, one instance of this
class performs the state tracking. The class is tightly coupled
to the class that performs the routing.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: Route |
Field Summary | |
final static String | XXXXXX String constant describing the six X. |
Constructor Summary | |
public | BookKeeper() Default ctor. |
Method Summary | |
public void | addFilenames(Collection lfnset) This method helps to track the input and output files. | public boolean | addJob(Job job) Accessor: Appends a job definition to the DAX structure. | public boolean | addParent(HasPass current, Set parents) | public boolean | addVisited(HasPass current, Set real) This method marks a derivation as visited in the set of visited nodes.
Parameters: current - is the caller to add to the visited node set. Parameters: real - is the value to add for the given caller. | public String | createTempName(String hint, String suffix) Creates a unique temporary filename. | public java.util.List | getAllProfiles() Accessor: obtains all profiles on the profile stack. | public String | getAllTransformations() Accessor: obtains all transformations that were pushed as space
separated string. | public HasPass | getCurrent() Obtains the current cursor position. | public ADAG | getDAX(String name) Accessor: Returns the constructed internal DAX keeper.
the abstract DAX description. | public Set | getVisited(HasPass dv) | public boolean | isEmpty() Detects valid results in the ADAG as opposed to an empty shell. | public String | jobOf(String id) Obtains an existing mapping of a DV indentification to a job id. | public String | mapJob(String id) Maps a DV identification to a name that can be put into the XML
datatypes NMTOKEN, ID and IDREF. | public java.util.List | popProfile() Accessor: pop a vector of profiles from the profile stack. | public String | popTransformation() Accessor: pop an FQDI from the stack of transformations. | public void | pushProfile(java.util.List profiles) Accessor: push a vector of profiles down the profile stack. | public void | pushTransformation(String fqdi) Accessor: push the FQDI of a transformation onto a stack. | public void | setCurrent(HasPass dv) This method updates the "cursor" position with a new derivation. | public void | toString(Writer stream) This method is a possibly more memory efficient version of
constructing a DAG. | public String | toString() dumps the state of this object into human readable format. | public void | toXML(Writer stream, String indent, String namespace) This method is a possibly more memory efficient version of
constructing a DAX. | public void | toXML(Writer stream, String indent) This method is a possibly more memory efficient version of
constructing a DAX. | public String | toXML(String indent, String namespace) Dumps the state of this object into machine readable XML. | public boolean | wasVisited(HasPass dv) Checks if a node was previously visited. |
XXXXXX | final static String XXXXXX(Code) | | String constant describing the six X.
|
BookKeeper | public BookKeeper()(Code) | | Default ctor.
|
addFilenames | public void addFilenames(Collection lfnset)(Code) | | This method helps to track the input and output files. From this
information, the input, intermediary and output files of the
complete DAG can be constructed. This method does allow for inout.
Parameters: lfnset - is a set of LFN instances, which encapsulate theirrespective linkage. See Also: java.util.AbstractCollection.addAll(java.util.Collection) |
addJob | public boolean addJob(Job job)(Code) | | Accessor: Appends a job definition to the DAX structure.
|
addParent | public boolean addParent(HasPass current, Set parents)(Code) | | Adds a parent set for the given element to the state
Parameters: current - is the current derivation to add parents for Parameters: parents - are the parents, any number, to add for the given element true, if the parent was not know before or the currelem is empty,false, if the parent was added previously. |
addVisited | public boolean addVisited(HasPass current, Set real)(Code) | | This method marks a derivation as visited in the set of visited nodes.
Parameters: current - is the caller to add to the visited node set. Parameters: real - is the value to add for the given caller. true , if the caller was previously unknownto the visited set. |
createTempName | public String createTempName(String hint, String suffix)(Code) | | Creates a unique temporary filename. The new name is registered
locally to ensure uniqueness. A string of multiple capitol X, at
least six, is replaced with some random factor.
Parameters: hint - is a filename hint. Parameters: suffix - is the suffix for the filename. a somewhat unique filename - for this workflow only. |
getAllProfiles | public java.util.List getAllProfiles()(Code) | | Accessor: obtains all profiles on the profile stack.
all stacked profiles in one structure, may be empty. |
getAllTransformations | public String getAllTransformations()(Code) | | Accessor: obtains all transformations that were pushed as space
separated string.
all transformation names, may be empty. See Also: BookKeeper.addJob(Job) |
getDAX | public ADAG getDAX(String name)(Code) | | Accessor: Returns the constructed internal DAX keeper.
the abstract DAX description. Note that this may be empty! |
isEmpty | public boolean isEmpty()(Code) | | Detects valid results in the ADAG as opposed to an empty shell.
true, if the ADAG is an empty shell. |
jobOf | public String jobOf(String id)(Code) | | Obtains an existing mapping of a DV indentification to a job id.
The identification used to be the DV's short ID, but recent changes
use the full ID.
Parameters: id - is the derivation identifier a job identifier, or null if no such mapping exists. |
mapJob | public String mapJob(String id)(Code) | | Maps a DV identification to a name that can be put into the XML
datatypes NMTOKEN, ID and IDREF. The identification used to be
the DV's short ID, but recent changes use the full ID.
Parameters: id - is the derivation identifier an XML-compatible job id |
pushProfile | public void pushProfile(java.util.List profiles)(Code) | | Accessor: push a vector of profiles down the profile stack.
Parameters: profiles - is a list of profiles, may be empty. See Also: BookKeeper.popProfile() |
pushTransformation | public void pushTransformation(String fqdi)(Code) | | Accessor: push the FQDI of a transformation onto a stack.
Parameters: fqdi - is the fully-qualified definition identifier. See Also: BookKeeper.popTransformation() |
setCurrent | public void setCurrent(HasPass dv)(Code) | | This method updates the "cursor" position with a new derivation.
The cursor helps tracking derivations while a DAG is being produced.
Parameters: dv - is the new current derivation that the cursor will be set to. See Also: BookKeeper.getCurrent() |
toString | public void toString(Writer stream) throws IOException(Code) | | This method is a possibly more memory efficient version of
constructing a DAG.
Parameters: stream - is a generic stream to put textual results onto. |
toString | public String toString()(Code) | | dumps the state of this object into human readable format.
|
toXML | public void toXML(Writer stream, String indent, String namespace) throws IOException(Code) | | This method is a possibly more memory efficient version of
constructing a DAX.
Parameters: stream - is a generic stream to put XML results onto. Parameters: indent - is the initial indentation level. Parameters: namespace - is an optional XML namespace. |
toXML | public void toXML(Writer stream, String indent) throws IOException(Code) | | This method is a possibly more memory efficient version of
constructing a DAX.
Parameters: stream - is a generic stream to put XML results onto. Parameters: indent - is the initial indentation level. |
toXML | public String toXML(String indent, String namespace)(Code) | | Dumps the state of this object into machine readable XML.
Parameters: indent - is the initial indentation level. Parameters: namespace - is an optional XML namespace. |
wasVisited | public boolean wasVisited(HasPass dv)(Code) | | Checks if a node was previously visited. The visited nodes have to
be tracked in any kind of breadth first and depth first search.
Parameters: dv - is the derivation to check, if it was visited before. true, if the derivation was already visited previously. |
|
|