use of org.apache.oozie.command.coord.BulkCoordXCommand in project oozie by apache.
the class CoordinatorEngine method killJobs.
/**
* return a list of killed Coordinator job
*
* @param filter the filter string for which the coordinator jobs are killed
* @param start the starting index for coordinator jobs
* @param length maximum number of jobs to be killed
* @return coordinatorJobInfo the list of jobs being killed
* @throws CoordinatorEngineException thrown if one or more of the jobs cannot be killed
*/
public CoordinatorJobInfo killJobs(String filter, int start, int length) throws CoordinatorEngineException {
try {
Map<String, List<String>> filterMap = parseJobsFilter(filter);
CoordinatorJobInfo coordinatorJobInfo = new BulkCoordXCommand(filterMap, start, length, OperationType.Kill).call();
if (coordinatorJobInfo == null) {
return new CoordinatorJobInfo(new ArrayList<CoordinatorJobBean>(), 0, 0, 0);
}
return coordinatorJobInfo;
} catch (CommandException ex) {
throw new CoordinatorEngineException(ex);
}
}
use of org.apache.oozie.command.coord.BulkCoordXCommand in project oozie by apache.
the class CoordinatorEngine method resumeJobs.
/**
* return the jobs that've been resumed
* @param filter Filter for jobs that will be resumed, can be name, user, group, status, id or combination of any
* @param start Offset for the jobs that will be resumed
* @param length maximum number of jobs that will be resumed
* @return coordinatorJobInfo returns resumed jobs
* @throws CoordinatorEngineException if the jobs could not be resumed
*/
public CoordinatorJobInfo resumeJobs(String filter, int start, int length) throws CoordinatorEngineException {
try {
Map<String, List<String>> filterMap = parseJobsFilter(filter);
CoordinatorJobInfo coordinatorJobInfo = new BulkCoordXCommand(filterMap, start, length, OperationType.Resume).call();
if (coordinatorJobInfo == null) {
return new CoordinatorJobInfo(new ArrayList<CoordinatorJobBean>(), 0, 0, 0);
}
return coordinatorJobInfo;
} catch (CommandException ex) {
throw new CoordinatorEngineException(ex);
}
}
use of org.apache.oozie.command.coord.BulkCoordXCommand in project oozie by apache.
the class CoordinatorEngine method suspendJobs.
/**
* return the jobs that've been suspended
* @param filter Filter for jobs that will be suspended, can be name, user, group, status, id or combination of any
* @param start Offset for the jobs that will be suspended
* @param length maximum number of jobs that will be suspended
* @return coordinatorJobInfo
* @throws CoordinatorEngineException if the jobs could not be suspended
*/
public CoordinatorJobInfo suspendJobs(String filter, int start, int length) throws CoordinatorEngineException {
try {
Map<String, List<String>> filterMap = parseJobsFilter(filter);
CoordinatorJobInfo coordinatorJobInfo = new BulkCoordXCommand(filterMap, start, length, OperationType.Suspend).call();
if (coordinatorJobInfo == null) {
return new CoordinatorJobInfo(new ArrayList<CoordinatorJobBean>(), 0, 0, 0);
}
return coordinatorJobInfo;
} catch (CommandException ex) {
throw new CoordinatorEngineException(ex);
}
}
Aggregations