Sachin Jain
Sachin Jain

Reputation: 117

Get host info from zookeeper client

Wanted to see if zookeeper or curator has any api that can return the host that it was connected to. This is mainly for debugging incase the connection was lost or session was expired we will know which host had the issue. I see CuratorZookeeperClient has a method getConnectionString() but seems like thats just returning the all the hosts in the ensemble.

Upvotes: 0

Views: 139

Answers (1)

Randgalt
Randgalt

Reputation: 2956

The ZooKeeper object has the protected method testableRemoteSocketAddress(). It's meant for testing only however. You can create a subclass that adds a method to return the value. Again, for testing only.

Upvotes: 1

Related Questions