Tuesday, March 9, 2021

Java: Checking if HBase Master is reachable from hbase-client

As of HBase 2.1 methods like HBaseAdmin.available() are deprecated. How do we go about checking if the HBase connection is valid?

It turns out the hbase-client will continually retry the connection transparently. 

So this means without changing the retry you might wait indefinitely to get an exception from HBase telling you if (and why) your connection failed.

Here is a snippet that you can incorporate into your existing Java code. Note that this code will not run as-is without being placed into a Java class.

No comments:

Post a Comment