private Set<String> getPasswordProperties(Cluster cluster, StackId stackId, String configType) {
    final long clusterId = cluster.getClusterId();
    clusterPasswordProperties.computeIfAbsent(clusterId, v -> new ConcurrentHashMap<>()).computeIfAbsent(stackId, v -> new ConcurrentHashMap<>())
        .computeIfAbsent(configType, v -> cluster.getConfigPropertiesTypes(configType, stackId).getOrDefault(PropertyInfo.PropertyType.PASSWORD, new HashSet<>()));
    return clusterPasswordProperties.get(clusterId).get(stackId).getOrDefault(configType, new HashSet<>());
  }
A common base class for various encryptor implementations
ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java