zu.core.cluster.ZuCluster.getClusterId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(61)

本文整理了Java中zu.core.cluster.ZuCluster.getClusterId()方法的一些代码示例,展示了ZuCluster.getClusterId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZuCluster.getClusterId()方法的具体详情如下:
包路径:zu.core.cluster.ZuCluster
类名称:ZuCluster
方法名:getClusterId

ZuCluster.getClusterId介绍

暂无

代码示例

代码示例来源:origin: com.senseidb.zu/zu-finagle

public void leaveCluster(ZuCluster cluster) throws UpdateException{
 List<EndpointStatus> endpoints = endpointMap.remove(cluster.getClusterId());
 if (endpoints != null) {
  cluster.leave(endpoints);
 }
}

代码示例来源:origin: com.senseidb.zu/zu-finagle

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);
 }
}

代码示例来源:origin: com.senseidb/sensei-core

@SuppressWarnings({ "unchecked", "rawtypes" })
public void start(boolean available) throws Exception {
 _core.start();
 logger.info("Cluster Id: " + cluster.getClusterId());
 AbstractSenseiCoreService<SenseiRequest, SenseiResult> coreSenseiService = new CoreSenseiServiceImpl(
   _core);
 AbstractSenseiCoreService<SenseiRequest, SenseiSystemInfo> sysSenseiCoreService = new SysSenseiCoreServiceImpl(
   _core);
 SenseiCoreServiceMessageHandler<SenseiRequest, SenseiResult> senseiMsgHandler = new SenseiCoreServiceMessageHandler<SenseiRequest, SenseiResult>(
   coreSenseiService);
 SenseiCoreServiceMessageHandler<SenseiRequest, SenseiSystemInfo> senseiSysMsgHandler = new SenseiCoreServiceMessageHandler<SenseiRequest, SenseiSystemInfo>(
   sysSenseiCoreService);
 transportService.registerHandler(senseiMsgHandler);
 transportService.registerHandler(senseiSysMsgHandler);
 server.start();
 if (_externalSvc != null) {
  for (AbstractSenseiCoreService svc : _externalSvc) {
   transportService.registerHandler(new SenseiCoreServiceMessageHandler(svc));
  }
 }
 setAvailable(available);
 SenseiServerAdminMBean senseiAdminMBean = getAdminMBean();
 StandardMBean bean = new StandardMBean(senseiAdminMBean, SenseiServerAdminMBean.class);
 JmxUtil.registerMBean(bean, "name", "sensei-server-" + _id);
}

相关文章