@Override public void removeTrigger(final int id, final String user) throws TriggerManagerException { removeTrigger(id); }
public void removeTrigger(final int id) throws TriggerManagerException { logger.info("Removing trigger with id: " + id + " from TriggerManager"); synchronized (this.syncObj) { final Trigger t = triggerIdMap.get(id); if (t != null) { removeTrigger(triggerIdMap.get(id)); } } }
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); } } }
@Ignore @Test public void deadlockTest() throws TriggerLoaderException, TriggerManagerException { // this should well saturate it for (int i = 0; i < 1000; i++) { final Trigger t = createSelfRegenTrigger(); this.loader.addTrigger(t); } // keep going and add more for (int i = 0; i < 10000; i++) { final Trigger d = createDummyTrigger(); this.triggerManager.insertTrigger(d); this.triggerManager.removeTrigger(d); } System.out.println("No dead lock."); }
@Override public void removeTrigger(int id, String user) throws TriggerManagerException { removeTrigger(id); }
@Override public void removeTrigger(final int id, final String user) throws TriggerManagerException { removeTrigger(id); }
public void removeTrigger(int id) throws TriggerManagerException { synchronized (syncObj) { Trigger t = triggerIdMap.get(id); if(t != null) { removeTrigger(triggerIdMap.get(id)); } } }
public void removeTrigger(final int id) throws TriggerManagerException { logger.info("Removing trigger with id: " + id + " from TriggerManager"); synchronized (this.syncObj) { final Trigger t = triggerIdMap.get(id); if (t != null) { removeTrigger(triggerIdMap.get(id)); } } }
removeTrigger(t); } else { t.updateNextCheckTime();
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); } } }