Package com.cloudera.api.model

Examples of com.cloudera.api.model.ApiHostRef


   }

   private ApiRole createApiRole(CmRoleDef role) {
      ApiRole apiRole = new ApiRole();
      apiRole.setType(role.getType().getName());
      apiRole.setHostRef(new ApiHostRef(role.getNodeRef()));
      ApiConfigList roleConfigList = new ApiConfigList();
      if (role.getConfiguration() != null) {
         for (String key : role.getConfiguration().keySet()) {
            roleConfigList.add(new ApiConfig(key, role.getConfiguration().get(key)));
         }
View Full Code Here


      logger.debug("cluster spec after synced hosts Id: " + new GsonBuilder().excludeFieldsWithoutExposeAnnotation()
            .create().toJson(cluster));

      Set<ApiHostRef> toAddHosts = new HashSet<ApiHostRef>();
      for (CmNodeDef node : cluster.getNodes()) {
         toAddHosts.add(new ApiHostRef(node.getNodeId()));
      }

      for (ApiHostRef hostRef : apiResourceRootV6.getClustersResource().listHosts(cluster.getName())) {
         if (toAddHosts.contains(hostRef)) {
            toAddHosts.remove(hostRef);
View Full Code Here

      List<ApiRole> roleList = new ArrayList<>();
      ApiRole role = new ApiRole();
      role.setName("NAMENODE");
      role.setRoleState(ApiRoleState.STARTED);
      role.setType(role.getName());
      ApiHostRef hostRef = new ApiHostRef("host1");
      role.setHostRef(hostRef);
      roleList.add(role);
      RolesResourceV6 rolesResourceV6 = new FakeRolesResource(roleList);
      Mockito.when(servicesResourceV6.getRolesResource(hdfs.getName())).thenReturn(rolesResourceV6);
      Mockito.when(resourceV6.getServicesResource(blueprint.getName())).thenReturn(servicesResourceV6);
View Full Code Here

      List<ApiRole> roleList = new ArrayList<>();
      ApiRole role = new ApiRole();
      role.setName("NAMENODE");
      role.setRoleState(ApiRoleState.STOPPED);
      role.setType(role.getName());
      ApiHostRef hostRef = new ApiHostRef("host1");
      role.setHostRef(hostRef);
      roleList.add(role);
      RolesResourceV6 rolesResourceV6 = new FakeRolesResource(roleList);
      Mockito.when(servicesResourceV6.getRolesResource(hdfs.getName())).thenReturn(rolesResourceV6);
      Mockito.when(resourceV6.getServicesResource(blueprint.getName())).thenReturn(servicesResourceV6);
View Full Code Here

TOP

Related Classes of com.cloudera.api.model.ApiHostRef

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.