public String getHash(String clusterName, String hostName) {
    ConcurrentMap<String, String> clusterMapping = m_hashes.get(hostName);
    if (null == clusterMapping) {
      clusterMapping = new ConcurrentHashMap<>();
      ConcurrentMap<String, String> temp = m_hashes.putIfAbsent(hostName, clusterMapping);
      if (temp != null) {
        clusterMapping = temp;
      }
    }

    String hash = clusterMapping.get(hostName);
    if (null != hash) {
      return hash;
    }

    hash = hash(clusterName, hostName);
    clusterMapping.put(clusterName, hash);

    return hash;
  }
Gets a unique hash value reprssenting all of the alert definitions that
should be scheduled to run on a given host.
<p/>
This will not include alert definitions where the type is defined as
{@link SourceType#AGGREGATE} since aggregate definitions are not scheduled
to run on agent hosts.
<p/>
Hash values from this method are cached.

@param clusterName
         the cluster name (not {@code null}).
@param hostName
         the host name (not {@code null}).
@return the unique hash or {@value #NULL_MD5_HASH} if none.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java