Search in sources :

Example 6 with JetService

use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.

the class GetJobIdsByNameOperation method run.

@Override
public void run() throws Exception {
    JetService service = getService();
    JobCoordinationService coordinationService = service.getJobCoordinationService();
    response = coordinationService.getJobIds(name);
}
Also used : JetService(com.hazelcast.jet.impl.JetService) JobCoordinationService(com.hazelcast.jet.impl.JobCoordinationService)

Example 7 with JetService

use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.

the class GetJobIdsOperation method run.

@Override
public void run() throws Exception {
    JetService service = getService();
    JobCoordinationService coordinationService = service.getJobCoordinationService();
    response = coordinationService.getAllJobIds();
}
Also used : JetService(com.hazelcast.jet.impl.JetService) JobCoordinationService(com.hazelcast.jet.impl.JobCoordinationService)

Example 8 with JetService

use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.

the class InitExecutionOperation method deserializePlan.

private ExecutionPlan deserializePlan(Data planBlob) {
    JetService service = getService();
    ClassLoader cl = service.getClassLoader(jobId());
    return deserializeWithCustomClassLoader(getNodeEngine().getSerializationService(), cl, planBlob);
}
Also used : JetService(com.hazelcast.jet.impl.JetService) CustomClassLoadedObject.deserializeWithCustomClassLoader(com.hazelcast.jet.impl.execution.init.CustomClassLoadedObject.deserializeWithCustomClassLoader)

Example 9 with JetService

use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.

the class ExecutionContext method beginExecution.

/**
 * Starts local execution of job by submitting tasklets to execution service. If
 * execution was cancelled earlier then execution will not be started.
 *
 * Returns a future which is completed only when all tasklets are completed. If
 * execution was already cancelled before this method is called then the returned
 * future is completed immediately. The future returned can't be cancelled,
 * instead {@link #cancelExecution()} should be used.
 */
public CompletableFuture<Void> beginExecution() {
    synchronized (executionLock) {
        if (executionFuture != null) {
            // beginExecution was already called or execution was cancelled before it started.
            return executionFuture;
        } else {
            // begin job execution
            JetService service = nodeEngine.getService(JetService.SERVICE_NAME);
            ClassLoader cl = service.getClassLoader(jobId);
            executionFuture = execService.beginExecute(tasklets, cancellationFuture, cl);
        }
        return executionFuture;
    }
}
Also used : JetService(com.hazelcast.jet.impl.JetService)

Example 10 with JetService

use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.

the class RestartJobOperation method run.

@Override
public void run() throws Exception {
    JetService service = getService();
    response = service.getJobCoordinationService().restartJobExecution(jobId());
}
Also used : JetService(com.hazelcast.jet.impl.JetService)

Aggregations

JetService (com.hazelcast.jet.impl.JetService)28 Test (org.junit.Test)9 MockPS (com.hazelcast.jet.core.TestProcessors.MockPS)6 JetInstance (com.hazelcast.jet.JetInstance)5 Job (com.hazelcast.jet.Job)5 JobConfig (com.hazelcast.jet.config.JobConfig)5 StuckProcessor (com.hazelcast.jet.core.TestProcessors.StuckProcessor)5 JobCoordinationService (com.hazelcast.jet.impl.JobCoordinationService)5 JetConfig (com.hazelcast.jet.config.JetConfig)4 STARTING (com.hazelcast.jet.core.JobStatus.STARTING)4 JobRepository (com.hazelcast.jet.impl.JobRepository)4 MasterContext (com.hazelcast.jet.impl.MasterContext)4 Address (com.hazelcast.nio.Address)4 CompletableFuture (java.util.concurrent.CompletableFuture)4 CountDownLatch (java.util.concurrent.CountDownLatch)4 Future (java.util.concurrent.Future)4 Assert.assertEquals (org.junit.Assert.assertEquals)4 Assert.assertNotNull (org.junit.Assert.assertNotNull)4 Assert.assertTrue (org.junit.Assert.assertTrue)4 Assert.fail (org.junit.Assert.fail)4