public void invalidateConnection() throws IOException {
    closeConnection();
    // Update the master addresses if they changed.
    final String masterConfigBefore = conf.get(HConstants.MASTER_ADDRS_KEY);
    final String masterConfAfter = getMiniHBaseCluster().conf.get(HConstants.MASTER_ADDRS_KEY);
    LOG.info("Invalidated connection. Updating master addresses before: {} after: {}",
      masterConfigBefore, masterConfAfter);
    conf.set(HConstants.MASTER_ADDRS_KEY,
      getMiniHBaseCluster().conf.get(HConstants.MASTER_ADDRS_KEY));
  }
Resets the connections so that the next time getConnection() is called, a new connection is
created. This is needed in cases where the entire cluster / all the masters are shutdown and
the connection is not valid anymore. TODO: There should be a more coherent way of doing this.
Unfortunately the way tests are written, not all start() stop() calls go through this class.
Most tests directly operate on the underlying mini/local hbase cluster. That makes it difficult
for this wrapper class to maintain the connection state automatically. Cleaning this is a much
bigger refactor.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java