private static void collectFromComponents(String service, Collection<KerberosComponentDescriptor> components, Map<String, String> result) {
    for (KerberosComponentDescriptor each : components) {
      collectFromIdentities(service, each.getName(), nullToEmpty(each.getIdentities()), result);
    }
  }
Get a map of principals, where the key is the principal path (SERVICE/COMPONENT/principal_name or SERVICE/principal_name) and the value is the principal.
<p>
For example if the kerberos principal of the HISTORYSERVER is defined in the kerberos.json:
"name": "history_server_jhs",
"principal": {
"value": "jhs/_HOST@${realm}",
"type" : "service",
},
Then "jhs/_HOST@EXAMPLE.COM" will be put into the map under the "MAPREDUCE2/HISTORYSERVER/history_server_jhs" key.
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java