【发布时间】:2015-11-04 06:26:08
【问题描述】:
我知道 Zookeeper Server 有一个名为“tickTime”的配置(最小心跳时间 =2*ticktime),客户端可以请求“会话超时”。
当建立连接时.. 它会获得一个与之相关的会话超时。这是在客户端和服务器之间协商的。
如何找到他们都选择的价值?
【问题讨论】:
标签: apache-zookeeper apache-curator
我知道 Zookeeper Server 有一个名为“tickTime”的配置(最小心跳时间 =2*ticktime),客户端可以请求“会话超时”。
当建立连接时.. 它会获得一个与之相关的会话超时。这是在客户端和服务器之间协商的。
如何找到他们都选择的价值?
【问题讨论】:
标签: apache-zookeeper apache-curator
在 Java 中,ZooKeeper 实例有一个方法:getSessionTimeout()。对此的评论是:
public int getSessionTimeout()
The negotiated session timeout for this ZooKeeper client instance.
The value returned is not valid until the client connects to a server
and may change after a re-connect. This method is NOT thread safe
Returns:
current session timeout
【讨论】: