当前位置:   article > 正文

Flink源码解读_flink的源码解析

flink的源码解析

Flink源码解读

org.apache.flink.client;
LocalExecutor模式解读
A class for executing a {
   @link Plan}  on a local embedded Flink runtime instance.
  • 1
  • 2
  • 3
  • 4

用于在本地嵌入的Flink运行时实例上执行{计划}的类
public class LocalExecutor extends PlanExecutor {}
在这里插入图片描述
在这个类中注意到了

public class LocalExecutor extends PlanExecutor {
   
   

   private NepheleMiniCluster nephele;
  • 1
  • 2
  • 3
  • 4
  • 5

这个私有变量,于是顺着源码一路读,找到NepheleMinniCluster
在这里插入图片描述
在这里插入图片描述
在该类中注意到getJobClient()方法,该方法的形参是JobGraph类型,于是顺水推舟,找到了JobGraph类

 A job graph represents an entire Flink runtime job
  • 1

作业图表示整个Flink运行时作业(该类的作用)

public class JobGraph implements IOReadableWritable {
   
  • 1
  • 2

定义图的结构/拓扑的成员
源码清晰的解释说明了每一个属性的作用,
/** 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 userJars = new ArrayList ();

/** 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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/634009
推荐阅读
相关标签
  

闽ICP备14008679号