Examples of ApiHostComponents


Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostComponents

      ApiStackServiceList stackServiceList =
            apiManager.getStackWithCompAndConfigs(clusterDef.getAmStack()
                  .getName(), clusterDef.getAmStack().getVersion());
      Map<String, String> configTypeToService = stackServiceList.configTypeToService();
      Map<String, ApiComponentInfo> componentToInfo = stackServiceList.componentToInfo();
      ApiHostComponents apiHostComponents = null;
      Set<String> serviceNames = getExistingClusterServices(clusterDef);
      List<String> targetHostNames = new ArrayList<>();
      List<AmNodeDef> targetNodeDefs = new ArrayList<>();
      for (AmNodeDef nodeDef : clusterDef.getNodes()) {
         if (addedNodeNames.contains(nodeDef.getName())) {
            if (apiHostComponents == null) {
               apiHostComponents =
                     createHostComponents(componentToInfo, serviceNames,
                           nodeDef);
            }
            targetHostNames.add(nodeDef.getFqdn());
            targetNodeDefs.add(nodeDef);
         }
      }
      removeHosts(clusterDef, targetHostNames, reports);
      apiManager.addHostsToCluster(clusterDef.getName(), targetHostNames);
      if (apiHostComponents.getHostComponents().isEmpty()) {
         logger.info("No roles need to install on hosts.");
         return true;
      }
      // add configurations
      createConfigGroups(clusterDef, configTypeToService, targetNodeDefs);
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostComponents

   }

   private ApiHostComponents createHostComponents(
         Map<String, ApiComponentInfo> componentToInfo,
         Set<String> serviceNames, AmNodeDef nodeDef) {
      ApiHostComponents apiHostComponents = new ApiHostComponents();
      List<ApiHostComponent> hostComponents = new ArrayList<>();
      apiHostComponents.setHostComponents(hostComponents);
      for (String componentName : nodeDef.getComponents()) {
         ApiComponentInfo definedCompInfo = componentToInfo.get(componentName);
         if (definedCompInfo == null) {
            logger.error("Component " + componentName + " is not supported. This should not happen.");
            continue;
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostComponents

      return rackPattern.matcher(rack).matches();
   }

   public static ApiHostsRequest createInstallComponentsRequest() {
      ApiHostsRequest hostsRequest = new ApiHostsRequest();
      ApiHostComponents components = new ApiHostComponents();
      hostsRequest.setBody(components);
      ApiComponentInfo hostRoles = new ApiComponentInfo();
      hostRoles.setState("INSTALLED");
      components.setHostRoles(hostRoles);
      ApiHostsRequestInfo requestInfo = new ApiHostsRequestInfo();
      hostsRequest.setRequestInfo(requestInfo);
      requestInfo.setContext("Installing components");
      requestInfo.setQueryString("HostRoles/state=INIT");
      return hostsRequest;
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostComponents

   }

   public ApiRequest stopAllComponentsInHosts(String clusterName,
         List<String> hostNames) throws AmbariApiException {
      ApiHostsRequest hostsRequest = new ApiHostsRequest();
      ApiHostComponents apiComponents = new ApiHostComponents();
      hostsRequest.setBody(apiComponents);
      ApiComponentInfo hostRoles = new ApiComponentInfo();
      hostRoles.setState("INSTALLED");
      apiComponents.setHostRoles(hostRoles);
      ApiHostsRequestInfo requestInfo = new ApiHostsRequestInfo();
      hostsRequest.setRequestInfo(requestInfo);
      requestInfo.setContext("Stop Hosts components");

      StringBuilder builder = new StringBuilder();
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostComponents

   public ApiRequest startComponents(String clusterName,
         List<String> hostNames, List<String> components)
         throws AmbariApiException {
      ApiHostsRequest hostsRequest = new ApiHostsRequest();
      ApiHostComponents apiComponents = new ApiHostComponents();
      hostsRequest.setBody(apiComponents);
      ApiComponentInfo hostRoles = new ApiComponentInfo();
      hostRoles.setState("STARTED");
      apiComponents.setHostRoles(hostRoles);
      ApiHostsRequestInfo requestInfo = new ApiHostsRequestInfo();
      hostsRequest.setRequestInfo(requestInfo);
      requestInfo.setContext("Start Hosts components");

      StringBuilder builder = new StringBuilder();
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.