本文整理了Java中com.ke.kob.basic.constant.ZkPathConstant.serverNodePath()
方法的一些代码示例,展示了ZkPathConstant.serverNodePath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkPathConstant.serverNodePath()
方法的具体详情如下:
包路径:com.ke.kob.basic.constant.ZkPathConstant
类名称: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())) {
内容来源于网络,如有侵权,请联系作者删除!