Search in sources :

Example 1 with RaftQueryOp

use of com.hazelcast.cp.internal.operation.RaftQueryOp in project hazelcast by hazelcast.

the class RaftInvocationManager method queryLocally.

public <T> InternalCompletableFuture<T> queryLocally(CPGroupId groupId, RaftOp raftOp, QueryPolicy queryPolicy) {
    Operation operation;
    if (cpSubsystemEnabled) {
        operation = new RaftQueryOp(groupId, raftOp, queryPolicy);
    } else {
        operation = new UnsafeRaftQueryOp(groupId, raftOp);
    }
    operation.setPartitionId(raftService.getCPGroupPartitionId(groupId));
    return nodeEngine.getOperationService().invokeOnTarget(RaftService.SERVICE_NAME, operation, nodeEngine.getThisAddress());
}
Also used : UnsafeRaftQueryOp(com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp) RaftQueryOp(com.hazelcast.cp.internal.operation.RaftQueryOp) UnsafeRaftQueryOp(com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp) Operation(com.hazelcast.spi.impl.operationservice.Operation)

Example 2 with RaftQueryOp

use of com.hazelcast.cp.internal.operation.RaftQueryOp in project hazelcast by hazelcast.

the class RaftInvocationManager method query.

public <T> InternalCompletableFuture<T> query(CPGroupId groupId, RaftOp raftOp, QueryPolicy queryPolicy, boolean deserializeResponse) {
    if (cpSubsystemEnabled) {
        RaftQueryOp operation = new RaftQueryOp(groupId, raftOp, queryPolicy);
        Invocation invocation = new RaftInvocation(operationService.getInvocationContext(), raftInvocationContext, groupId, operation, invocationMaxRetryCount, invocationRetryPauseMillis, operationCallTimeout, deserializeResponse);
        return invocation.invoke();
    }
    return invokeOnPartition(new UnsafeRaftQueryOp(groupId, raftOp), deserializeResponse);
}
Also used : RaftInvocation(com.hazelcast.spi.impl.operationservice.impl.RaftInvocation) Invocation(com.hazelcast.spi.impl.operationservice.impl.Invocation) RaftInvocation(com.hazelcast.spi.impl.operationservice.impl.RaftInvocation) UnsafeRaftQueryOp(com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp) RaftQueryOp(com.hazelcast.cp.internal.operation.RaftQueryOp) UnsafeRaftQueryOp(com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp)

Aggregations

RaftQueryOp (com.hazelcast.cp.internal.operation.RaftQueryOp)2 UnsafeRaftQueryOp (com.hazelcast.cp.internal.operation.unsafe.UnsafeRaftQueryOp)2 Operation (com.hazelcast.spi.impl.operationservice.Operation)1 Invocation (com.hazelcast.spi.impl.operationservice.impl.Invocation)1 RaftInvocation (com.hazelcast.spi.impl.operationservice.impl.RaftInvocation)1