Examples of AmbariClusterInfo


Examples of org.apache.ambari.view.slider.clients.AmbariClusterInfo

  @Override
  public ViewStatus getViewStatus() {
    ViewStatus status = new ViewStatus();
    List<String> viewErrors = new ArrayList<String>();

    AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
    if (clusterInfo != null) {
      AmbariCluster cluster = ambariClient.getCluster(clusterInfo);
      List<AmbariServiceInfo> services = cluster.getServices();
      if (services != null && !services.isEmpty()) {
        AmbariServiceInfo hdfsService = null, yarnService = null, zkService = null;
View Full Code Here

Examples of org.apache.ambari.view.slider.clients.AmbariClusterInfo

    status.setViewErrors(viewErrors);
    return status;
  }

  private AmbariCluster getAmbariCluster() {
    AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
    if (clusterInfo != null) {
      return ambariClient.getCluster(clusterInfo);
    }
    return null;
  }
View Full Code Here

Examples of org.apache.ambari.view.slider.clients.AmbariClusterInfo

      File appConfigJsonFile = new File(appCreateFolder, "appConfig.json");
      File resourcesJsonFile = new File(appCreateFolder, "resources.json");
      saveAppConfigs(configs, componentsArray, appConfigJsonFile);
      saveAppResources(componentsArray, resourcesJsonFile);

      AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
      AmbariCluster cluster = ambariClient.getCluster(clusterInfo);
      Map<String, String> coreSiteConfigs = ambariClient.getConfiguration(
          clusterInfo, "core-site", cluster.getDesiredConfigs()
          .get("core-site"));
      String hdfsLocation = coreSiteConfigs.get("fs.defaultFS");
View Full Code Here

Examples of org.apache.ambari.view.slider.clients.AmbariClusterInfo

    try {
      JsonElement jsonElement = doGetJson("/api/v1/clusters");
      JsonObject jsonObject = jsonElement.getAsJsonObject();
      JsonArray clustersArray = jsonObject.get("items").getAsJsonArray();
      if (clustersArray.size() > 0) {
        AmbariClusterInfo cluster = new AmbariClusterInfo();
        JsonObject clusterObj = clustersArray.get(0).getAsJsonObject()
            .get("Clusters").getAsJsonObject();
        cluster.setName(clusterObj.get("cluster_name").getAsString());
        cluster.setVersion(clusterObj.get("version").getAsString());
        return cluster;
      }
    } catch (HttpException e) {
      logger.warn("Unable to determine Ambari clusters", e);
      throw new RuntimeException(e.getMessage(), e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.