use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class MapFlushMessageTask method call.
@Override
protected Object call() throws Exception {
MapService mapService = getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
ProxyService proxyService = nodeEngine.getProxyService();
DistributedObject distributedObject = proxyService.getDistributedObject(SERVICE_NAME, parameters.name);
MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
mapProxy.flush();
return null;
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class AbstractCollectionProxyImpl method compareAndRemove.
private boolean compareAndRemove(boolean retain, Collection<?> c) {
checkObjectNotNull(c);
Set<Data> valueSet = new HashSet<Data>(c.size());
final NodeEngine nodeEngine = getNodeEngine();
for (Object o : c) {
checkObjectNotNull(o);
valueSet.add(nodeEngine.toData(o));
}
final CollectionCompareAndRemoveOperation operation = new CollectionCompareAndRemoveOperation(name, retain, valueSet);
final Boolean result = invoke(operation);
return result;
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class AbstractCollectionProxyImpl method containsAll.
public boolean containsAll(Collection<?> c) {
checkObjectNotNull(c);
Set<Data> valueSet = new HashSet<Data>(c.size());
final NodeEngine nodeEngine = getNodeEngine();
for (Object o : c) {
checkObjectNotNull(o);
valueSet.add(nodeEngine.toData(o));
}
final CollectionContainsOperation operation = new CollectionContainsOperation(name, valueSet);
final Boolean result = invoke(operation);
return result;
}
use of com.hazelcast.spi.NodeEngine 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.spi.NodeEngine 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);
}
Aggregations