gpt4 book ai didi

com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.deleteRecursive()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:22:30 26 4
gpt4 key购买 nike

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

ZkClientx.deleteRecursive介绍

暂无

代码示例

代码示例来源:origin: com.alibaba.otter/shared.arbitrate

public void removeCanal(String destination) {
  String path = String.format(CANAL_PATH, destination);
  zookeeper.deleteRecursive(path);
}

代码示例来源:origin: com.alibaba.otter/shared.arbitrate

@Override
public void removeCanal(String destination, short clientId) {
  String path = String.format(CANAL_DATA_PATH, destination, String.valueOf(clientId));
  zookeeper.deleteRecursive(path);
}

代码示例来源:origin: com.alibaba.otter/shared.arbitrate

/**
 * 销毁对应的pipeline节点,同步调用
 */
public void destory(Long channelId, Long pipelineId) {
  String path = ManagePathUtils.getPipeline(channelId, pipelineId);
  String processRootPath = ManagePathUtils.getProcessRoot(channelId, pipelineId);
  String terminRootPath = ManagePathUtils.getTerminRoot(channelId, pipelineId);
  String remedyRootPath = ManagePathUtils.getRemedyRoot(channelId, pipelineId);
  String lockRootPath = ManagePathUtils.getLockRoot(channelId, pipelineId);
  String loadLockPath = lockRootPath + "/" + ArbitrateConstants.NODE_LOCK_LOAD;
  try {
    zookeeper.deleteRecursive(loadLockPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(lockRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(terminRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(remedyRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(processRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(path); // 删除节点,不关心版本
  } catch (ZkNoNodeException e) {
    // 如果节点已经不存在,则不抛异常
    // ignore
  } catch (ZkException e) {
    throw new ArbitrateException("Pipeline_destory", pipelineId.toString(), e);
  }
}

代码示例来源:origin: com.alibaba.otter/shared.arbitrate

/**
 * 销毁对应的系统节点,同步调用
 */
public void destory() {
  String rootPath = ManagePathUtils.getRoot();
  String channelRootPath = ManagePathUtils.getChannelRoot();
  String nodeRootPath = ManagePathUtils.getNodeRoot();
  try {
    zookeeper.deleteRecursive(channelRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(nodeRootPath); // 删除节点,不关心版本
    zookeeper.deleteRecursive(rootPath); // 删除节点,不关心版本
  } catch (ZkNoNodeException e) {
    // 如果节点已经不存在,则不抛异常
    // ignore
  } catch (ZkException e) {
    throw new ArbitrateException("system_destory", e);
  }
}

代码示例来源:origin: com.alibaba.otter/shared.common

public boolean deleteRecursive(String path) {
  List<String> children;
  try {
    children = getChildren(path, false);
  } catch (ZkNoNodeException e) {
    return true;
  }
  for (String subPath : children) {
    if (!deleteRecursive(path + "/" + subPath)) {
      return false;
    }
  }
  return delete(path);
}

代码示例来源:origin: com.alibaba.otter/shared.arbitrate

result = zookeeper.deleteRecursive(StagePathUtils.getProcess(pipelineId, processId));
if (!result) {
  doProcess(data, true);// 做一次重试,可能做manager关闭的时侯,node节点还跑了一段,导致stage节点又创建了一个

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