use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.
the class AsyncMapWriterTest method when_tooManyConcurrentOps_then_refuseFlush.
@Test
public void when_tooManyConcurrentOps_then_refuseFlush() throws Exception {
// Given
writer.put("key1", "value1");
writer.put("key2", "value2");
writer.put("key3", "value3");
writer.put("key4", "value4");
CompletableFuture<Void> future = new CompletableFuture<>();
JetService service = nodeEngine.getService(JetService.SERVICE_NAME);
service.numConcurrentPutAllOps().set(MAX_PARALLEL_ASYNC_OPS - NODE_COUNT + 1);
// When
boolean flushed = writer.tryFlushAsync(future);
// Then
assertFalse("tryFlushAsync should fail", flushed);
}
use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.
the class ExecutionPlan method initProcSuppliers.
// End implementation of IdentifiedDataSerializable
private void initProcSuppliers() {
JetService service = nodeEngine.getService(JetService.SERVICE_NAME);
for (VertexDef vertex : vertices) {
ProcessorSupplier supplier = vertex.processorSupplier();
ILogger logger = nodeEngine.getLogger(supplier.getClass().getName() + '.' + vertex.name() + "#ProcessorSupplier");
supplier.init(new ProcSupplierCtx(service.getJetInstance(), logger, vertex.name(), vertex.localParallelism(), vertex.totalParallelism()));
}
}
use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.
the class AsyncOperation method doSendResponse.
public final void doSendResponse(Object value) {
try {
sendResponse(value);
} finally {
final JetService service = getService();
service.getLiveOperationRegistry().deregister(this);
}
}
use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.
the class CompleteExecutionOperation method run.
@Override
public void run() throws Exception {
ILogger logger = getLogger();
JetService service = getService();
Address callerAddress = getCallerAddress();
logger.fine("Completing execution " + idToString(executionId) + " from caller: " + callerAddress + " with " + error);
Address masterAddress = getNodeEngine().getMasterAddress();
if (!callerAddress.equals(masterAddress)) {
throw new IllegalStateException("Caller " + callerAddress + " cannot complete execution of " + idToString(executionId) + " because it is not master. Master is: " + masterAddress);
}
service.getJobExecutionService().completeExecution(executionId, error);
}
use of com.hazelcast.jet.impl.JetService in project hazelcast-jet by hazelcast.
the class GetJobConfigOperation method run.
@Override
public void run() throws Exception {
JetService service = getService();
response = service.getJobCoordinationService().getJobConfig(jobId());
}
Aggregations