public void pauseAfterBatchIfNeeded(long executionId, long batchId, String clusterName) throws AmbariException {
    Cluster cluster = clusters.getCluster(clusterName);
    RequestExecution requestExecution = cluster.getAllRequestExecutions().get(executionId);

    if (requestExecution == null) {
      throw new AmbariException("Unable to find request schedule with id = "
        + executionId);
    }

    Batch batch = requestExecution.getBatch();
    if (batch != null) {
      BatchSettings batchSettings = batch.getBatchSettings();
      if (batchSettings != null) {
        if (SCHEDULED.name().equals(requestExecution.getStatus()) && getFirstJobOrderId(requestExecution) == batchId &&
            batchSettings.isPauseAfterFirstBatch()) {
          LOG.info("Auto pausing the scheduled request after first batch. Scheduled request ID : " + executionId);
          requestExecution.updateStatus(PAUSED);
        }
      }
    }
  }
Checks if scheduled request should be auto paused and updates the status to PAUSED if it does.
For now the condition is following: the current status is SCHEDULED,
it's the first batch and the pauseAfterFirstBatch flag is TRUE
ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java