private static void createResources(AddServiceInfo request, Resource.Type resourceType, Set<Map<String, Object>> properties, Map<String, String> requestInfo, boolean okIfExists) {
    Request internalRequest = createRequest(properties, requestInfo, null);
    ResourceProvider rp = getClusterController().ensureResourceProvider(resourceType);
    try {
      rp.createResources(internalRequest);
    } catch (UnsupportedPropertyException | SystemException | ResourceAlreadyExistsException | NoSuchParentResourceException e) {
      if (okIfExists && e instanceof ResourceAlreadyExistsException) {
        LOG.info("Resource already exists: {}, no need to create", e.getMessage());
      } else {
        CHECK.wrapInUnchecked(e, RuntimeException::new, "Error creating resources %s for %s", resourceType, request);
      }
    }
  }
@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