protected RequestStatus abortRequestById(RequestExecution requestExecution, Long requestId) throws AmbariException {
    LOG.debug("Aborting request " + requestId);
    ResourceProvider provider =
      AbstractControllerResourceProvider.getResourceProvider(Resource.Type.Request);

    Map<String, Object> properties = new HashMap<>();
    properties.put(RequestResourceProvider.REQUEST_CLUSTER_NAME_PROPERTY_ID, requestExecution.getClusterName());
    properties.put(RequestResourceProvider.REQUEST_ABORT_REASON_PROPERTY_ID, "Request execution status changed to " + requestExecution.getStatus());
    properties.put(RequestResourceProvider.REQUEST_ID_PROPERTY_ID, Long.toString(requestId));
    properties.put(RequestResourceProvider.REQUEST_STATUS_PROPERTY_ID, HostRoleStatus.ABORTED.name());

    org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.emptySet(),
        Collections.singleton(properties), Collections.emptyMap(), null);

    Predicate predicate =  new PredicateBuilder()
        .property(RequestResourceProvider.REQUEST_CLUSTER_NAME_PROPERTY_ID)
        .equals(requestExecution.getClusterName()).and()
        .property(RequestResourceProvider.REQUEST_ID_PROPERTY_ID)
        .equals(Long.toString(requestId)).toPredicate();

    try{
      return provider.updateResources(request, predicate);
    } catch (Exception e) {
     throw new AmbariException("Error while aborting the request.", e);
    }
  }
Get status of a long running operation
@return
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java