Package org.apache.ambari.view.slider.rest.client

Examples of org.apache.ambari.view.slider.rest.client.SliderAppMasterClient


          }
        }
      }
    }
    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");
View Full Code Here

TOP

Related Classes of org.apache.ambari.view.slider.rest.client.SliderAppMasterClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.