예제 #1
0
 public synchronized void joinCluster(ZuCluster cluster, Set<Integer> shards)
     throws JoinException, InterruptedException {
   String clusterId = cluster.getClusterId();
   List<EndpointStatus> endpoints = endpointMap.get(clusterId);
   if (endpoints == null) {
     endpoints = cluster.join(addr, shards);
     endpointMap.put(clusterId, endpoints);
   } else {
     throw new JoinException("cluster " + clusterId + " already joined, leave first", null);
   }
 }
예제 #2
0
 public void leaveCluster(ZuCluster cluster) throws UpdateException {
   List<EndpointStatus> endpoints = endpointMap.remove(cluster.getClusterId());
   if (endpoints != null) {
     cluster.leave(endpoints);
   }
 }
예제 #3
0
 public SenseiBroker(ZuCluster clusterClient) {
   super(clusterClient, CoreSenseiServiceImpl.JAVA_SERIALIZER);
   clusterClient.addClusterEventListener(this);
 }