Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我已经连接到一个集群
HFactory.getOrCreateCluster(cluster, address)
有没有办法稍后检查我是否仍然连接?通过查看他们的 javadocs 似乎没有明显的方法来做到这一点。
一种选择可能是在 try-catch 语句中向集群发出一个简单的查询,并查看它是否正确返回,或者是否引发异常。