public class JobGraph extends Object implements IOReadableWritable
| Constructor and Description |
|---|
JobGraph()
Constructs a new job graph with a random job ID.
|
JobGraph(String jobName)
Constructs a new job graph with the given name and a random job ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJar(Path jar)
Adds the path of a JAR file required to run the job on a task manager.
|
void |
addVertex(AbstractJobInputVertex inputVertex)
Adds a new input vertex to the job graph if it is not already included.
|
void |
addVertex(AbstractJobOutputVertex outputVertex)
Adds a new output vertex to the job graph if it is not already included.
|
void |
addVertex(JobTaskVertex taskVertex)
Adds a new task vertex to the job graph if it is not already included.
|
AbstractJobVertex |
areVertexDegreesCorrect()
Checks for all registered job vertices if their in-/out-degree is correct.
|
AbstractJobVertex |
findVertexByID(JobVertexID id)
Searches for a vertex with a matching ID and returns it.
|
AbstractJobVertex |
findVertexWithNullEdges()
Checks if any vertex of this job graph has an outgoing edge which is set to
null. |
AbstractJobVertex[] |
getAllJobVertices()
Returns an array of all job vertices that are registered with the job graph.
|
AbstractJobVertex[] |
getAllReachableJobVertices()
Returns an array of all job vertices than can be reached when traversing the job graph from the input vertices.
|
Iterator<AbstractJobInputVertex> |
getInputVertices()
Returns an iterator to iterate all input vertices registered with the job graph.
|
Path[] |
getJars()
Returns a (possibly empty) array of paths to JAR files which are required to run the job on a task manager.
|
Configuration |
getJobConfiguration()
Returns the configuration object for this job if it is set.
|
JobID |
getJobID()
Returns the ID of the job.
|
String |
getName()
Returns the name assigned to the job graph.
|
int |
getNumberOfInputVertices()
Returns the number of input vertices registered with the job graph.
|
int |
getNumberOfOutputVertices()
Returns the number of output vertices registered with the job graph.
|
int |
getNumberOfTaskVertices()
Returns the number of task vertices registered with the job graph.
|
int |
getNumberOfVertices()
Returns the number of all job vertices registered with this job graph.
|
Iterator<AbstractJobOutputVertex> |
getOutputVertices()
Returns an iterator to iterate all output vertices registered with the job graph.
|
Iterator<JobTaskVertex> |
getTaskVertices()
Returns an iterator to iterate all task vertices registered with the job graph.
|
boolean |
isAcyclic()
Checks if the job graph is acyclic.
|
boolean |
isInstanceDependencyChainAcyclic()
Checks if the instance dependency chain created with the
setVertexToShareInstancesWith method is
acyclic. |
boolean |
isWeaklyConnected()
Checks if the job graph is weakly connected.
|
void |
read(DataInputView in) |
void |
write(DataOutputView out) |
public JobGraph()
public JobGraph(String jobName)
jobName - the name for this job graphpublic String getName()
public Configuration getJobConfiguration()
null if it is not setpublic void addVertex(AbstractJobInputVertex inputVertex)
inputVertex - the new input vertex to be addedpublic void addVertex(JobTaskVertex taskVertex)
taskVertex - the new task vertex to be addedpublic void addVertex(AbstractJobOutputVertex outputVertex)
outputVertex - the new output vertex to be addedpublic int getNumberOfInputVertices()
public int getNumberOfOutputVertices()
public int getNumberOfTaskVertices()
public Iterator<AbstractJobInputVertex> getInputVertices()
public Iterator<AbstractJobOutputVertex> getOutputVertices()
public Iterator<JobTaskVertex> getTaskVertices()
public int getNumberOfVertices()
public AbstractJobVertex[] getAllReachableJobVertices()
public AbstractJobVertex[] getAllJobVertices()
public JobID getJobID()
public AbstractJobVertex findVertexByID(JobVertexID id)
id - the ID of the vertex to search fornull if no vertex with such ID could be foundpublic boolean isWeaklyConnected()
true if the job graph is weakly connected, otherwise falsepublic boolean isAcyclic()
true if the job graph is acyclic, false otherwisepublic AbstractJobVertex areVertexDegreesCorrect()
null if the in-/out-degree of all vertices is correct or the first job vertex whose
in-/out-degree is incorrect.public void read(DataInputView in) throws IOException
read in interface IOReadableWritableIOExceptionpublic void write(DataOutputView out) throws IOException
write in interface IOReadableWritableIOExceptionpublic void addJar(Path jar)
jar - path of the JAR file required to run the job on a task managerpublic Path[] getJars()
public AbstractJobVertex findVertexWithNullEdges()
null. If this is the
case the respective vertex is returned.null or null if no such vertex
existspublic boolean isInstanceDependencyChainAcyclic()
setVertexToShareInstancesWith method is
acyclic.true if the dependency chain is acyclic, false otherwiseCopyright © 2014 The Apache Software Foundation. All rights reserved.