use of com.hazelcast.spi.impl.executionservice.InternalExecutionService in project hazelcast-jet by hazelcast.
the class JobCoordinationService method scheduleSnapshot.
void scheduleSnapshot(long jobId, long executionId) {
MasterContext masterContext = masterContexts.get(jobId);
if (masterContext != null) {
long snapshotInterval = masterContext.getJobConfig().getSnapshotIntervalMillis();
InternalExecutionService executionService = nodeEngine.getExecutionService();
if (logger.isFineEnabled()) {
logger.fine(jobAndExecutionId(jobId, executionId) + " snapshot is scheduled in " + snapshotInterval + "ms");
}
executionService.schedule(COORDINATOR_EXECUTOR_NAME, () -> beginSnapshot(jobId, executionId), snapshotInterval, MILLISECONDS);
} else {
logger.warning("MasterContext not found to schedule snapshot of " + jobAndExecutionId(jobId, executionId));
}
}
use of com.hazelcast.spi.impl.executionservice.InternalExecutionService in project hazelcast-jet by hazelcast.
the class JobCoordinationService method init.
public void init() {
InternalExecutionService executionService = nodeEngine.getExecutionService();
HazelcastProperties properties = new HazelcastProperties(config.getProperties());
long jobScanPeriodInMillis = properties.getMillis(JOB_SCAN_PERIOD);
executionService.register(COORDINATOR_EXECUTOR_NAME, 2, Integer.MAX_VALUE, CACHED);
executionService.scheduleWithRepetition(COORDINATOR_EXECUTOR_NAME, this::scanJobs, jobScanPeriodInMillis, jobScanPeriodInMillis, MILLISECONDS);
}
Aggregations