Search in sources :

Example 1 with InternalExecutionService

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));
    }
}
Also used : InternalExecutionService(com.hazelcast.spi.impl.executionservice.InternalExecutionService)

Example 2 with InternalExecutionService

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);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) InternalExecutionService(com.hazelcast.spi.impl.executionservice.InternalExecutionService)

Aggregations

InternalExecutionService (com.hazelcast.spi.impl.executionservice.InternalExecutionService)2 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)1