use of com.hazelcast.concurrent.atomicreference.AtomicReferenceContainer in project hazelcast by hazelcast.
the class AlterOperation method run.
@Override
public void run() throws Exception {
NodeEngine nodeEngine = getNodeEngine();
IFunction f = nodeEngine.toObject(function);
AtomicReferenceContainer reference = getReferenceContainer();
Data originalData = reference.get();
Object input = nodeEngine.toObject(originalData);
//noinspection unchecked
Object output = f.apply(input);
Data serializedOutput = nodeEngine.toData(output);
shouldBackup = !isEquals(originalData, serializedOutput);
if (shouldBackup) {
backup = serializedOutput;
reference.set(backup);
}
}
use of com.hazelcast.concurrent.atomicreference.AtomicReferenceContainer in project hazelcast by hazelcast.
the class ApplyOperation method run.
@Override
public void run() throws Exception {
NodeEngine nodeEngine = getNodeEngine();
IFunction f = nodeEngine.toObject(function);
AtomicReferenceContainer atomicReferenceContainer = getReferenceContainer();
Object input = nodeEngine.toObject(atomicReferenceContainer.get());
//noinspection unchecked
Object output = f.apply(input);
returnValue = nodeEngine.toData(output);
}
use of com.hazelcast.concurrent.atomicreference.AtomicReferenceContainer in project hazelcast by hazelcast.
the class AtomicReferenceReplicationOperation method run.
@Override
public void run() throws Exception {
AtomicReferenceService atomicReferenceService = getService();
for (Map.Entry<String, Data> entry : migrationData.entrySet()) {
String name = entry.getKey();
AtomicReferenceContainer atomicReferenceContainer = atomicReferenceService.getReferenceContainer(name);
Data value = entry.getValue();
atomicReferenceContainer.set(value);
}
}
use of com.hazelcast.concurrent.atomicreference.AtomicReferenceContainer in project hazelcast by hazelcast.
the class ContainsOperation method run.
@Override
public void run() throws Exception {
AtomicReferenceContainer atomicReferenceContainer = getReferenceContainer();
returnValue = atomicReferenceContainer.contains(contains);
}
use of com.hazelcast.concurrent.atomicreference.AtomicReferenceContainer in project hazelcast by hazelcast.
the class GetAndAlterOperation method run.
@Override
public void run() throws Exception {
NodeEngine nodeEngine = getNodeEngine();
IFunction f = nodeEngine.toObject(function);
AtomicReferenceContainer atomicReferenceContainer = getReferenceContainer();
response = atomicReferenceContainer.get();
Object input = nodeEngine.toObject(atomicReferenceContainer.get());
//noinspection unchecked
Object output = f.apply(input);
Data serializedOutput = nodeEngine.toData(output);
shouldBackup = !isEquals(response, serializedOutput);
if (shouldBackup) {
atomicReferenceContainer.set(serializedOutput);
backup = serializedOutput;
}
}
Aggregations