大数据开发之Job提交换程源码和切片源码详解
1.Job提交流程源码详解waitForCompletion()
submit();
// 1创建连接
connect();
// 1)创建提交Job的署理
new Cluster(getConfiguration());
// (1)判断是本地yarn还是远程
initialize(jobTrackAddr, conf);
// 2 提交job
submitter.submitJobInternal(Job.this, cluster)
// 1)创建给集群提交数据的Stag路径
Path jobStagingArea = JobSubmissionFiles.getStagingDir(cluster, conf);
// 2)获取jobid ,并创建Job路径
JobID jobId = submitClient.getNewJobID();
// 3)拷贝jar包到集群
copyAndConfigureFiles(job, submitJobDir);
rUploader.uploadFiles(job, jobSubmitDir);
// 4)计算切片,生成切片规划文件
writeSplits(job, submitJobDir);
maps = writeNewSplits(job, jobSubmitDir);
input.getSplits(job);
// 5)向Stag路径写XML设置文件
writeConf(conf, submitJobFile);
conf.writeXml(out);
// 6)提交Job,返回提交状态
status = submitClient.submitJob(jobId, submitJobDir.toString(), job.getCredentials());
https://p3.toutiaoimg.com/large/pgc-image/2b5c851e26324245ba558836fd74be57
Job提交流程源码分析
2.FileInputFormat切片源码解析(input.getSplits(job))
https://p3.toutiaoimg.com/large/pgc-image/7839b6119f6840fda815a86ab156b762
文章转载链接:http://www.atguigu.com/jsfx/11482.html
页:
[1]