public class ADAG
extends java.lang.Object
This class provides the Java API to create DAX files. The DAX XML SCHEMA is available at http://pegasus.isi.edu/schema/dax-3.3.xsd and documentation available at http://pegasus.isi.edu/wms/docs/schemas/dax-3.3/dax-3.3.html The DAX consists of 6 parts the first 4 are optional and the last is optional.
To generate an example DIAMOND DAX run the ADAG Class as shown below java ADAG filename NOTE: This is an illustrative example only. Please see examples directory for a working example Shown below are some of the steps in creating a DIAMOND DAX.
ADAG
object File
objectMetaData
entry to
the file objectsProfile
entry to the file objectsPFN
to the File objectExecutable
objectExecutable.ARCH
and Executable.OS
for the executable. Default is x86 and
LINUXPFN
of the executable. In
case of stageable executables the path should be a urlProfile
and MetaData
objects to the executableExecutable
object to the ADAG
objectTransformation
object : compound Executable
(Executable depending on other executable and files)ADAG
objectJob
objectProfile
s to the jobADAG
DAG
objectDAX
job object.Modifier and Type | Field and Description |
---|---|
private int |
mCount
The Count of the number of dax objects : N
|
private java.util.Map<java.lang.String,java.util.Set<Edge>> |
mDependencies
Map of Dependencies between Job,DAX,DAG objects.
|
private java.util.Set<Executable> |
mExecutables
The list of Executable objects
|
private java.util.List<File> |
mFiles
The list of edu.isi.pegasus.planner.dax.File objects
|
private int |
mIndex
The Index of the dax object.
|
private java.util.List<Invoke> |
mInvokes
List of Notification objects
|
private java.util.Map<java.lang.String,AbstractJob> |
mJobs
The List of Job,DAX and DAG objects
|
private java.util.List<DAG> |
mLDAGs |
private java.util.List<DAX> |
mLDAXs |
private java.util.List<Job> |
mLJobs |
private LogManager |
mLogger |
private java.lang.String |
mName
The Name / Label of the DAX
|
private java.util.Set<Transformation> |
mTransformations
The List of Transformation objects
|
private XMLWriter |
mWriter
Handle the XML writer
|
static java.lang.String |
SCHEMA_LOCATION
The "not-so-official" location URL of the DAX schema definition.
|
static java.lang.String |
SCHEMA_NAMESPACE
The "official" namespace URI of the site catalog schema.
|
static java.lang.String |
SCHEMA_NAMESPACE_XSI
XSI SCHEMA NAMESPACE
|
static java.lang.String |
SCHEMA_VERSION
The version to report.
|
Constructor and Description |
---|
ADAG(java.lang.String name)
The Simple constructor for the DAX object
|
ADAG(java.lang.String name,
int index,
int count)
DAX Constructor
|
Modifier and Type | Method and Description |
---|---|
private ADAG |
addAbstractJob(AbstractJob ajob)
Add AbstractJob to the DAX
|
private ADAG |
addAbstractJobs(java.util.List<AbstractJob> ajobs)
Add AbstractJobs to the DAX
|
ADAG |
addDAG(DAG dag)
Add a DAG job to the DAX
|
ADAG |
addDAGs(java.util.List<DAG> dags)
Add multiple DAG jobs to the DAX
|
ADAG |
addDAX(DAX dax)
Add a DAX job to the DAX
|
ADAG |
addDAXs(java.util.List<DAX> daxs)
Add multiple DAX jobs to the DAX
|
ADAG |
addDependency(AbstractJob parent,
AbstractJob child)
Add a parent child dependency between two jobs,dax,dag
|
ADAG |
addDependency(AbstractJob parent,
AbstractJob child,
java.lang.String label)
Add a parent child dependency with a dependency label
|
ADAG |
addDependency(java.lang.String parent,
java.lang.String child)
Add a parent child dependency between two jobs,dax,dag
|
ADAG |
addDependency(java.lang.String parent,
java.lang.String child,
java.lang.String label)
Add a parent child dependency with a dependency label
|
ADAG |
addExecutable(Executable executable)
Add Executable to the DAX
|
ADAG |
addExecutables(java.util.List<Executable> executables)
Add Multiple Executable objects to the DAX
|
ADAG |
addFile(File file)
Add a RC File object to the top of the DAX.
|
ADAG |
addFiles(java.util.List<File> files)
Add Files to the RC Section on top of the DAX
|
ADAG |
addInvoke(Invoke.WHEN when,
java.lang.String what)
Add a Notification for this Workflow
|
ADAG |
addInvoke(Invoke invoke)
Add a Notification for this Workflow
|
ADAG |
addInvokes(java.util.List<Invoke> invokes)
Add a List of Notifications for this Workflow
|
ADAG |
addJob(Job job)
Add Job to the DAX
|
ADAG |
addJobs(java.util.List<Job> jobs)
Add multiple Jobs to the DAX
|
ADAG |
addNotification(Invoke.WHEN when,
java.lang.String what)
Add a Notification for this Workflow
|
ADAG |
addNotification(Invoke invoke)
Add a Notification for this Workflow
|
ADAG |
addNotifications(java.util.List<Invoke> invokes)
Add a List of Notifications for this Workflow
|
ADAG |
addTransformation(Transformation transformation)
Add Transformation to the DAX
|
ADAG |
addTransformations(java.util.List<Transformation> transformations)
Add Multiple Transformation to the DAX
|
private boolean |
containsAbstractJob(AbstractJob ajob)
Check if an abstractjob exists in the DAX
|
private boolean |
containsAbstractJobId(java.lang.String ajobid)
Check if a jobid exists in the DAX
|
boolean |
containsDAG(DAG dag)
Check if a DAG job exists in the DAX
|
boolean |
containsDAGId(java.lang.String dagid)
Check if a DAG job id exists in the DAX
|
boolean |
containsDAX(DAX dax)
Check if a DAX job exists in the DAX
|
boolean |
containsDAXId(java.lang.String daxid)
Check if a DAX job id exists in the DAX
|
boolean |
containsExecutable(Executable executable)
Checks if a given executable exists in the DAX based Transformation
Catalog
|
boolean |
containsJob(Job job)
Check if a job exists in the DAX
|
boolean |
containsJobId(java.lang.String jobid)
Check if a jobid exists in the DAX
|
boolean |
containsTransformation(Transformation transformation)
Checks if a given Transformation exists in the DAX based Transformation
Catalog
|
private static ADAG |
Diamond() |
private AbstractJob |
getAbstractJob(java.lang.String ajobid)
Returns an abstract Job with id ajobid if present otherwise null.
|
int |
getCount()
Returns the total count of the dax collection.
|
DAG |
getDAG(java.lang.String dagid)
Returns a DAG object with id dagid if present otherwise null.
|
java.util.List<DAG> |
getDAGs()
Get a list of all the DAG jobs.
|
DAX |
getDAX(java.lang.String daxid)
Returns a DAX object with id daxid if present otherwise null.
|
java.util.List<DAX> |
getDAXs()
Get a list of all the DAX jobs.
|
java.util.Set<Edge> |
getEdges()
Returns a Set of all the Edge objects for the DAX.
|
java.util.Set<Edge> |
getEdges(java.lang.String child)
Returns a list of Edge objects for a child job/dax/dag id.
|
java.util.Set<Executable> |
getExecutables()
Returns a set of Executable Objects stored as part of the inDAX
Transformation Catalog;
|
java.util.List<File> |
getFiles()
Returns a list of File objects defined as the inDax Replica Catalog
|
int |
getIndex() |
java.util.List<Invoke> |
getInvoke()
Returns a list of Invoke objects associated with the workflow
|
Job |
getJob(java.lang.String jobid)
Returns a Job object with id jobid if present otherwise null.
|
java.util.List<Job> |
getJobs()
Get a list of all the DAG jobs.
|
java.lang.String |
getName()
Return the name/label of the dax
|
java.util.List<Invoke> |
getNotification()
Returns a list of Invoke objects associated with the workflow.
|
java.util.Set<Transformation> |
getTransformations()
Returns a set of Transformation Objects (complex executables) stored in
the DAX based Transformation Catalog
|
static void |
main(java.lang.String[] args)
Create an example DIAMOND DAX
|
void |
toXML(XMLWriter writer)
Generates a DAX representation.
|
void |
writeToFile(java.lang.String daxfile)
Generate a DAX File out of this object;
|
void |
writeToSTDOUT()
Generate a DAX representation on STDOUT.
|
void |
writeToWriter(java.io.Writer writer,
boolean close)
Generate a DAX representation and pipe it into the Writer
|
public static final java.lang.String SCHEMA_NAMESPACE
public static final java.lang.String SCHEMA_NAMESPACE_XSI
public static final java.lang.String SCHEMA_LOCATION
public static final java.lang.String SCHEMA_VERSION
private java.lang.String mName
private int mIndex
private int mCount
private java.util.Map<java.lang.String,AbstractJob> mJobs
DAG
,
DAX
,
Job
,
AbstractJob
private java.util.List<Job> mLJobs
private java.util.List<DAG> mLDAGs
private java.util.List<DAX> mLDAXs
private java.util.Set<Transformation> mTransformations
Transformation
private java.util.Set<Executable> mExecutables
Executable
private java.util.List<File> mFiles
File
private java.util.Map<java.lang.String,java.util.Set<Edge>> mDependencies
Parent
private java.util.List<Invoke> mInvokes
private XMLWriter mWriter
private LogManager mLogger
public ADAG(java.lang.String name)
name
- DAX LABELpublic ADAG(java.lang.String name, int index, int count)
name
- DAX Labelindex
- Index of DAX out of N DAX'scount
- Number of DAXS in a grouppublic java.lang.String getName()
public int getIndex()
public int getCount()
public ADAG addInvoke(Invoke.WHEN when, java.lang.String what)
when
- what
- public ADAG addNotification(Invoke.WHEN when, java.lang.String what)
when
- what
- public ADAG addInvoke(Invoke invoke)
invoke
- public ADAG addNotification(Invoke invoke)
invoke
- public ADAG addInvokes(java.util.List<Invoke> invokes)
invokes
- public ADAG addNotifications(java.util.List<Invoke> invokes)
invokes
- public java.util.List<Invoke> getInvoke()
public java.util.List<Invoke> getNotification()
public ADAG addFile(File file)
file
- File object to be added to the RC sectionFile
public ADAG addFiles(java.util.List<File> files)
files
- ListFile
public java.util.List<File> getFiles()
public ADAG addExecutable(Executable executable)
executable
- Executable to be addedExecutable
public ADAG addExecutables(java.util.List<Executable> executables)
executables
- List of Executable objects to be addedExecutable
public java.util.Set<Executable> getExecutables()
public boolean containsExecutable(Executable executable)
executable
- public ADAG addTransformation(Transformation transformation)
transformation
- Transformation object to be addedTransformation
public ADAG addTransformations(java.util.List<Transformation> transformations)
transformations
- List of Transformation objectsTransformation
public boolean containsTransformation(Transformation transformation)
transformation
- Transformationpublic java.util.Set<Transformation> getTransformations()
private ADAG addAbstractJob(AbstractJob ajob)
ajob
- AbstractJobJob
,
DAG
,
DAX
,
AbstractJob
private ADAG addAbstractJobs(java.util.List<AbstractJob> ajobs)
ajobs
- AbstractJobJob
,
DAG
,
DAX
,
AbstractJob
private AbstractJob getAbstractJob(java.lang.String ajobid)
ajobid
- private boolean containsAbstractJob(AbstractJob ajob)
ajob
- private boolean containsAbstractJobId(java.lang.String ajobid)
ajobid
- public ADAG addJob(Job job)
job
- Job
,
AbstractJob
public ADAG addJobs(java.util.List<Job> jobs)
jobs
- Job
,
AbstractJob
public boolean containsJob(Job job)
job
- public boolean containsJobId(java.lang.String jobid)
jobid
- public Job getJob(java.lang.String jobid)
jobid
- public java.util.List<Job> getJobs()
public java.util.List<DAX> getDAXs()
public DAX getDAX(java.lang.String daxid)
daxid
- public java.util.List<DAG> getDAGs()
public DAG getDAG(java.lang.String dagid)
dagid
- public ADAG addDAG(DAG dag)
dag
- the DAG to be addedDAG
,
AbstractJob
public ADAG addDAGs(java.util.List<DAG> dags)
dags
- List of DAG jobs to be addedDAG
,
AbstractJob
public boolean containsDAG(DAG dag)
dag
- public boolean containsDAGId(java.lang.String dagid)
dagid
- public ADAG addDAX(DAX dax)
dax
- DAX to be addedDAX
,
AbstractJob
public ADAG addDAXs(java.util.List<DAX> daxs)
daxs
- LIST of DAX jobs to be addedDAX
,
AbstractJob
public boolean containsDAX(DAX dax)
dax
- public boolean containsDAXId(java.lang.String daxid)
daxid
- public ADAG addDependency(java.lang.String parent, java.lang.String child)
parent
- String job,dax,dag idchild
- String job,dax,dag,idpublic ADAG addDependency(AbstractJob parent, AbstractJob child)
parent
- Job|DAX|DAG objectchild
- Job|DAX|DAG objectpublic ADAG addDependency(java.lang.String parent, java.lang.String child, java.lang.String label)
parent
- String job,dax,dag idchild
- String job,dax,dag idlabel
- String dependency labelpublic java.util.Set<Edge> getEdges(java.lang.String child)
child
- public java.util.Set<Edge> getEdges()
child
- public ADAG addDependency(AbstractJob parent, AbstractJob child, java.lang.String label)
parent
- Job|DAX|DAG objectchild
- Job|DAX|DAG objectlabel
- String label for annotationpublic void writeToFile(java.lang.String daxfile)
daxfile
- The file to write the DAX topublic void writeToSTDOUT()
public void writeToWriter(java.io.Writer writer, boolean close)
writer
- A Writer objectclose
- Whether writer should be closed on return.public void toXML(XMLWriter writer)
writer
- @public static void main(java.lang.String[] args)
args
- private static ADAG Diamond()