gpt4 book ai didi

com.alibaba.wasp.zookeeper.ZKUtil.deleteNodeFailSilent()方法的使用及代码示例

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

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

ZKUtil.deleteNodeFailSilent介绍

[英]Deletes the specified node. Fails silent if the node does not exist.
[中]删除指定的节点。如果节点不存在,则失败为静默。

代码示例

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

/**
 * Deletes the table in zookeeper. Fails silently if the table is not
 * currently disabled in zookeeper. Sets no watches.
 *
 * @param tableName
 * @throws org.apache.zookeeper.KeeperException
 *           unexpected zookeeper exception
 */
public void setDeletedTable(final String tableName) throws KeeperException {
 synchronized (this.cache) {
  if (this.cache.remove(tableName) == null) {
   LOG.warn("Moving table " + tableName + " state to deleted but was "
     + "already deleted");
  }
  ZKUtil.deleteNodeFailSilent(this.watcher,
    ZKUtil.joinZNode(this.watcher.tableZNode, tableName));
 }
}

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

/**
 * Delete the assignment node regardless of its current state.
 * <p>
 * Fail silent even if the node does not exist at all.
 * @param watcher
 * @param entityGroupInfo
 * @throws org.apache.zookeeper.KeeperException
 */
public static void deleteNodeFailSilent(ZooKeeperWatcher watcher,
  EntityGroupInfo entityGroupInfo) throws KeeperException {
 String node = getNodeName(watcher, entityGroupInfo.getEncodedName());
 ZKUtil.deleteNodeFailSilent(watcher, node);
}

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

@Override
 EntityGroup openEntityGroup() {
  // Open entityGroup first, then remove znode as though it'd been
  // hijacked.
  EntityGroup entityGroup = super.openEntityGroup();
  // Don't actually open entityGroup BUT remove the znode as though it'd
  // been hijacked on us.
  ZooKeeperWatcher zkw = this.server.getZooKeeper();
  String node = ZKAssign.getNodeName(zkw, egi.getEncodedName());
  try {
   ZKUtil.deleteNodeFailSilent(zkw, node);
  } catch (KeeperException e) {
   throw new RuntimeException("Ugh failed delete of " + node, e);
  }
  return entityGroup;
 }
};

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

LOG.info("Deleting ZNode for " + backupZNode
  + " from backup master directory");
ZKUtil.deleteNodeFailSilent(this.watcher, backupZNode);

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