Ejemplo n.º 1
0
 public List<PhysicalMachine> getAllPm() {
   List<PhysicalMachine> pml = new ArrayList<PhysicalMachine>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.PM_PATH_S, true, PathUtil.PM_PATH_E, true).entrySet()) {
     pml.add((PhysicalMachine) e.getValue());
   }
   return pml;
 }
Ejemplo n.º 2
0
 public List<Cluster> getAllCluster() {
   List<Cluster> cl = new ArrayList<Cluster>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.CLUSTER_PATH_S, true, PathUtil.CLUSTER_PATH_E, true).entrySet()) {
     cl.add((Cluster) e.getValue());
   }
   return cl;
 }
Ejemplo n.º 3
0
 public List<Gateway> getGwList(String clusterName) {
   List<Gateway> gwl = new ArrayList<Gateway>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.GW_PATH_S(clusterName), true, PathUtil.GW_PATH_E(clusterName), true)
           .entrySet()) {
     gwl.add((Gateway) e.getValue());
   }
   return gwl;
 }
Ejemplo n.º 4
0
 public List<PhysicalMachineCluster> getPmcList(String pmName) {
   List<PhysicalMachineCluster> pmcl = new ArrayList<PhysicalMachineCluster>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.PMC_PATH_S(pmName), true, PathUtil.PMC_PATH_E(pmName), true)
           .entrySet()) {
     pmcl.add((PhysicalMachineCluster) e.getValue());
   }
   return pmcl;
 }
Ejemplo n.º 5
0
 public List<RedisServer> getRsList(String clusterName) {
   List<RedisServer> rsl = new ArrayList<RedisServer>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.RS_PATH_S(clusterName), true, PathUtil.RS_PATH_E(clusterName), true)
           .entrySet()) {
     rsl.add((RedisServer) e.getValue());
   }
   return rsl;
 }
Ejemplo n.º 6
0
 public List<PartitionGroupServer> getPgsList(String clusterName) {
   List<PartitionGroupServer> pgsl = new ArrayList<PartitionGroupServer>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.PGS_PATH_S(clusterName), true, PathUtil.PGS_PATH_E(clusterName), true)
           .entrySet()) {
     pgsl.add((PartitionGroupServer) e.getValue());
   }
   return pgsl;
 }
Ejemplo n.º 7
0
 public void open(Serializable e) throws Exception {
   Properties jobParameters =
       BatchRuntime.getJobOperator().getParameters(jobContext.getExecutionId());
   ConcurrentSkipListMap<Integer, PayrollInputRecord> records =
       dataBean.getPayrollInputRecords((String) jobParameters.get("monthYear"));
   Integer fromKey = (Integer) jobParameters.get("startEmpID");
   Integer toKey = (Integer) jobParameters.get("endEmpID");
   payrollInputRecords = records.subMap(fromKey, true, toKey, false).values().iterator();
 }
Ejemplo n.º 8
0
 public List<RedisServer> getRsList(String clusterName, String pgName) {
   final int pgId = Integer.valueOf(pgName);
   List<RedisServer> rsl = new ArrayList<RedisServer>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.RS_PATH_S(clusterName), true, PathUtil.RS_PATH_E(clusterName), true)
           .entrySet()) {
     RedisServer rs = (RedisServer) e.getValue();
     if (rs.getPgId() == pgId) {
       rsl.add(rs);
     }
   }
   return rsl;
 }
Ejemplo n.º 9
0
 public List<PartitionGroupServer> getPgsList(String clusterName, String pgName) {
   final int pgId = Integer.valueOf(pgName);
   List<PartitionGroupServer> pgsl = new ArrayList<PartitionGroupServer>();
   for (Entry<String, ClusterComponent> e :
       map.subMap(PathUtil.PGS_PATH_S(clusterName), true, PathUtil.PGS_PATH_E(clusterName), true)
           .entrySet()) {
     PartitionGroupServer pgs = (PartitionGroupServer) e.getValue();
     if (pgs.getPgId() == pgId) {
       pgsl.add(pgs);
     }
   }
   return pgsl;
 }
 /** Create a map from Integers 1-5 to Strings "A"-"E". */
 private static ConcurrentNavigableMap map5() {
   ConcurrentSkipListMap map = new ConcurrentSkipListMap();
   assertTrue(map.isEmpty());
   map.put(zero, "Z");
   map.put(one, "A");
   map.put(five, "E");
   map.put(three, "C");
   map.put(two, "B");
   map.put(four, "D");
   map.put(seven, "F");
   assertFalse(map.isEmpty());
   assertEquals(7, map.size());
   return map.subMap(one, true, seven, false);
 }