private void setClusterId(ClusterId id) {
    if (id == null || isClusterIdSet.get()) {
      return;
    }
    clusterId = id;
    isClusterIdSet.set(true);
  }
Succeeds only once, when setting to a non-null value. Overwrites are not allowed.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/CachedClusterId.java