*/
@SuppressWarnings("unchecked")
private JSONObject reRunCoordinatorActions(HttpServletRequest request, HttpServletResponse response,
Configuration conf) throws XServletException {
JSONObject json = new JSONObject();
CoordinatorEngine coordEngine = Services.get().get(CoordinatorEngineService.class).getCoordinatorEngine(getUser(request),
getAuthToken(request));
String jobId = getResourceName(request);
String rerunType = request.getParameter(RestConstants.JOB_COORD_RERUN_TYPE_PARAM);
String scope = request.getParameter(RestConstants.JOB_COORD_RERUN_SCOPE_PARAM);
String refresh = request.getParameter(RestConstants.JOB_COORD_RERUN_REFRESH_PARAM);
String noCleanup = request.getParameter(RestConstants.JOB_COORD_RERUN_NOCLEANUP_PARAM);
XLog.getLog(getClass()).info(
"Rerun coordinator for jobId=" + jobId + ", rerunType=" + rerunType + ",scope=" + scope + ",refresh="
+ refresh + ", noCleanup=" + noCleanup);
try {
if (!(rerunType.equals(RestConstants.JOB_COORD_RERUN_DATE) || rerunType
.equals(RestConstants.JOB_COORD_RERUN_ACTION))) {
throw new CommandException(ErrorCode.E1018, "date or action expected.");
}
CoordinatorActionInfo coordInfo = coordEngine.reRun(jobId, rerunType, scope, Boolean.valueOf(refresh),
Boolean.valueOf(noCleanup));
List<CoordinatorActionBean> coordActions;
if (coordInfo != null) {
coordActions = coordInfo.getCoordActions();
}