@Override protected void processNotification(ProgramScheduleStoreDataset scheduleStore, JobQueueDataset jobQueue, Notification notification) { Map<String, String> properties = notification.getProperties(); String scheduleIdString = properties.get(ProgramOptionConstants.SCHEDULE_ID); if (scheduleIdString == null) { LOG.warn("Ignore notification that misses schedule id, {}", notification); return; } ScheduleId scheduleId; try { scheduleId = GSON.fromJson(scheduleIdString, ScheduleId.class); } catch (JsonSyntaxException e) { // If the notification is from pre-4.3 version, scheduleId is not in JSON format, // parse it with fromString method scheduleId = ScheduleId.fromString(scheduleIdString); } ProgramScheduleRecord record; try { record = scheduleStore.getScheduleRecord(scheduleId); } catch (NotFoundException e) { LOG.warn("Ignore notification that doesn't have a schedule {} associated with, {}", scheduleId, notification); return; } jobQueue.addNotification(record, notification); } }
@Override protected void processNotification(ProgramScheduleStoreDataset scheduleStore, JobQueueDataset jobQueue, Notification notification) { Map<String, String> properties = notification.getProperties(); String scheduleIdString = properties.get(ProgramOptionConstants.SCHEDULE_ID); if (scheduleIdString == null) { LOG.warn("Ignore notification that misses schedule id, {}", notification); return; } ScheduleId scheduleId; try { scheduleId = GSON.fromJson(scheduleIdString, ScheduleId.class); } catch (JsonSyntaxException e) { // If the notification is from pre-4.3 version, scheduleId is not in JSON format, // parse it with fromString method scheduleId = ScheduleId.fromString(scheduleIdString); } ProgramScheduleRecord record; try { record = scheduleStore.getScheduleRecord(scheduleId); } catch (NotFoundException e) { LOG.warn("Ignore notification that doesn't have a schedule {} associated with, {}", scheduleId, notification); return; } jobQueue.addNotification(record, notification); } }