public String getFromCacheOrFetch() {
    if (server.isStopping() || server.isStopped()) {
      return null;
    }
    String id = getClusterId();
    if (id != null) {
      return id;
    }
    if (!attemptFetch()) {
      // A fetch is in progress.
      try {
        waitForFetchToFinish();
      } catch (InterruptedException e) {
        // pass and return whatever is in the cache.
      }
    }
    return getClusterId();
  }
Fetches the ClusterId from FS if it is not cached locally. Atomically updates the cached copy
and is thread-safe. Optimized to do a single fetch when there are multiple threads are trying
get from a clean cache.
@return ClusterId by reading from FileSystem or null in any error case or cluster ID does not
        exist on the file system or if the server initiated a tear down.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/CachedClusterId.java