public class JobGraph extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
JobGraph.JobType |
| 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 |
addBlob(BlobKey key)
Adds the BLOB referenced by the key to the JobGraph's dependencies.
|
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() |
long |
getCheckpointingInterval() |
Configuration |
getJobConfiguration()
Returns the configuration object for this job if it is set.
|
JobID |
getJobID()
Returns the ID of the job.
|
JobGraph.JobType |
getJobType() |
String |
getName()
Returns the name assigned to the job graph.
|
int |
getNumberOfExecutionRetries()
Gets the number of times the system will try to re-execute failed tasks.
|
int |
getNumberOfVertices()
Returns the number of all vertices.
|
ScheduleMode |
getScheduleMode() |
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() |
boolean |
hasUsercodeJarFiles()
Checks whether the JobGraph has user code JAR files attached.
|
boolean |
isCheckpointingEnabled() |
void |
setAllowQueuedScheduling(boolean allowQueuedScheduling) |
void |
setCheckpointingEnabled(boolean checkpointingEnabled) |
void |
setCheckpointingInterval(long checkpointingInterval) |
void |
setJobType(JobGraph.JobType jobType) |
void |
setNumberOfExecutionRetries(int numberOfExecutionRetries)
Sets the number of times that failed tasks are re-executed.
|
void |
setScheduleMode(ScheduleMode scheduleMode) |
void |
uploadRequiredJarFiles(InetSocketAddress serverAddress)
Uploads the previously added user jar file to the job manager through the job manager's BLOB server.
|
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 setNumberOfExecutionRetries(int numberOfExecutionRetries)
-1 indicates that the system
default value (as defined in the configuration) should be used.numberOfExecutionRetries - The number of times the system will try to re-execute failed tasks.public int getNumberOfExecutionRetries()
-1 indicates that the system default value (as defined in the configuration)
should be used.public void setAllowQueuedScheduling(boolean allowQueuedScheduling)
public boolean getAllowQueuedScheduling()
public void setScheduleMode(ScheduleMode scheduleMode)
public ScheduleMode getScheduleMode()
public void addVertex(AbstractJobVertex vertex)
vertex - the new task vertex to be addedpublic Iterable<AbstractJobVertex> getVertices()
public AbstractJobVertex[] getVerticesAsArray()
public int getNumberOfVertices()
public void setJobType(JobGraph.JobType jobType)
public JobGraph.JobType getJobType()
public void setCheckpointingEnabled(boolean checkpointingEnabled)
public boolean isCheckpointingEnabled()
public void setCheckpointingInterval(long checkpointingInterval)
public long getCheckpointingInterval()
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 addJar(Path jar)
jar - path of the JAR file required to run the job on a task managerpublic void addBlob(BlobKey key)
key - path of the JAR file required to run the job on a task managerpublic boolean hasUsercodeJarFiles()
public 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–2015 The Apache Software Foundation. All rights reserved.