Search in sources :

Example 1 with BulkBundleXCommand

use of org.apache.oozie.command.bundle.BulkBundleXCommand in project oozie by apache.

the class BundleEngine method suspendJobs.

/**
 * return a list of suspended Bundle job
 *
 * @param filter the filter string for which the bundle jobs are suspended
 * @param start the starting index for bundle jobs
 * @param len maximum number of jobs to be suspended
 * @return the list of jobs being suspended
 * @throws BundleEngineException thrown if one or more of the jobs cannot be suspended
 */
public BundleJobInfo suspendJobs(String filter, int start, int len) throws BundleEngineException {
    try {
        Map<String, List<String>> filterList = parseFilter(filter);
        BundleJobInfo bundleJobInfo = new BulkBundleXCommand(filterList, start, len, OperationType.Suspend).call();
        if (bundleJobInfo == null) {
            return new BundleJobInfo(new ArrayList<BundleJobBean>(), 0, 0, 0);
        }
        return bundleJobInfo;
    } catch (CommandException ex) {
        throw new BundleEngineException(ex);
    }
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) CommandException(org.apache.oozie.command.CommandException) BulkBundleXCommand(org.apache.oozie.command.bundle.BulkBundleXCommand)

Example 2 with BulkBundleXCommand

use of org.apache.oozie.command.bundle.BulkBundleXCommand in project oozie by apache.

the class BundleEngine method killJobs.

/**
 * return a list of killed Bundle job
 *
 * @param filter the filter string for which the bundle jobs are killed
 * @param start the starting index for bundle jobs
 * @param len maximum number of jobs to be killed
 * @return the list of jobs being killed
 * @throws BundleEngineException thrown if one or more of the jobs cannot be killed
 */
public BundleJobInfo killJobs(String filter, int start, int len) throws BundleEngineException {
    try {
        Map<String, List<String>> filterList = parseFilter(filter);
        BundleJobInfo bundleJobInfo = new BulkBundleXCommand(filterList, start, len, OperationType.Kill).call();
        if (bundleJobInfo == null) {
            return new BundleJobInfo(new ArrayList<BundleJobBean>(), 0, 0, 0);
        }
        return bundleJobInfo;
    } catch (CommandException ex) {
        throw new BundleEngineException(ex);
    }
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) CommandException(org.apache.oozie.command.CommandException) BulkBundleXCommand(org.apache.oozie.command.bundle.BulkBundleXCommand)

Example 3 with BulkBundleXCommand

use of org.apache.oozie.command.bundle.BulkBundleXCommand in project oozie by apache.

the class BundleEngine method resumeJobs.

/**
 * return a list of resumed Bundle job
 *
 * @param filter the filter string for which the bundle jobs are resumed
 * @param start the starting index for bundle jobs
 * @param len maximum number of jobs to be resumed
 * @return the list of jobs being resumed
 * @throws BundleEngineException thrown if one or more of the jobs cannot be resumed
 */
public BundleJobInfo resumeJobs(String filter, int start, int len) throws BundleEngineException {
    try {
        Map<String, List<String>> filterList = parseFilter(filter);
        BundleJobInfo bundleJobInfo = new BulkBundleXCommand(filterList, start, len, OperationType.Resume).call();
        if (bundleJobInfo == null) {
            return new BundleJobInfo(new ArrayList<BundleJobBean>(), 0, 0, 0);
        }
        return bundleJobInfo;
    } catch (CommandException ex) {
        throw new BundleEngineException(ex);
    }
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) CommandException(org.apache.oozie.command.CommandException) BulkBundleXCommand(org.apache.oozie.command.bundle.BulkBundleXCommand)

Aggregations

ArrayList (java.util.ArrayList)3 List (java.util.List)3 CommandException (org.apache.oozie.command.CommandException)3 BulkBundleXCommand (org.apache.oozie.command.bundle.BulkBundleXCommand)3