编程语言
首页 > 编程语言> > 【Flink源码】二、客户端是否以yarn模式提交

【Flink源码】二、客户端是否以yarn模式提交

作者:互联网

一、在验证是否活跃提交模式里面

 

public boolean isActive(CommandLine commandLine) {
          //命令行是否有 yarn-cluster final String jobManagerOption = commandLine.getOptionValue(addressOption.getOpt(), null); final boolean yarnJobManager = ID.equals(jobManagerOption);
          //命令行里面是否有appid,配置里面是否有appid application_1623987801507_0002 final boolean hasYarnAppId = commandLine.hasOption(applicationId.getOpt()) || configuration.getOptional(YarnConfigOptions.APPLICATION_ID).isPresent();
//配置里面是否有执行器是基于yarn final boolean hasYarnExecutor = YarnSessionClusterExecutor.NAME.equalsIgnoreCase(configuration.get(DeploymentOptions.TARGET)) || YarnJobClusterExecutor.NAME.equalsIgnoreCase(configuration.get(DeploymentOptions.TARGET)); return hasYarnExecutor || yarnJobManager || hasYarnAppId; }

  

YarnSessionClusterExecutor.NAME里面有这三个
        PER_JOB("yarn-per-job"),
	SESSION("yarn-session"),
	APPLICATION("yarn-application");

  这三个条件有一个,走yarn模式提交

标签:NAME,commandLine,Flink,yarn,final,boolean,configuration,源码
来源: https://www.cnblogs.com/fi0108/p/14899084.html