use of com.hazelcast.executor.impl.operations.CancellationOperation in project hazelcast by hazelcast.
the class ExecutorServiceCancelOnPartitionMessageTask method createInvocationBuilder.
@Override
protected InvocationBuilder createInvocationBuilder() throws UnknownHostException {
final InternalOperationService operationService = nodeEngine.getOperationService();
final String serviceName = DistributedExecutorService.SERVICE_NAME;
CancellationOperation op = new CancellationOperation(parameters.uuid, parameters.interrupt);
return operationService.createInvocationBuilder(serviceName, op, parameters.partitionId);
}
use of com.hazelcast.executor.impl.operations.CancellationOperation in project hazelcast by hazelcast.
the class SerializationServiceV1Test method test_callid_on_correct_stream_position.
@Test
public void test_callid_on_correct_stream_position() throws Exception {
CancellationOperation operation = new CancellationOperation(UuidUtil.newUnsecureUUID(), true);
operation.setCallerUuid(UuidUtil.newUnsecureUUID());
OperationAccessor.setCallId(operation, 12345);
Data data = serializationService.toData(operation);
long callId = serializationService.initDataSerializableInputAndSkipTheHeader(data).readLong();
assertEquals(12345, callId);
}
use of com.hazelcast.executor.impl.operations.CancellationOperation in project hazelcast by hazelcast.
the class ExecutorServiceCancelOnAddressMessageTask method createInvocationBuilder.
@Override
protected InvocationBuilder createInvocationBuilder() throws UnknownHostException {
final InternalOperationService operationService = nodeEngine.getOperationService();
final String serviceName = DistributedExecutorService.SERVICE_NAME;
CancellationOperation op = new CancellationOperation(parameters.uuid, parameters.interrupt);
return operationService.createInvocationBuilder(serviceName, op, parameters.address);
}
use of com.hazelcast.executor.impl.operations.CancellationOperation in project hazelcast by hazelcast.
the class CancellableDelegatingFuture method invokeCancelOperation.
private Future<Boolean> invokeCancelOperation(boolean mayInterruptIfRunning) {
CancellationOperation op = new CancellationOperation(uuid, mayInterruptIfRunning);
OperationService opService = nodeEngine.getOperationService();
InvocationBuilder builder;
if (partitionId > -1) {
builder = opService.createInvocationBuilder(DistributedExecutorService.SERVICE_NAME, op, partitionId);
} else {
builder = opService.createInvocationBuilder(DistributedExecutorService.SERVICE_NAME, op, target);
}
builder.setTryCount(CANCEL_TRY_COUNT).setTryPauseMillis(CANCEL_TRY_PAUSE_MILLIS);
return builder.invoke();
}
Aggregations