コード例 #1
0
ファイル: ZuFinagleServer.java プロジェクト: javasoze/zu
 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
ファイル: ZuFinagleServer.java プロジェクト: javasoze/zu
 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);
 }