}
}
}
}
if (properties != null && !properties.isEmpty()) {
SliderAppMasterClient sliderAppClient = yarnApp.getTrackingUrl() == null ? null
: new SliderAppMasterClient(yarnApp.getTrackingUrl());
SliderAppMasterData appMasterData = null;
Map<String, String> quickLinks = new HashMap<String, String>();
for (String property : properties) {
if ("RUNNING".equals(app.getState())) {
if (sliderAppClient != null) {
if (appMasterData == null) {
appMasterData = sliderAppClient.getAppMasterData();
}
if ("urls".equals(property.toLowerCase())) {
if (quickLinks.isEmpty()) {
quickLinks = sliderAppClient
.getQuickLinks(appMasterData.publisherUrl);
}
app.setUrls(quickLinks);
} else if ("configs".equals(property.toLowerCase())) {
Map<String, Map<String, String>> configs = sliderAppClient
.getConfigs(appMasterData.publisherUrl);
app.setConfigs(configs);
} else if ("jmx".equals(property.toLowerCase())) {
if (quickLinks.isEmpty()) {
quickLinks = sliderAppClient
.getQuickLinks(appMasterData.publisherUrl);
}
if (quickLinks != null && quickLinks.containsKey("JMX")) {
String jmxUrl = quickLinks.get("JMX");
List<SliderAppType> appTypes = getSliderAppTypes(null);
if (appTypes != null && appTypes.size() > 0) {
for (SliderAppType appType : appTypes) {
logger.info("TYPE: " + appType.getTypeName() + " " + app.getType());
logger.info("VERSION: " + appType.getTypeVersion() + " " + app.getAppVersion());
if ((appType.getTypeName() != null && appType.getTypeName().equalsIgnoreCase(app.getType())) &&
(appType.getTypeVersion() != null
&& appType.getTypeVersion().equalsIgnoreCase(app.getAppVersion()))) {
app.setJmx(sliderAppClient.getJmx(jmxUrl, viewContext,
appType));
break;
}
}
}
}
Map<String, Map<String, String>> configs = sliderAppClient
.getConfigs(appMasterData.publisherUrl);
app.setConfigs(configs);
} else if ("components".equals(property.toLowerCase())) {
try {
System.setProperty(SliderKeys.HADOOP_USER_NAME, "yarn");