Search in sources :

Example 1 with RaftOp

use of com.hazelcast.cp.internal.RaftOp in project hazelcast by hazelcast.

the class AtomicRefProxy method applyAsync.

@Override
public <R> InternalCompletableFuture<R> applyAsync(IFunction<T, R> function) {
    checkTrue(function != null, "Function cannot be null");
    RaftOp op = new ApplyOp(objectName, toData(function), RETURN_NEW_VALUE, false);
    return invocationManager.query(groupId, op, LINEARIZABLE);
}
Also used : RaftOp(com.hazelcast.cp.internal.RaftOp) ApplyOp(com.hazelcast.cp.internal.datastructures.atomicref.operation.ApplyOp)

Example 2 with RaftOp

use of com.hazelcast.cp.internal.RaftOp in project hazelcast by hazelcast.

the class GetAndAddMessageTask method processMessage.

@Override
protected void processMessage() {
    CPGroupId groupId = parameters.groupId;
    long delta = parameters.delta;
    RaftOp op = new GetAndAddOp(parameters.name, delta);
    if (delta == 0) {
        query(groupId, op, LINEARIZABLE);
    } else {
        invoke(groupId, op);
    }
}
Also used : CPGroupId(com.hazelcast.cp.CPGroupId) RaftOp(com.hazelcast.cp.internal.RaftOp) GetAndAddOp(com.hazelcast.cp.internal.datastructures.atomiclong.operation.GetAndAddOp)

Example 3 with RaftOp

use of com.hazelcast.cp.internal.RaftOp in project hazelcast by hazelcast.

the class TryLockMessageTask method processMessage.

@Override
protected void processMessage() {
    RaftOp op = new TryLockOp(parameters.name, parameters.sessionId, parameters.threadId, parameters.invocationUid, parameters.timeoutMs);
    invoke(parameters.groupId, op);
}
Also used : TryLockOp(com.hazelcast.cp.internal.datastructures.lock.operation.TryLockOp) RaftOp(com.hazelcast.cp.internal.RaftOp)

Example 4 with RaftOp

use of com.hazelcast.cp.internal.RaftOp in project hazelcast by hazelcast.

the class UnlockMessageTask method processMessage.

@Override
protected void processMessage() {
    RaftOp op = new UnlockOp(parameters.name, parameters.sessionId, parameters.threadId, parameters.invocationUid);
    invoke(parameters.groupId, op);
}
Also used : UnlockOp(com.hazelcast.cp.internal.datastructures.lock.operation.UnlockOp) RaftOp(com.hazelcast.cp.internal.RaftOp)

Example 5 with RaftOp

use of com.hazelcast.cp.internal.RaftOp in project hazelcast by hazelcast.

the class CompareAndSetMessageTask method processMessage.

@Override
protected void processMessage() {
    RaftOp op = new CompareAndSetOp(parameters.name, parameters.oldValue, parameters.newValue);
    invoke(parameters.groupId, op);
}
Also used : CompareAndSetOp(com.hazelcast.cp.internal.datastructures.atomicref.operation.CompareAndSetOp) RaftOp(com.hazelcast.cp.internal.RaftOp)

Aggregations

RaftOp (com.hazelcast.cp.internal.RaftOp)28 UuidUtil.newUnsecureUUID (com.hazelcast.internal.util.UuidUtil.newUnsecureUUID)7 UUID (java.util.UUID)7 AcquirePermitsOp (com.hazelcast.cp.internal.datastructures.semaphore.operation.AcquirePermitsOp)6 SessionExpiredException (com.hazelcast.cp.internal.session.SessionExpiredException)5 CPGroupId (com.hazelcast.cp.CPGroupId)4 RaftGroupId (com.hazelcast.cp.internal.RaftGroupId)4 WaitKeyCancelledException (com.hazelcast.cp.internal.datastructures.exception.WaitKeyCancelledException)4 ChangePermitsOp (com.hazelcast.cp.internal.datastructures.semaphore.operation.ChangePermitsOp)4 ReleasePermitsOp (com.hazelcast.cp.internal.datastructures.semaphore.operation.ReleasePermitsOp)4 DrainPermitsOp (com.hazelcast.cp.internal.datastructures.semaphore.operation.DrainPermitsOp)3 Test (org.junit.Test)3 RaftService (com.hazelcast.cp.internal.RaftService)2 ApplyOp (com.hazelcast.cp.internal.datastructures.atomicref.operation.ApplyOp)2 TryLockOp (com.hazelcast.cp.internal.datastructures.lock.operation.TryLockOp)2 ExpireWaitKeysOp (com.hazelcast.cp.internal.datastructures.spi.blocking.operation.ExpireWaitKeysOp)2 AbstractProxySessionManager (com.hazelcast.cp.internal.session.AbstractProxySessionManager)2 BiTuple (com.hazelcast.internal.util.BiTuple)2 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)2 PartitionSpecificRunnable (com.hazelcast.spi.impl.PartitionSpecificRunnable)2