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

Examples of com.vmware.bdd.software.mgmt.plugin.model.ClusterBlueprint


   @ResponseBody
   public ValidateResult validateBlueprint(@RequestBody ClusterCreate createSpec) {
      SoftwareManager softwareManager =
            clusterMgr.getClusterConfigMgr().getSoftwareManager(
                  createSpec.getAppManager());
      ClusterBlueprint blueprint = createSpec.toBlueprint();
      ValidateResult result = new ValidateResult();
      boolean validated = false;
      try {
         validated = softwareManager.validateBlueprint(blueprint);
      } catch (ValidationException ve) {
View Full Code Here


   @Test
   public void createClusterTasklet() throws Exception {
      ExternalManagementTask task =
            new ExternalManagementTask("testCluster",
                  ManagementOperation.CREATE, new ClusterBlueprint(),
                  new MockStatusUpdator(),
                  new MockConcurrentClusterEntityManager(),
                  new MockSoftwareManager(), null);

      Map<String, Object> result = task.call();
View Full Code Here

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

         SoftwareManager softMgr, List<BaseNode> toBeDeleted) {
      if (toBeDeleted.isEmpty()) {
         return;
      }

      ClusterBlueprint blueprint =
            clusterEntityMgr.toClusterBluePrint(toBeDeleted.get(0)
                  .getClusterName());
      ClusterReportQueue queue = new ClusterReportQueue();
      List<String> nodeNames = new ArrayList<>();
      for (BaseNode node : toBeDeleted) {
View Full Code Here

         StatusUpdater statusUpdater) {
      ISoftwareManagementTask task;
      SoftwareManager softwareMgr =
            softwareMgrs.getSoftwareManagerByClusterName(clusterName);

      ClusterBlueprint clusterBlueprint =
            getFromJobExecutionContext(chunkContext,
                  JobConstants.CLUSTER_BLUEPRINT_JOB_PARAM,
                  ClusterBlueprint.class);
      if (clusterBlueprint == null) {
         clusterBlueprint =
View Full Code Here

            filterDistroFromAppManager(softwareManager, cluster.getDistro());
      if (cluster.getDistro() == null || stack == null) {
         throw BddException.INVALID_PARAMETER("distro", cluster.getDistro());
      }
      // only check roles validity in server side, but not in CLI and GUI, because roles info exist in server side.
      ClusterBlueprint blueprint = cluster.toBlueprint();
      try {
         softwareManager.validateBlueprint(cluster.toBlueprint());
         cluster.validateClusterCreate(failedMsgList, warningMsgList);
      } catch (ValidationException e) {
         failedMsgList.addAll(e.getFailedMsgList());
View Full Code Here

         clusterCreate.setExternalMapReduce(advancedProperties
               .get("ExternalMapReduce"));
         clusterCreate.setLocalRepoURL(advancedProperties.get("LocalRepoURL"));
      }
      // only check roles validity in server side, but not in CLI and GUI, because roles info exist in server side.
      ClusterBlueprint blueprint = clusterCreate.toBlueprint();
      try {
         softwareManager.validateBlueprint(blueprint);
      } catch (ValidationException e) {
         throw ClusterConfigException.INVALID_SPEC(e.getFailedMsgList());
      }
View Full Code Here

                        + cluster.getStatus());
                  logger.debug("Stop sync up for it");
                  ite.remove();
                  continue;
               }
               ClusterBlueprint blueprint =
                     lockedEntityManager.getClusterEntityMgr()
                           .toClusterBluePrint(clusterName);
               SoftwareManager softMgr =
                     softwareManagerCollector
                           .getSoftwareManagerByClusterName(clusterName);
View Full Code Here

      update(node);
   }

   public ClusterBlueprint toClusterBluePrint(String clusterName) {
      ClusterEntity clusterEntity = findByName(clusterName);
      ClusterBlueprint blueprint = new ClusterBlueprint();
      Gson gson = new Gson();

      blueprint.setName(clusterEntity.getName());
      blueprint.setInstanceNum(clusterEntity.getRealInstanceNum(true));
      // TODO: topology
      if (clusterEntity.getHadoopConfig() != null) {
         Map<String, Object> clusterConfigs =
               gson.fromJson(clusterEntity.getHadoopConfig(), Map.class);
         blueprint.setConfiguration(clusterConfigs);
      }

      // set HadoopStack
      HadoopStack hadoopStack = new HadoopStack();
      hadoopStack.setDistro(clusterEntity.getDistro());
      hadoopStack.setVendor(clusterEntity.getDistroVendor());
      hadoopStack.setFullVersion(clusterEntity.getDistroVersion());
      blueprint.setHadoopStack(hadoopStack);

      // set nodes/nodegroups
      List<NodeGroupInfo> nodeGroupInfos = new ArrayList<NodeGroupInfo>();
      for (NodeGroupEntity group : clusterEntity.getNodeGroups()) {
         NodeGroupInfo nodeGroupInfo = toNodeGroupInfo(group);
         nodeGroupInfos.add(nodeGroupInfo);
      }
      blueprint.setNodeGroups(nodeGroupInfos);
      return blueprint;
   }
View Full Code Here

   }

   @Test
   public void testValidateRoleDependency() {
      ClusterBlueprint blueprint = new ClusterBlueprint();
      List<String> failedMsgList = new ArrayList<String>();
      assertEquals(false, validator.validateRoleDependency(failedMsgList, blueprint));

      NodeGroupInfo compute = new NodeGroupInfo();
      NodeGroupInfo data = new NodeGroupInfo();
      List<NodeGroupInfo> nodeGroupInfos = new ArrayList<NodeGroupInfo>();
      nodeGroupInfos.add(compute);
      nodeGroupInfos.add(data);
      blueprint.setNodeGroups(nodeGroupInfos);
      assertEquals(false, validator.validateRoleDependency(failedMsgList, blueprint));
      assertEquals(2, failedMsgList.size());
      failedMsgList.clear();
      blueprint.setExternalHDFS("hdfs://192.168.0.2:9000");
      compute.setRoles(Arrays.asList(HadoopRole.HADOOP_TASKTRACKER.toString()));
      data.setRoles(Arrays.asList(HadoopRole.HADOOP_DATANODE.toString()));
      assertEquals(false, validator.validateRoleDependency(failedMsgList, blueprint));
      assertEquals(2, failedMsgList.size());
      assertEquals("Duplicate NameNode or DataNode role.", failedMsgList.get(0));
      assertEquals("Missing JobTracker or ResourceManager role.",
            failedMsgList.get(1));
      failedMsgList.clear();
      blueprint.setExternalHDFS("");
      nodeGroupInfos = new ArrayList<NodeGroupInfo>();
      nodeGroupInfos.add(compute);
      blueprint.setNodeGroups(nodeGroupInfos);
      assertEquals(false, validator.validateRoleDependency(failedMsgList, blueprint));
      assertEquals(1, failedMsgList.size());
      assertEquals("Missing role(s): hadoop_jobtracker for service: MAPRED.", failedMsgList.get(0));
      failedMsgList.clear();
      NodeGroupInfo master = new NodeGroupInfo();
      master.setRoles(Arrays.asList(HadoopRole.HADOOP_JOBTRACKER_ROLE
            .toString()));
      nodeGroupInfos = new ArrayList<NodeGroupInfo>();
      nodeGroupInfos.add(master);
      nodeGroupInfos.add(compute);
      blueprint.setNodeGroups(nodeGroupInfos);
      assertEquals(false, validator.validateRoleDependency(failedMsgList, blueprint));
      assertEquals(1, failedMsgList.size());
      assertEquals("Some dependent services " + EnumSet.of(ServiceType.HDFS)
            + " " + ServiceType.MAPRED
            + " relies on cannot be found in the spec file.",
View Full Code Here

TOP

Related Classes of com.vmware.bdd.software.mgmt.plugin.model.ClusterBlueprint

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.