public Optional<KerberosDescriptor> getKerberosDescriptor(AddServiceInfo request) {
    Set<String> propertyIds = ImmutableSet.of(ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY);
    Predicate predicate = predicateForKerberosDescriptorArtifact(request.clusterName());

    Set<Resource> resources = getResources(request, propertyIds, Resource.Type.Artifact, predicate);

    if (resources == null || resources.isEmpty()) {
      return Optional.empty();
    }

    CHECK.checkArgument(resources.size() == 1,
      "Expected only one artifact of type %s, but got %d",
      ArtifactResourceProvider.KERBEROS_DESCRIPTOR,
      resources.size()
    );

    return Optional.of(descriptorFactory.createInstance(resources.iterator().next().getPropertiesMap().get(ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY)));
  }
@return {@code Optional} with the cluster's kerberos descriptor artifact if it exists, otherwise empty {@code Optional}
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java