use of com.sequenceiq.cloudbreak.quartz.model.JobResource in project cloudbreak by hortonworks.
the class DBStackJobInizializerTest method shouldDeleteAllJobsAndScheduleNewOnesForDbStacks.
@Test
public void shouldDeleteAllJobsAndScheduleNewOnesForDbStacks() {
JobResource jobResource = mock(JobResource.class);
Set<JobResource> jobResources = Set.of(jobResource);
when(dbStackService.findAllForAutoSync()).thenReturn(jobResources);
victim.initJobs();
verify(dbStackJobService).schedule(jobResource);
}
use of com.sequenceiq.cloudbreak.quartz.model.JobResource in project cloudbreak by hortonworks.
the class NodeStatusJobInitializer method initJobs.
@Override
public void initJobs() {
if (nodeStatusJobConfig.isEnabled()) {
List<JobResource> jobResources = checkedMeasure(() -> stackService.findAllForAutoSync(), LOGGER, ":::Node status check::: Stacks are fetched from db in {}ms");
for (JobResource jobResource : jobResources) {
nodeStatusJobService.schedule(new NodeStatusJobAdapter(jobResource));
}
LOGGER.info("Node status checks are inited with {} stacks on start", jobResources.size());
} else {
LOGGER.info("Skipping scheduling node status checker jobs, as they are disabled");
}
}
Aggregations