use of com.netflix.titus.common.framework.reconciler.internal.InternalReconciliationEngine in project titus-control-plane by Netflix.
the class JobReconciliationFrameworkFactory method newInstance.
ReconciliationFramework<JobManagerReconcilerEvent> newInstance() {
List<Pair<Job, List<Task>>> jobsAndTasks = loadJobsAndTasksFromStore(errorCollector);
// initialize fenzo with running tasks
List<InternalReconciliationEngine<JobManagerReconcilerEvent>> engines = new ArrayList<>();
for (Pair<Job, List<Task>> pair : jobsAndTasks) {
Job job = pair.getLeft();
List<Task> tasks = pair.getRight();
InternalReconciliationEngine<JobManagerReconcilerEvent> engine = newRestoredEngine(job, tasks);
engines.add(engine);
for (Task task : tasks) {
Optional<Task> validatedTask = validateTask(task);
if (!validatedTask.isPresent()) {
errorCollector.invalidTaskRecord(task.getId());
}
}
}
errorCollector.failIfTooManyBadRecords();
return new DefaultReconciliationFramework<>(engines, bootstrapModel -> newEngine(bootstrapModel, true), jobManagerConfiguration.getReconcilerIdleTimeoutMs(), jobManagerConfiguration.getReconcilerActiveTimeoutMs(), jobManagerConfiguration.getCheckpointIntervalMs(), INDEX_COMPARATORS, JOB_EVENT_FACTORY, registry, optionalScheduler);
}
Aggregations