private synchronized Set<RequestScheduleResponse> createRequestSchedules
    (Set<RequestScheduleRequest> requests) throws AmbariException {

    if (requests.isEmpty()) {
      LOG.warn("Received an empty requests set");
      return null;
    }

    Set<RequestScheduleResponse> responses = new
      HashSet<>();

    Clusters clusters = getManagementController().getClusters();
    RequestExecutionFactory requestExecutionFactory =
      getManagementController().getRequestExecutionFactory();

    for (RequestScheduleRequest request : requests) {

      validateRequest(request);

      Cluster cluster;
      try {
        cluster = clusters.getCluster(request.getClusterName());
      } catch (ClusterNotFoundException e) {
        throw new ParentObjectNotFoundException(
          "Attempted to add a request schedule to a cluster which doesn't " +
            "exist", e);
      }

      String username = getManagementController().getAuthName();
      Integer userId = getManagementController().getAuthId();

      RequestExecution requestExecution = requestExecutionFactory.createNew
        (cluster, request.getBatch(), request.getSchedule());

      requestExecution.setCreateUser(username);
      requestExecution.setUpdateUser(username);
      requestExecution.setAuthenticatedUserId(userId);
      requestExecution.setStatus(RequestExecution.Status.SCHEDULED);

      LOG.info("Persisting new Request Schedule "
        + ", clusterName = " + request.getClusterName()
        + ", description = " + request.getDescription()
        + ", user = " + username);

      requestExecution.persist();
      cluster.addRequestExecution(requestExecution);

      // Setup batch schedule
      getManagementController().getExecutionScheduleManager()
        .scheduleAllBatches(requestExecution);

      RequestScheduleResponse response = new RequestScheduleResponse
        (requestExecution.getId(), requestExecution.getClusterName(),
          requestExecution.getDescription(), requestExecution.getStatus(),
          requestExecution.getLastExecutionStatus(),
          requestExecution.getBatch(), request.getSchedule(),
          requestExecution.getCreateUser(), requestExecution.getCreateTime(),
          requestExecution.getUpdateUser(), requestExecution.getUpdateTime(),
          requestExecution.getAuthenticatedUserId());

      responses.add(response);
    }

    return responses;
  }
Currently unsupported operation. Since strong guarantees are required
that no jobs are currently running.
@param request    the request object which defines the set of properties
                  for the resources to be updated
@param predicate  the predicate object which can be used to filter which
                  resources are updated

@return
@throws SystemException
@throws UnsupportedPropertyException
@throws NoSuchResourceException
@throws NoSuchParentResourceException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java