/* (non-Javadoc) * @see org.apache.oozie.command.XCommand#verifyPrecondition() */ @Override protected void verifyPrecondition() throws CommandException, PreconditionException { BundleStatusUpdateXCommand bundleStatusUpdate = new BundleStatusUpdateXCommand(coordJob, coordJob.getStatus()); // no actions have been created for PREP job if (coordJob.getStatus() == CoordinatorJob.Status.PREP || coordJob.getStatus() == CoordinatorJob.Status.IGNORED) { LOG.info( "CoordRerunXCommand is not able to run, job status=" + coordJob.getStatus() + ", jobid=" + jobId); // Call the parent so the pending flag is reset and state transition // of bundle can happen if (coordJob.getBundleId() != null) { bundleStatusUpdate.call(); } if (coordJob.getStatus() == CoordinatorJob.Status.PREP) { throw new CommandException( ErrorCode.E1018, "coordinator job is PREP so no actions are materialized to rerun!"); } else { throw new CommandException( ErrorCode.E1018, "coordinator job is IGNORED, please change it to RUNNING before rerunning actions"); } } }
@Override public void notifyParent() throws CommandException { // update bundle action if (getPrevStatus() != null && coordJob.getBundleId() != null) { BundleStatusUpdateXCommand bundleStatusUpdate = new BundleStatusUpdateXCommand(coordJob, getPrevStatus()); bundleStatusUpdate.call(); } }
/* (non-Javadoc) * @see org.apache.oozie.command.TransitionXCommand#notifyParent() */ @Override public void notifyParent() throws CommandException { // update bundle action if (coordJob.getBundleId() != null) { LOG.debug( "Updating bundle record: " + coordJob.getBundleId() + " for coord id: " + coordJob.getId()); BundleStatusUpdateXCommand bundleStatusUpdate = new BundleStatusUpdateXCommand(coordJob, prevStatus); bundleStatusUpdate.call(); } }