@Test public void testgetAppIdHadoop2() { Configuration conf = new Configuration(); conf.set(Constants.JOB_NAME_CONF_KEY, ""); conf.set(Constants.APP_NAME_CONF_KEY, ""); conf.set(Constants.JOB_NAME_HADOOP2_CONF_KEY, "abc.def.xyz"); assertEquals("abc.def.xyz", getAppId(conf)); }
public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else { appId = jobConf.get(Constants.JOB_NAME_HADOOP2_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } } } return cleanAppId(appId); }
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else { appId = jobConf.get(Constants.JOB_NAME_HADOOP2_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } } } return cleanAppId(appId); } }
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else { appId = jobConf.get(Constants.JOB_NAME_HADOOP2_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } } } return cleanAppId(appId); } JobDescFactoryBase(); }
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else { appId = jobConf.get(Constants.JOB_NAME_HADOOP2_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } } } return cleanAppId(appId); } JobDescFactoryBase(); String getAppId(Configuration jobConf); }
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else { appId = jobConf.get(Constants.JOB_NAME_HADOOP2_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } } } return cleanAppId(appId); } JobDescFactoryBase(); String getAppId(Configuration jobConf);  }