Package com.vmware.bdd.software.mgmt.plugin.intf

Examples of com.vmware.bdd.software.mgmt.plugin.intf.SoftwareManager


               + clusterName + " does not exist");
         throw ClusterManagerException.NODEGROUP_NOT_FOUND_ERROR(nodeGroupName);
      }

      AuAssert.check(!group.getRoleNameList().isEmpty(), "roles should not be empty");
      SoftwareManager softMgr =
            softwareManagerCollector
                  .getSoftwareManager(cluster.getAppManager());
      List<String> unsupportedRoles =
            softMgr.validateScaling(clusterEntityMgr
                  .toNodeGroupInfo(clusterName, nodeGroupName));
      if (!unsupportedRoles.isEmpty()) {
         logger.info("can not resize node group with role: " + unsupportedRoles);
         throw ClusterManagerException.ROLES_NOT_SUPPORTED(unsupportedRoles);
      }
View Full Code Here


      ClusterEntity cluster = clusterEntityMgr.findByName(clusterName);
      if (cluster == null) {
         logger.error("cluster " + clusterName + " does not exist");
         throw BddException.NOT_FOUND("Cluster", clusterName);
      }
      SoftwareManager softMgr =
         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;

      if (groupName != null) {
         NodeGroupEntity nodeGroup =
               clusterEntityMgr.findByName(clusterName, groupName);
         if (nodeGroup == null) {
            logger.error("node group " + groupName + " does not exist");
            throw BddException.NOT_FOUND("group", groupName);
         }

         nodeGroups = new ArrayList<NodeGroupEntity>(1);
         nodeGroups.add(nodeGroup);
      } else {
         nodeGroups = clusterEntityMgr.findAllGroups(clusterName);
      }

      // only fix worker nodes that have datanode or tasktracker roles
      boolean workerNodesFound = false;
      JobParametersBuilder parametersBuilder = new JobParametersBuilder();
      List<JobParameters> jobParameterList = new ArrayList<JobParameters>();

      for (NodeGroupEntity nodeGroup : nodeGroups) {
         List<String> roles = nodeGroup.getRoleNameList();

         // TODO: more fine control on node roles
         if (softMgr.hasMgmtRole(roles)) {
            logger.info("node group " + nodeGroup.getName()
                  + " contains management roles, pass it");
            continue;
         }
View Full Code Here

      // This step is only for app manager like ClouderaMgr and Ambari
      String clusterName =
            getJobParameters(chunkContext).getString(
                  JobConstants.CLUSTER_NAME_JOB_PARAM);

      SoftwareManager softwareMgr =
            softwareMgrs.getSoftwareManagerByClusterName(clusterName);

      String appMgrName = softwareMgr.getName();
      if (Constants.IRONFAN.equals(appMgrName)) {
         // we do not config any local repo for Ironfan
         return RepeatStatus.FINISHED;
      }
View Full Code Here

      logger.info("Start to check host time.");
      ClusterCreate clusterSpec = clusterManager.getClusterSpec(clusterName);

      Set<String> hostnames = new HashSet<String>();
      hostnames.add(node.getHostName());
      SoftwareManager softManager =
            softwareManagerCollector
                  .getSoftwareManagerByClusterName(clusterName);
      SyncHostsUtils.SyncHosts(clusterSpec, hostnames, softManager);

      ISoftwareManagementTask task = null;
      if (!Constants.IRONFAN.equals(softManager.getName())) {
         task =
               createExternalTask(targetName, clusterName);
      } else {
         task = createThriftCommandTask(targetName);
      }
View Full Code Here

      }
   }

   private ISoftwareManagementTask createExternalTask(String targetName,
         String clusterName) {
      SoftwareManager softwareMgr =
            softwareManagerCollector
                  .getSoftwareManagerByClusterName(clusterName);
      ClusterBlueprint clusterBlueprint =
            lockClusterEntityMgr.getClusterEntityMgr().toClusterBluePrint(
                  clusterName);
View Full Code Here

      }

      // Only check host time for cluster config, disk fix, scale up (management
      // operation configure), start (management operation start) and create
      // (resume only)
      SoftwareManager softwareMgr = null;
      try {
         softwareMgr = softwareMgrs.getSoftwareManagerByClusterName(clusterName);
      } catch (SoftwareManagerCollectorException e) {
         if (ManagementOperation.PRE_DESTROY.equals(managementOperation) ||
               ManagementOperation.DESTROY.equals(managementOperation)) {
            return RepeatStatus.FINISHED;
         }
         throw e;
      }
      if (ManagementOperation.CONFIGURE.equals(managementOperation)
            || ManagementOperation.START.equals(managementOperation)
            || JobConstants.RESUME_CLUSTER_JOB_NAME.equals(jobName)) {
         logger.info("Start to check host time.");
         List<NodeEntity> nodes =
               lockClusterEntityMgr.getClusterEntityMgr().findAllNodes(
                     clusterName);
         Set<String> hostnames = new HashSet<String>();
         for (NodeEntity node : nodes) {
            hostnames.add(node.getHostName());
         }
         ClusterCreate clusterSpec = clusterManager.getClusterSpec(clusterName);
         SyncHostsUtils.SyncHosts(clusterSpec, hostnames, softwareMgr);
      }

      StatusUpdater statusUpdater =
            new DefaultStatusUpdater(jobExecutionStatusHolder,
                  getJobExecutionId(chunkContext));

      ISoftwareManagementTask task = null;
      String appMgrName = softwareMgr.getName();
      if (!Constants.IRONFAN.equals(appMgrName)) {
         task =
               createExternalTask(chunkContext, targetName, clusterName,
                     statusUpdater);
      } else {
View Full Code Here

   private ISoftwareManagementTask createExternalTask(
         ChunkContext chunkContext, String targetName, String clusterName,
         StatusUpdater statusUpdater) {
      ISoftwareManagementTask task;
      SoftwareManager softwareMgr =
            softwareMgrs.getSoftwareManagerByClusterName(clusterName);

      ClusterBlueprint clusterBlueprint =
            getFromJobExecutionContext(chunkContext,
                  JobConstants.CLUSTER_BLUEPRINT_JOB_PARAM,
View Full Code Here

    * @param appManagerEntity
    * @return
    */
   private SoftwareManager loadSoftwareManager(AppManagerEntity appManagerEntity) {
      if (appManagerEntity.getName().equals(Constants.IRONFAN)) {
         SoftwareManager ironfanSoftwareManager = new DefaultSoftwareManagerImpl();
         cache.put(Constants.IRONFAN, ironfanSoftwareManager);
         return ironfanSoftwareManager;
      } else {
         // Do not block initialization in case of Exception
         return loadSoftwareManager(toAppManagerAdd(appManagerEntity));
View Full Code Here

         throw new SWMgrCollectorInternalException(e, errMsg);
//         throw SoftwareManagerCollectorException.CAN_NOT_INSTANTIATE(e, factoryClassName);
      }

      logger.info("Start to invoke application manager factory to create application manager.");
      SoftwareManager softwareManager = null;

      try {
         softwareManager =
               softwareManagerFactory.getSoftwareManager(appManagerAdd.getUrl(), appManagerAdd
                     .getUsername(), appManagerAdd.getPassword().toCharArray(),
View Full Code Here

   }

   private void updateVersion(AppManagerRead appManagerRead) {
      String softMgrVersion = "UNKNOWN";

      final SoftwareManager softwareManager = this.getSoftwareManager(appManagerRead.getName());
      // fork a child thread to do the actual connecting action
      // this is to avoid the time out issue for the socket connection when the target host is shutdown
      ExecutorService exec = Executors.newFixedThreadPool(1);
      Future<String> futureResult = exec.submit(new Callable<String>(){
         @Override
         public String call() throws Exception {
            // TODO Auto-generated method stub
            return softwareManager.getVersion();
         }
      });

      String result = (String)CommonUtil.waitForThreadResult(futureResult, waitTimeForAppMgrConn);
      if (null != result) {
View Full Code Here

TOP

Related Classes of com.vmware.bdd.software.mgmt.plugin.intf.SoftwareManager

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.