我知道 Zookeeper Server 有一个名为“tickTime”的配置(最小心跳时间 =2*ticktime),客户端可以请求“会话超时”。
建立连接时..它会获得与之相关的会话超时。这是在客户端和服务器之间协商的。
如何找到他们都确定的价值?
我知道 Zookeeper Server 有一个名为“tickTime”的配置(最小心跳时间 =2*ticktime),客户端可以请求“会话超时”。
建立连接时..它会获得与之相关的会话超时。这是在客户端和服务器之间协商的。
如何找到他们都确定的价值?
在 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