Search in sources :

Example 6 with AtomicLongContainer

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

the class AddBackupOperation method run.

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

Example 7 with AtomicLongContainer

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

the class AlterAndGetOperation method run.

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

Example 8 with AtomicLongContainer

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

the class AlterOperation method run.

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

Example 9 with AtomicLongContainer

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

the class ApplyOperation method run.

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

Example 10 with AtomicLongContainer

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

the class AtomicLongReplicationOperation method run.

@Override
public void run() throws Exception {
    AtomicLongService atomicLongService = getService();
    for (Map.Entry<String, Long> longEntry : migrationData.entrySet()) {
        String name = longEntry.getKey();
        AtomicLongContainer atomicLongContainer = atomicLongService.getLongContainer(name);
        Long value = longEntry.getValue();
        atomicLongContainer.set(value);
    }
}
Also used : AtomicLongService(com.hazelcast.concurrent.atomiclong.AtomicLongService) Map(java.util.Map) HashMap(java.util.HashMap) 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