public Optional<ServerName> getActiveMasterServerName() {
    if (!clusterHasActiveMaster.get()) {
      return Optional.empty();
    }
    if (activeMasterServerName == null) {
      fetchAndSetActiveMasterServerName();
    }
    // It could still be null, but return whatever we have.
    return Optional.ofNullable(activeMasterServerName);
  }
Fetches the active master's ServerName from zookeeper.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java