@Override public boolean isSatisfied(ProgramSchedule schedule, List<Notification> notifications) { for (Notification notification : notifications) { if (isSatisfied(schedule, notification)) { return true; } } return false; }
@Override public boolean isSatisfied(ProgramSchedule schedule, List<Notification> notifications) { for (Notification notification : notifications) { if (isSatisfied(schedule, notification)) { return true; } } return false; }
@Override public void updateLaunchArguments(ProgramSchedule schedule, List<Notification> notifications, Map<String, String> systemArgs, Map<String, String> userArgs) { for (Notification notification : notifications) { if (!isSatisfied(schedule, notification)) { continue; } String systemOverridesJson = notification.getProperties().get(ProgramOptionConstants.SYSTEM_OVERRIDES); String userOverridesJson = notification.getProperties().get(ProgramOptionConstants.USER_OVERRIDES); if (userOverridesJson == null || systemOverridesJson == null) { // Ignore the malformed notification continue; } systemArgs.putAll(GSON.<Map<String, String>>fromJson(systemOverridesJson, STRING_STRING_MAP)); userArgs.putAll(GSON.<Map<String, String>>fromJson(userOverridesJson, STRING_STRING_MAP)); return; } }
@Override public void updateLaunchArguments(ProgramSchedule schedule, List<Notification> notifications, Map<String, String> systemArgs, Map<String, String> userArgs) { for (Notification notification : notifications) { if (!isSatisfied(schedule, notification)) { continue; } String systemOverridesJson = notification.getProperties().get(ProgramOptionConstants.SYSTEM_OVERRIDES); String userOverridesJson = notification.getProperties().get(ProgramOptionConstants.USER_OVERRIDES); if (userOverridesJson == null || systemOverridesJson == null) { // Ignore the malformed notification continue; } systemArgs.putAll(GSON.<Map<String, String>>fromJson(systemOverridesJson, STRING_STRING_MAP)); userArgs.putAll(GSON.<Map<String, String>>fromJson(userOverridesJson, STRING_STRING_MAP)); return; } }
@Override public List<TriggerInfo> getTriggerInfos(TriggerInfoContext context) { for (Notification notification : context.getNotifications()) { if (!isSatisfied(context.getSchedule(), notification)) { continue; } Long logicalStartTime = getLogicalStartTime(notification); if (logicalStartTime == null) { LOG.warn("The notification '{}' in the job of schedule '{}' does not contain logical start time", notification, context.getSchedule()); continue; } TriggerInfo triggerInfo = new DefaultTimeTriggerInfo(getCronExpression(), logicalStartTime); return Collections.singletonList(triggerInfo); } return Collections.emptyList(); }
@Override public List<TriggerInfo> getTriggerInfos(TriggerInfoContext context) { for (Notification notification : context.getNotifications()) { if (!isSatisfied(context.getSchedule(), notification)) { continue; } Long logicalStartTime = getLogicalStartTime(notification); if (logicalStartTime == null) { LOG.warn("The notification '{}' in the job of schedule '{}' does not contain logical start time", notification, context.getSchedule()); continue; } TriggerInfo triggerInfo = new DefaultTimeTriggerInfo(getCronExpression(), logicalStartTime); return Collections.singletonList(triggerInfo); } return Collections.emptyList(); }