com.ke.kob.basic.constant.ZkPathConstant.serverNodePath()方法的使用及代码示例

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

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

ZkPathConstant.serverNodePath介绍

暂无

代码示例

代码示例来源:origin: LianjiaTech/kob

@Override
  public void afterPropertiesSet() throws Exception {
    this.masterElector = new MasterElector(cluster, now.getTime());
    this.masterPath = ZkPathConstant.serverNodePath(cluster);
  }
}

代码示例来源:origin: LianjiaTech/kob

public String getLocalNodePath() {
  return ZkPathConstant.serverNodePath(cluster) + ZkPathConstant.BACKSLASH + JSONObject.toJSONString(masterElector.getLocal());
}

代码示例来源:origin: LianjiaTech/kob

@Override
public List<NodeServer> getNodeServerList() {
  String serverNodePath = ZkPathConstant.serverNodePath(cluster);
  if (!zkClient.exists(serverNodePath)) {
    return new ArrayList<>();
  }
  List<String> nodeServerStrList = zkClient.getChildren(serverNodePath);
  List<NodeServer> nodeServerList = new ArrayList<>();
  if (!KobUtils.isEmpty(nodeServerStrList)) {
    for (String nodeServerStr : nodeServerStrList) {
      NodeServer nodeServer = JSONObject.parseObject(nodeServerStr, NodeServer.class);
      nodeServerList.add(nodeServer);
    }
  }
  return nodeServerList;
}

代码示例来源:origin: LianjiaTech/kob

return;
List<String> currentChilds = zkClient.getChildren(ZkPathConstant.serverNodePath(serverContext.getCluster()));
NodeServer currentNodeServerMaster = MasterElector.getNodeMaster(currentChilds);
if (!currentNodeServerMaster.getIdentification().equals(serverContext.getMasterElector().getMaster().getIdentification())) {

相关文章