Search in sources :

Example 1 with GetAndAddOp

use of com.hazelcast.cp.internal.datastructures.atomiclong.operation.GetAndAddOp 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)

Aggregations

CPGroupId (com.hazelcast.cp.CPGroupId)1 RaftOp (com.hazelcast.cp.internal.RaftOp)1 GetAndAddOp (com.hazelcast.cp.internal.datastructures.atomiclong.operation.GetAndAddOp)1