Package com.cloudera.api.model

Examples of com.cloudera.api.model.ApiServiceList


   public Map<String, RolesResourceV6> rolesResources;
   public RoleCommandsResourceV6 roleCommandsResource;
   public RoleConfigGroupsResource roleConfigGroupsResource;

   public FakeServicesResource() {
      services = new ApiServiceList();
      rolesResources = new HashMap<String, RolesResourceV6>();
      roleCommandsResource = new FakeRoleCommandsResource();
      roleConfigGroupsResource = new FakeRoleConfigGroupsResource();
   }
View Full Code Here


         }
      }

      Map<String, List<ApiRole>> result = new HashMap<>();
      try {
         ApiServiceList apiServiceList = apiResourceRootV6.getClustersResource()
               .getServicesResource(cluster.getName()).readServices(DataView.SUMMARY);
         for (ApiService apiService : apiServiceList.getServices()) {
            if (!serviceRolesMap.containsKey(apiService.getName())) {
               // not touched by this resize, continue
               continue;
            }
            result.put(apiService.getName(), new ArrayList<ApiRole>());
View Full Code Here

   /*
    * get roles that is not in the expected state
    */
   private HashMap<String, Set<String>> getFailedRoles(String clusterName, ApiRoleState roleState) {
      HashMap<String, Set<String>> failedRoles = null;
      ApiServiceList serviceList = apiResourceRootV6.getClustersResource().getServicesResource(clusterName).readServices(
            DataView.FULL);
      if (serviceList != null && serviceList.getServices() != null && !serviceList.getServices().isEmpty()) {
         for (ApiService service : serviceList.getServices()) {
            for (ApiRole role : apiResourceRootV6.getClustersResource().getServicesResource(clusterName)
                  .getRolesResource(service.getName()).readRoles()) {
               logger.info("role " + role.getName() + " is in state " + role.getRoleState());
               if (!roleState.equals(role.getRoleState())) {
                  if (failedRoles == null) {
View Full Code Here

      });

      Iterator<CmServiceDef> serviceDefIterator = cluster.getServices().iterator();
      CmServiceDef hueService = null;
      while (serviceDefIterator.hasNext() || hueService != null) {
         ApiServiceList serviceList = new ApiServiceList();
         try {
            if (hueService != null) {
               CmServiceDef hdfsService = cluster.serviceDefOfType("HDFS");
               CmRoleDef namenodeRole = null;
               for (CmRoleDef roleDef : hdfsService.getRoles()) {
View Full Code Here

      List<ApiService> serviceList = new ArrayList<>();
      ApiService hdfs = new ApiService();
      hdfs.setName("HDFS");
      hdfs.setServiceState(ApiServiceState.STARTED);
      serviceList.add(hdfs);
      ApiServiceList apiServiceList = new ApiServiceList();
      apiServiceList.setServices(serviceList);
      Mockito.when(servicesResourceV6.readServices((DataView) anyObject())).thenReturn(apiServiceList);

      List<ApiRole> roleList = new ArrayList<>();
      ApiRole role = new ApiRole();
      role.setName("NAMENODE");
View Full Code Here

      List<ApiService> serviceList = new ArrayList<>();
      ApiService hdfs = new ApiService();
      hdfs.setName("HDFS");
      hdfs.setServiceState(ApiServiceState.STOPPED);
      serviceList.add(hdfs);
      ApiServiceList apiServiceList = new ApiServiceList();
      apiServiceList.setServices(serviceList);
      Mockito.when(servicesResourceV6.readServices((DataView) anyObject())).thenReturn(apiServiceList);

      List<ApiRole> roleList = new ArrayList<>();
      ApiRole role = new ApiRole();
      role.setName("NAMENODE");
View Full Code Here

TOP

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

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.