Examples of LateProcess


Examples of org.apache.ivory.entity.v0.process.LateProcess

      if (!RuntimeProperties.get()
          .getProperty("feed.late.allowed", "true")
          .equalsIgnoreCase("true")) {
        return null;
      }
      LateProcess lateProcess = new LateProcess();
      lateProcess.setDelay(new Frequency(RuntimeProperties.get()
          .getProperty("feed.late.frequency", "hours(3)")));
      lateProcess.setPolicy(PolicyType.fromValue(RuntimeProperties.get()
          .getProperty("feed.late.policy", "exp-backoff")));
      LateInput lateInput = new LateInput();
      lateInput.setInput(entity.getName());
      //TODO - Assuming the late workflow is not used
      lateInput.setWorkflowPath("ignore.xml");
      lateProcess.getLateInputs().add(lateInput);
      return lateProcess;
    case PROCESS:
      Process process = (Process) entity;
      return process.getLateProcess();
    default:
View Full Code Here

Examples of org.apache.ivory.entity.v0.process.LateProcess

  private long getEventDelay(Entity entity, String nominalTime)
      throws IvoryException {

    Date instanceDate = EntityUtil.parseDateUTC(nominalTime);
    LateProcess lateProcess = EntityUtil.getLateProcess(entity);
    if (lateProcess == null) {
      LOG.warn("Late run not applicable for entity:"
          + entity.getEntityType() + "(" + entity.getName() + ")");
      return -1;
    }
    PolicyType latePolicy = lateProcess.getPolicy();
    Date cutOffTime = getCutOffTime(entity, nominalTime);
    Date now = new Date();
    Long wait = null;

    if (now.after(cutOffTime)) {
      LOG.warn("Feed Cut Off time: "
          + SchemaHelper.formatDateUTC(cutOffTime)
          + " has expired, Late Rerun can not be scheduled");
      return -1;
    } else {
      AbstractRerunPolicy rerunPolicy = RerunPolicyFactory
          .getRetryPolicy(latePolicy);
      wait = rerunPolicy.getDelay(lateProcess.getDelay(), instanceDate,
          cutOffTime);
    }
    return wait;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.