use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class CardinalityEstimatorProxy method addAsync.
@Override
public InternalCompletableFuture<Void> addAsync(Object obj) {
checkNotNull(obj, "Object is null.");
Data data = getNodeEngine().getSerializationService().toData(obj);
Operation operation = new AggregateOperation(name, data.hash64()).setPartitionId(partitionId);
return invokeOnPartition(operation);
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class AbstractMultiTargetMessageTask method processMessage.
@Override
protected void processMessage() throws Throwable {
Supplier<Operation> operationSupplier = createOperationSupplier();
Collection<Member> targets = getTargets();
returnResponseIfNoTargetLeft(targets, EMPTY_MAP);
final InternalOperationService operationService = nodeEngine.getOperationService();
MultiTargetCallback callback = new MultiTargetCallback(targets);
for (Member target : targets) {
Operation op = operationSupplier.get();
InvocationBuilder builder = operationService.createInvocationBuilder(getServiceName(), op, target.getAddress()).setResultDeserialized(false).setExecutionCallback(new SingleTargetCallback(target, callback));
builder.invoke();
}
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class AbstractInvocationMessageTask method processMessage.
@Override
protected void processMessage() {
final ClientEndpoint endpoint = getEndpoint();
Operation op = prepareOperation();
op.setCallerUuid(endpoint.getUuid());
InvocationBuilder builder = getInvocationBuilder(op).setExecutionCallback(this).setResultDeserialized(false);
builder.invoke();
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class XAClearRemoteTransactionMessageTask method call.
@Override
protected Object call() throws Exception {
InternalOperationService operationService = nodeEngine.getOperationService();
InternalPartitionService partitionService = nodeEngine.getPartitionService();
ClientEndpoint endpoint = getEndpoint();
Data xidData = serializationService.toData(parameters.xid);
Operation op = new ClearRemoteTransactionOperation(xidData);
op.setCallerUuid(endpoint.getUuid());
int partitionId = partitionService.getPartitionId(xidData);
InvocationBuilder builder = operationService.createInvocationBuilder(getServiceName(), op, partitionId);
builder.setTryCount(TRY_COUNT).setResultDeserialized(false);
builder.invoke();
return XATransactionClearRemoteCodec.encodeResponse();
}
use of com.hazelcast.spi.Operation in project hazelcast by hazelcast.
the class ScheduledExecutorShutdownMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
Operation op = new ShutdownOperation(parameters.schedulerName);
op.setCallerUuid(endpoint.getUuid());
return op;
}
Aggregations