public String getDescription() { final StringBuffer actionsString = new StringBuffer(); for (final TriggerAction act : this.actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + this.triggerCondition.getExpression() + " and expire condition of " + this.expireCondition.getExpression() + actionsString; }
private BasicTimeChecker getEndTimeChecker(final Trigger t) { if (t.getExpireCondition().getExpression().contains("EndTimeChecker")) { return getBasicTimeChecker(t.getExpireCondition().getCheckers()); } return null; }
private void checkAllTriggers() throws TriggerManagerException { // sweep through the rest of them for (final Trigger t : this.triggers) { try { TriggerManager.this.scannerStage = "Checking for trigger " + t.getTriggerId(); if (t.getStatus().equals(TriggerStatus.READY)) { /** * Prior to this change, expiration condition should never be called though * we have some related code here. ExpireCondition used the same BasicTimeChecker * as triggerCondition do. As a consequence, we need to figure out a way to distinguish * the previous ExpireCondition and this commit's ExpireCondition. */ if (t.getExpireCondition().getExpression().contains("EndTimeChecker") && t .expireConditionMet()) { onTriggerPause(t); } else if (t.triggerConditionMet()) { onTriggerTrigger(t); } } if (t.getStatus().equals(TriggerStatus.EXPIRED) && t.getSource().equals("azkaban")) { removeTrigger(t); } else { t.updateNextCheckTime(); } } catch (final Throwable th) { //skip this trigger, moving on to the next one logger.error("Failed to process trigger with id : " + t, th); } } }
assertTrue(cond.getExpression().equals(cond2.getExpression())); System.out.println("cond1: " + cond.getExpression()); System.out.println("cond2: " + cond2.getExpression()); assertTrue(checkers2.size() == 1); final ConditionChecker checker2 = checkers2.get(timeChecker.getId());
public String getDescription() { StringBuffer actionsString = new StringBuffer(); for(TriggerAction act : actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + triggerCondition.getExpression() + " and expire condition of " + expireCondition.getExpression() + actionsString; }
public String getDescription() { final StringBuffer actionsString = new StringBuffer(); for (final TriggerAction act : this.actions) { actionsString.append(", "); actionsString.append(act.getDescription()); } return "Trigger from " + getSource() + " with trigger condition of " + this.triggerCondition.getExpression() + " and expire condition of " + this.expireCondition.getExpression() + actionsString; }
private BasicTimeChecker getEndTimeChecker(final Trigger t) { if (t.getExpireCondition().getExpression().contains("EndTimeChecker")) { return getBasicTimeChecker(t.getExpireCondition().getCheckers()); } return null; }
private void checkAllTriggers() throws TriggerManagerException { // sweep through the rest of them for (final Trigger t : this.triggers) { try { TriggerManager.this.scannerStage = "Checking for trigger " + t.getTriggerId(); if (t.getStatus().equals(TriggerStatus.READY)) { /** * Prior to this change, expiration condition should never be called though * we have some related code here. ExpireCondition used the same BasicTimeChecker * as triggerCondition do. As a consequence, we need to figure out a way to distinguish * the previous ExpireCondition and this commit's ExpireCondition. */ if (t.getExpireCondition().getExpression().contains("EndTimeChecker") && t .expireConditionMet()) { onTriggerPause(t); } else if (t.triggerConditionMet()) { onTriggerTrigger(t); } } if (t.getStatus().equals(TriggerStatus.EXPIRED) && t.getSource().equals("azkaban")) { removeTrigger(t); } else { t.updateNextCheckTime(); } } catch (final Throwable th) { //skip this trigger, moving on to the next one logger.error("Failed to process trigger with id : " + t, th); } } }