Package com.vmware.bdd.spectypes

Examples of com.vmware.bdd.spectypes.VcCluster


         if (!clusterMap.containsKey(vcCluster.getName())) {
            clusterMap.put(vcCluster.getName(), vcCluster);
            continue;
         }
         List<String> rps = vcCluster.getVcRps();
         VcCluster storedCluster = clusterMap.get(vcCluster.getName());
         if (rps == null)
            continue;
         for (String rp : rps) {
            if (storedCluster.getVcRps().contains(rp)) {
               continue;
            }
            storedCluster.addVCResourcePool(rp);
         }
      }
   }
View Full Code Here


   private List<VcCluster> convertToVcCluster(List<VcResourcePoolEntity> rps) {
      if (rps == null || rps.isEmpty()) {
         return null;
      }
      List<VcCluster> vcClusters = new ArrayList<VcCluster>();
      VcCluster prevCluster = null;
      for (VcResourcePoolEntity rp : rps) {
         if (prevCluster == null) {
            prevCluster =
                  new VcCluster(rp.getVcCluster(), new ArrayList<String>());
            vcClusters.add(prevCluster);
         }

         if (rp.getVcCluster().equals(prevCluster.getName())) {
            prevCluster.addVCResourcePool(rp.getVcResourcePool());
         } else {
            prevCluster =
                  new VcCluster(rp.getVcCluster(), new ArrayList<String>());
            vcClusters.add(prevCluster);
            prevCluster.addVCResourcePool(rp.getVcResourcePool());
         }
      }
      return vcClusters;
   }
View Full Code Here

      rpSvc.setRpDao(rpDao);
      rpSvc.setResService(resService);
      List<String> rps = new ArrayList<String>();
      rps.add("rp1");
      rps.add("rp2");
      VcCluster cluster1 = Mockito.mock(VcCluster.class);
      Mockito.when(cluster1.getName()).thenReturn("cluster1");
      Mockito.when(cluster1.getVcRps()).thenReturn(rps);

      List<VcCluster> clusters = new ArrayList<VcCluster>();
      clusters.add(cluster1);

      rpSvc.addAutoResourcePools(clusters, false);
View Full Code Here

      }

      List<VcCluster> availableVcClusters =
            node.getNodeGroup().getVcClusters(this.cluster);

      VcCluster targetVcCluster = null;

      for (VcCluster vcCluster : availableVcClusters) {
         if (vcCluster.getName().equals(abstractCluster.getName())) {
            targetVcCluster = vcCluster;
            break;
         }
      }

      AuAssert.check(targetVcCluster != null);

      String targetRp =
            getLeastUsed(targetVcCluster.getName(), targetVcCluster.getVcRps());

      Pair<String, String> rpPair =
            new Pair<String, String>(targetVcCluster.getName(), targetRp);
      // update rp usage map
      rpUsage.put(rpPair, rpUsage.get(rpPair) + 1);

      // update cluster->rp by group map
      if (!rpMapByGroup.containsKey(nodeGroupName)) {
         rpMapByGroup.put(nodeGroupName, new HashMap<String, String>());
      }
      Map<String, String> clusterRpMap = rpMapByGroup.get(nodeGroupName);
      clusterRpMap.put(targetVcCluster.getName(), targetRp);

      return rpPair;
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.spectypes.VcCluster

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.