gpt4 book ai didi

com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils.getDestinationPath()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 19:07:31 26 4
gpt4 key购买 nike

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

ZookeeperPathUtils.getDestinationPath介绍

暂无

代码示例

代码示例来源:origin: alibaba/canal

return new ArrayList<ClientIdentity>();
String path = ZookeeperPathUtils.getDestinationPath(destination);
List<String> childs = null;
try {

代码示例来源:origin: alibaba/canal

private void initRunning() {
  if (!isStart()) {
    return;
  }
  String path = ZookeeperPathUtils.getDestinationServerRunning(destination);
  // 序列化
  byte[] bytes = JsonUtils.marshalToByte(serverData);
  try {
    mutex.set(false);
    zkClient.create(path, bytes, CreateMode.EPHEMERAL);
    activeData = serverData;
    processActiveEnter();// 触发一下事件
    mutex.set(true);
  } catch (ZkNodeExistsException e) {
    bytes = zkClient.readData(path, true);
    if (bytes == null) {// 如果不存在节点,立即尝试一次
      initRunning();
    } else {
      activeData = JsonUtils.unmarshalFromByte(bytes, ServerRunningData.class);
    }
  } catch (ZkNoNodeException e) {
    zkClient.createPersistent(ZookeeperPathUtils.getDestinationPath(destination), true); // 尝试创建父节点
    initRunning();
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com