Package com.vmware.bdd.apitypes

Examples of com.vmware.bdd.apitypes.ClusterStatus


         softwareManagerCollector
               .getSoftwareManager(cluster.getAppManager());

      ValidationUtils.validateVersion(clusterEntityMgr, clusterName);

      ClusterStatus oldStatus = cluster.getStatus();

      if (!oldStatus.isActiveServiceStatus()) {
         throw ClusterHealServiceException.NOT_SUPPORTED(clusterName,
               "The cluster status must be RUNNING");
      }

      List<NodeGroupEntity> nodeGroups;
View Full Code Here


      String clusterName = scale.getClusterName();

      opsBlocker.blockUnsupportedOpsByCluster("scale Up/Down", clusterName);

      ValidationUtils.validateVersion(clusterEntityMgr, clusterName);
      ClusterStatus originalStatus =
            clusterEntityMgr.findByName(clusterName).getStatus();
      logger.info("before scaling, cluster status is:" + originalStatus);
      if (scale.getMemory() > 0) {
         //VM's memory must be divisible by 4, otherwise VM can not be started
         long converted = VcVmUtil.makeVmMemoryDivisibleBy4(scale.getMemory());
View Full Code Here

   public void transformClusterStatus() {
      List<ClusterEntity> allClusters = clusterEntityManager.findAllClusters();
      Set<ClusterStatus> toProvisonErrorSet = new HashSet<ClusterStatus>(Arrays.asList(toProvisionError));
      Set<ClusterStatus> toErrorSet = new HashSet<ClusterStatus>(Arrays.asList(toError));
      for (ClusterEntity clusterEntity : allClusters) {
         ClusterStatus fromStatus = clusterEntity.getStatus();
         ClusterStatus toStatus;
         if (toProvisonErrorSet.contains(fromStatus)) {
            toStatus = ClusterStatus.PROVISION_ERROR;
         } else if (toErrorSet.contains(fromStatus)) {
            toStatus = ClusterStatus.ERROR;
         } else {
            continue;
         }

         clusterEntity.setStatus(toStatus);
         clusterEntityManager.update(clusterEntity);
         logger.info("update status from " + fromStatus.toString() + " to " + toStatus.toString()
               + " for cluster: " + clusterEntity.getName());
      }
   }
View Full Code Here

      handleNodeStatus(report, true);
   }

   private void handleClusterStatus(String clusterName, ClusterReport report) {
      ClusterEntity cluster = findByName(clusterName);
      ClusterStatus oldState = cluster.getStatus();
      switch (oldState) {
      case RUNNING:
      case SERVICE_STOPPED:
      case SERVICE_WARNING:
         switch (report.getStatus()) {
View Full Code Here

         boolean ignoreObsoleteNode) {
      ClusterEntity cluster = findByName(clusterName);
      if (cluster == null) {
         throw BddException.NOT_FOUND("Cluster", clusterName);
      }
      ClusterStatus clusterStatus = cluster.getStatus();
      ClusterRead clusterRead = new ClusterRead();
      clusterRead
            .setInstanceNum(cluster.getRealInstanceNum(ignoreObsoleteNode));
      clusterRead.setName(cluster.getName());
      clusterRead.setStatus(clusterStatus);
      clusterRead.setAppManager(cluster.getAppManager());
      clusterRead.setDistro(cluster.getDistro());
      clusterRead.setDistroVendor(cluster.getDistroVendor());
      clusterRead.setTopologyPolicy(cluster.getTopologyPolicy());
      clusterRead.setAutomationEnable(cluster.getAutomationEnable());
      clusterRead.setVhmMinNum(cluster.getVhmMinNum());
      clusterRead.setVhmMaxNum(cluster.getVhmMaxNum());
      clusterRead.setVhmTargetNum(cluster.getVhmTargetNum());
      clusterRead.setIoShares(cluster.getIoShares());
      clusterRead.setVersion(cluster.getVersion());
      if (!CommonUtil.isBlank(cluster.getAdvancedProperties())) {
         Gson gson = new Gson();
         Map<String, String> advancedProperties =
               gson.fromJson(cluster.getAdvancedProperties(), Map.class);
         clusterRead.setExternalHDFS(advancedProperties.get("ExternalHDFS"));
         clusterRead.setExternalMapReduce(advancedProperties
               .get("ExternalMapReduce"));
         clusterRead.setLocalRepoURL(advancedProperties.get("LocalRepoURL"));
      }

      SoftwareManager softMgr = null;
      try {
         softMgr =
               softwareManagerCollector.getSoftwareManager(cluster
                     .getAppManager());
      } catch (Exception e) {
         logger.error("Failed to get softwareManger.");
         // do not throw exception for exporting cluster info
      }

      List<NodeGroupRead> groupList = new ArrayList<NodeGroupRead>();
      for (NodeGroupEntity group : cluster.getNodeGroups()) {
         NodeGroupRead groupRead = group.toNodeGroupRead(ignoreObsoleteNode);
         groupRead.setComputeOnly(false);
         try {
            groupRead.setComputeOnly(softMgr.isComputeOnlyRoles(groupRead
                  .getRoles()));
         } catch (Exception e) {
         }
         groupList.add(groupRead);
      }

      clusterRead.setNodeGroups(groupList);

      Set<VcResourcePoolEntity> rps = cluster.getUsedRps();
      List<ResourcePoolRead> rpReads =
            new ArrayList<ResourcePoolRead>(rps.size());
      for (VcResourcePoolEntity rp : rps) {
         ResourcePoolRead rpRead = rp.toRest();
         rpRead.setNodes(null);
         rpReads.add(rpRead);
      }
      clusterRead.setResourcePools(rpReads);

      if (clusterStatus.isActiveServiceStatus()
            || clusterStatus == ClusterStatus.STOPPED) {
         clusterRead.setDcSeperation(clusterRead.validateSetManualElasticity());
      }

      return clusterRead;
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void storeClusterLastStatus(String clusterName) {
      ClusterStatus clusterStatus = clusterDao.getStatus(clusterName);
      if (!ClusterStatus.UPGRADE_ERROR.equals(clusterStatus)
            && !ClusterStatus.UPGRADING.equals(clusterStatus)) {
         clusterDao.updateLastStatus(clusterName, clusterStatus);
      }
   }
View Full Code Here

      if (success == null || success) {
         success = (je.getExitStatus().equals(ExitStatus.COMPLETED));
      }

      ClusterStatus status = null;
      if (success && successStatus != null) {
         status = ClusterStatus.valueOf(successStatus);
      } else if (!success && failureStatus != null) {
         status = ClusterStatus.valueOf(failureStatus);
      }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.apitypes.ClusterStatus

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.