use of com.netflix.titus.common.framework.scheduler.model.event.ScheduleAddedEvent in project titus-control-plane by Netflix.
the class DefaultLocalScheduler method doRun.
private void doRun() {
Stopwatch timer = Stopwatch.createStarted();
List<ScheduleHolder> holders = new ArrayList<>();
newHolders.drainTo(holders);
holders.forEach(h -> {
activeHoldersById.put(h.getSchedule().getId(), h);
eventProcessor.onNext(new ScheduleAddedEvent(h.getSchedule()));
});
try {
activeHoldersById.values().forEach(ScheduleHolder::handleExecution);
} catch (Exception e) {
logger.warn("Unexpected error in the internal scheduler loop", e);
} finally {
scheduleNextIteration();
metrics.recordEvaluationTime(timer.elapsed(TimeUnit.MILLISECONDS));
}
}
Aggregations