gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 11:21:43 27 4
gpt4 key购买 nike

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

ZkClientx.delete介绍

暂无

代码示例

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

/**
 * 释放锁对象
 */
public void unlock() throws KeeperException {
  if (id != null) {
    zookeeper.delete(root + "/" + id);
    id = null;
    idName = null;
  } else {
    // do nothing
  }
}

代码示例来源: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

public void removeCanalCursor(String destination, short clientId) {
  String path = String.format(CANAL_CURSOR_PATH, destination, String.valueOf(clientId));
  zookeeper.delete(path);
}

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

/**
 * 销毁对应的channel节点,同步调用
 */
public void destory(Long channelId) {
  String path = ManagePathUtils.getChannelByChannelId(channelId);
  try {
    zookeeper.delete(path); // 删除节点,不关心版本
  } catch (ZkNoNodeException e) {
    // 如果节点已经不存在,则不抛异常
    // ignore
  } catch (ZkException e) {
    throw new ArbitrateException("Channel_destory", channelId.toString(), e);
  }
}

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

/**
 * 销毁的node节点
 * 
 * <pre>
 * 1. 是个同步调用
 * </pre>
 */
public void destory(Long nid) {
  String path = ManagePathUtils.getNode(nid);
  try {
    zookeeper.delete(path); // 删除节点,不关心版本
  } catch (ZkNoNodeException e) {
    // 如果节点已经不存在,则不抛异常
    // ignore
  } catch (ZkException e) {
    throw new ArbitrateException("Node_destory", nid.toString(), e);
  }
}

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

/**
 * 删除一个index节点
 */
public void removeRemedyIndex(RemedyIndexEventData data) {
  String path = StagePathUtils.getRemedyRoot(data.getPipelineId());
  try {
    zookeeper.delete(path + "/" + RemedyIndexEventData.formatNodeName(data));
  } catch (ZkNoNodeException e) {
    // ignore
  } catch (ZkException e) {
    throw new ArbitrateException("removeRemedyIndex", data.getPipelineId().toString(), e);
  }
}

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

public boolean releaseMainstem() {
  if (check()) {
    String path = StagePathUtils.getMainStem(getPipelineId());
    zookeeper.delete(path);
    mutex.set(false);
    processActiveExit();
    return true;
  }
  return false;
}

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

boolean successed = zookeeper.delete(StagePathUtils.getSelectStage(pipelineId, processId));
if (!successed) {
  processDeleteFailed();
boolean successed = zookeeper.delete(StagePathUtils.getExtractStage(pipelineId, processId));
if (!successed) {
  processDeleteFailed();
boolean successed = zookeeper.delete(StagePathUtils.getTransformStage(pipelineId, processId));
if (!successed) {
  processDeleteFailed();

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

/**
 * <pre>
 * 算法:
 * 1. 客户端处理完成对应的termin事件后,反馈给仲裁器处理完成。仲裁器根据对应S.E.T.L的反馈情况,判断是否删除对应的termin信号
 * </pre>
 */
public void ack(TerminEventData data) {
  Assert.notNull(data);
  // 目前只有select模块需要发送ack信号,这里一旦收到一个信号后就删除对应的termin节点,后续可扩展
  // 删除termin节点
  String path = StagePathUtils.getTermin(data.getPipelineId(), data.getProcessId());
  try {
    zookeeper.delete(path);
  } catch (ZkNoNodeException e) {
    // ignore,说明节点已经被删除
  } catch (ZkException e) {
    throw new ArbitrateException("Termin_ack", e);
  }
  TerminMonitor terminMonitor = ArbitrateFactory.getInstance(data.getPipelineId(), TerminMonitor.class);
  terminMonitor.ack(data.getProcessId());
}

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

zookeeper.delete(path);
return await(pipelineId);// 出现rollback情况,递归调用重新获取一次,当前的processId可丢弃

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

zookeeper.delete(path); // 忽略删除失败
return await(pipelineId);// 递归调用

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

zookeeper.delete(path); // 忽略删除失败
return await(pipelineId);// 递归调用

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

zookeeper.delete(path);
return await(pipelineId);// 递归调用

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

zookeeper.delete(path);
return await(pipelineId);// 递归调用

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