gpt4 book ai didi

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

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

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

ZKAssign.transitionNodeClosed介绍

[英]Transitions an existing unassigned node for the specified entityGroup which is currently in the CLOSING state to be in the CLOSED state.

Does not transition nodes from other states. If for some reason the node could not be transitioned, the method returns -1. If the transition is successful, the version of the node after transition is returned.

This method can fail and return false for three different reasons:

  • Unassigned node for this entityGroup does not exist
  • Unassigned node for this entityGroup is not in CLOSING state
  • After verifying CLOSING state, update fails because of wrong version (someone else already transitioned the node)

Does not set any watches.

This method should only be used by a FServer when initiating a close of a entityGroup after receiving a CLOSE RPC from the Master.
[中]将当前处于关闭状态的指定entityGroup的现有未分配节点转换为关闭状态。
不从其他状态转换节点。如果由于某种原因无法转换节点,该方法将返回-1。如果转换成功,则返回转换后的节点版本。
由于三种不同的原因,此方法可能会失败并返回false:
*此entityGroup的未分配节点不存在
*此entityGroup的未分配节点未处于关闭状态
*验证关闭状态后,更新因版本错误而失败(其他人已转换该节点)
不设置任何手表。
仅当FServer在从主服务器接收到关闭RPC后启动entityGroup关闭时,才应使用此方法。

代码示例

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

final EntityGroup entityGroup) {
try {
 if (ZKAssign.transitionNodeClosed(server.getZooKeeper(), entityGroupInfo,
   server.getServerName(), expectedVersion) == FAILED) {
  LOG.warn("Completed the CLOSE of a entityGroup but when transitioning from "

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

int versionid = ZKAssign.transitionNodeClosed(this.watcher,
  ENTITYGROUPINFO, SERVERNAME_A, -1);
assertNotSame(versionid, -1);

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