Search in sources :

Example 11 with AtomicLongContainer

use of com.hazelcast.concurrent.atomiclong.AtomicLongContainer in project hazelcast by hazelcast.

the class GetAndAlterOperation method run.

@Override
public void run() throws Exception {
    AtomicLongContainer atomicLongContainer = getLongContainer();
    long input = atomicLongContainer.get();
    response = input;
    long output = function.apply(input);
    shouldBackup = input != output;
    if (shouldBackup) {
        backup = output;
        atomicLongContainer.set(output);
    }
}
Also used : AtomicLongContainer(com.hazelcast.concurrent.atomiclong.AtomicLongContainer)

Example 12 with AtomicLongContainer

use of com.hazelcast.concurrent.atomiclong.AtomicLongContainer in project hazelcast by hazelcast.

the class GetAndSetOperation method run.

@Override
public void run() throws Exception {
    AtomicLongContainer atomicLongContainer = getLongContainer();
    returnValue = atomicLongContainer.getAndSet(newValue);
}
Also used : AtomicLongContainer(com.hazelcast.concurrent.atomiclong.AtomicLongContainer)

Example 13 with AtomicLongContainer

use of com.hazelcast.concurrent.atomiclong.AtomicLongContainer in project hazelcast by hazelcast.

the class GetOperation method run.

@Override
public void run() throws Exception {
    AtomicLongContainer atomicLongContainer = getLongContainer();
    returnValue = atomicLongContainer.get();
}
Also used : AtomicLongContainer(com.hazelcast.concurrent.atomiclong.AtomicLongContainer)

Aggregations

AtomicLongContainer (com.hazelcast.concurrent.atomiclong.AtomicLongContainer)13 AtomicLongService (com.hazelcast.concurrent.atomiclong.AtomicLongService)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1