Flink源码解读
org.apache.flink.client;
LocalExecutor模式解读
A class for executing a {
@link Plan} on a local embedded Flink runtime instance.
用于在本地嵌入的Flink运行时实例上执行{计划}的类
public class LocalExecutor extends PlanExecutor {}
在这个类中注意到了
public class LocalExecutor extends PlanExecutor {
private NepheleMiniCluster nephele;
这个私有变量,于是顺着源码一路读,找到NepheleMinniCluster
在该类中注意到getJobClient()方法,该方法的形参是JobGraph类型,于是顺水推舟,找到了JobGraph类
A job graph represents an entire Flink runtime job
作业图表示整个Flink运行时作业(该类的作用)
public class JobGraph implements IOReadableWritable {
定义图的结构/拓扑的成员
源码清晰的解释说明了每一个属性的作用,
/** List of task vertices included in this job graph. */
private final Map<JobVertexID, AbstractJobVertex> taskVertices = new LinkedHashMap<JobVertexID, AbstractJobVertex>();
/** The job configuration attached to this job. */任务图中包含的任务顶点列表
private final Configuration jobConfiguration = new Configuration();
/** Set of JAR files required to run this job. */
private final transient List
/** Set of blob keys identifying the JAR files required to run this job. */
private final List userJarBlobKeys = new ArrayList();
/** ID of this job. */
private final JobID jobID;
/** Name of this job. */
private String jobName;
/** The number of times that failed tasks should be re-executed */标识运行此作业所需的JAR文件的一组blob键
private int numExecutionRetries;
/** flag to enable queued scheduling */标记以启用排队调度
private boolean allowQueuedScheduling;
紧接着就是
该类各种属性的构造器
/**
* Constructs a new job graph with no name and a random job ID.
*/
public JobGraph() {
this((String) null);
}
/**
* Constructs a new job graph with the given name and a random job ID.
*
* @param jobName The name of the job
*/
public JobGraph(String jobName) {
this(null, jobName);
}
/**
* Constructs a new job graph with the given name and a random job ID.
*
* @param jobId The id of the job
* @param jobName The name of the job
*/
public JobGraph(JobID jobId, String jobName) {
this.jobID = jobId == null ? new JobID() : jobId;
this.jobName = jobName == null ? "(unnamed job)" : jobName