use of com.hazelcast.spi.impl.operationservice.InternalOperationService in project hazelcast by hazelcast.
the class AbstractMapQueryMessageTask method createInvocationsForMissingPartitions.
private void createInvocationsForMissingPartitions(List<Integer> missingPartitionsList, List<Future> futures, Predicate predicate) {
final InternalOperationService operationService = nodeEngine.getOperationService();
Query query = buildQuery(predicate);
for (Integer partitionId : missingPartitionsList) {
QueryPartitionOperation queryPartitionOperation = new QueryPartitionOperation(query);
queryPartitionOperation.setPartitionId(partitionId);
try {
Future future = operationService.invokeOnPartition(SERVICE_NAME, queryPartitionOperation, partitionId);
futures.add(future);
} catch (Throwable t) {
throw rethrow(t);
}
}
}
use of com.hazelcast.spi.impl.operationservice.InternalOperationService 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.spi.impl.operationservice.InternalOperationService in project hazelcast by hazelcast.
the class AbstractMultiPartitionMessageTask method call.
@Override
protected Object call() throws Exception {
ClientEndpoint endpoint = getEndpoint();
OperationFactory operationFactory = new OperationFactoryWrapper(createOperationFactory(), endpoint.getUuid());
final InternalOperationService operationService = nodeEngine.getOperationService();
Map<Integer, Object> map = operationService.invokeOnPartitions(getServiceName(), operationFactory, getPartitions());
return reduce(map);
}
use of com.hazelcast.spi.impl.operationservice.InternalOperationService 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.impl.operationservice.InternalOperationService in project hazelcast by hazelcast.
the class ClientEngineImpl method handleClientMessage.
public void handleClientMessage(ClientMessage clientMessage, Connection connection) {
int partitionId = clientMessage.getPartitionId();
MessageTask messageTask = messageTaskFactory.create(clientMessage, connection);
InternalOperationService operationService = nodeEngine.getOperationService();
if (partitionId < 0) {
if (isUrgent(messageTask)) {
operationService.execute(new PriorityPartitionSpecificRunnable(messageTask));
} else if (isQuery(messageTask)) {
queryExecutor.execute(messageTask);
} else {
executor.execute(messageTask);
}
} else {
operationService.execute(messageTask);
}
}
Aggregations