public boolean containsMapping(String serviceName, String componentName) {
    for (KerberosKeytabServiceMappingEntity mappingEntity : serviceMapping) {
      if (Objects.equal(mappingEntity.getComponentName(), componentName)
        && Objects.equal(mappingEntity.getServiceName(), serviceName)) {
        return true;
      }
    }
    return false;
  }
Service mappings must be fetched {@link FetchType#EAGER} since they are
required when processing {@link KerberosKeytabPrincipalEntity} instances
and turning them into {@link ResolvedKerberosPrincipal}.
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosKeytabPrincipalEntity.java