public class JobGraph extends Object implements IOReadableWritable
| Constructor and Description |
|---|
JobGraph()
Constructs a new job graph with no name and a random job ID.
|
JobGraph(AbstractJobVertex... vertices)
Constructs a new job graph with no name and a random job ID.
|
JobGraph(JobID jobId,
String jobName)
Constructs a new job graph with the given name and a random job ID.
|
JobGraph(JobID jobId,
String jobName,
AbstractJobVertex... vertices)
Constructs a new job graph with the given name and a random job ID.
|
JobGraph(String jobName)
Constructs a new job graph with the given name and a random job ID.
|
JobGraph(String jobName,
AbstractJobVertex... vertices)
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(AbstractJobVertex vertex)
Adds a new task vertex to the job graph if it is not already included.
|
AbstractJobVertex |
findVertexByID(JobVertexID id)
Searches for a vertex with a matching ID and returns it.
|
boolean |
getAllowQueuedScheduling() |
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 |
getNumberOfVertices()
Returns the number of all vertices.
|
List<BlobKey> |
getUserJarBlobKeys()
Returns a set of BLOB keys referring to the JAR files required to run this job.
|
Iterable<AbstractJobVertex> |
getVertices()
Returns an Iterable to iterate all vertices registered with the job graph.
|
AbstractJobVertex[] |
getVerticesAsArray()
Returns an array of all job vertices that are registered with the job graph.
|
List<AbstractJobVertex> |
getVerticesSortedTopologicallyFromSources() |
void |
read(DataInputView in) |
void |
setAllowQueuedScheduling(boolean allowQueuedScheduling) |
void |
uploadRequiredJarFiles(InetSocketAddress serverAddress)
Uploads the previously added user jar file to the job manager through the job manager's BLOB server.
|
void |
write(DataOutputView out) |
public JobGraph()
public JobGraph(String jobName)
jobName - The name of the jobpublic JobGraph(JobID jobId, String jobName)
jobId - The id of the jobjobName - The name of the jobpublic JobGraph(AbstractJobVertex... vertices)
vertices - The vertices to add to the graph.public JobGraph(String jobName, AbstractJobVertex... vertices)
jobName - The name of the job.vertices - The vertices to add to the graph.public JobGraph(JobID jobId, String jobName, AbstractJobVertex... vertices)
jobId - The id of the job.jobName - The name of the job.vertices - The vertices to add to the graph.public JobID getJobID()
public String getName()
public Configuration getJobConfiguration()
null if it is not setpublic void setAllowQueuedScheduling(boolean allowQueuedScheduling)
public boolean getAllowQueuedScheduling()
public void addVertex(AbstractJobVertex vertex)
vertex - the new task vertex to be addedpublic Iterable<AbstractJobVertex> getVertices()
public AbstractJobVertex[] getVerticesAsArray()
public int getNumberOfVertices()
public AbstractJobVertex findVertexByID(JobVertexID id)
id - the ID of the vertex to search fornull if no vertex with such ID could be foundpublic List<AbstractJobVertex> getVerticesSortedTopologicallyFromSources() throws InvalidProgramException
InvalidProgramExceptionpublic 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 List<BlobKey> getUserJarBlobKeys()
public void uploadRequiredJarFiles(InetSocketAddress serverAddress) throws IOException
serverAddress - the network address of the BLOB serverIOException - thrown if an I/O error occurs during the uploadCopyright © 2014 The Apache Software Foundation. All rights reserved.