use of com.hazelcast.spi.OperationFactory in project hazelcast by hazelcast.
the class MapProxySupport method executeOnEntriesInternal.
/**
* {@link IMap#executeOnEntries(EntryProcessor, Predicate)}
*/
public void executeOnEntriesInternal(EntryProcessor entryProcessor, Predicate predicate, List<Data> result) {
try {
OperationFactory operation = operationProvider.createPartitionWideEntryWithPredicateOperationFactory(name, entryProcessor, predicate);
Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, operation);
for (Object object : results.values()) {
if (object != null) {
MapEntries mapEntries = (MapEntries) object;
for (int i = 0; i < mapEntries.size(); i++) {
result.add(mapEntries.getKey(i));
result.add(mapEntries.getValue(i));
}
}
}
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.spi.OperationFactory in project hazelcast by hazelcast.
the class MapProxySupport method containsValueInternal.
public boolean containsValueInternal(Data dataValue) {
try {
OperationFactory operationFactory = operationProvider.createContainsValueOperationFactory(name, dataValue);
Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, operationFactory);
for (Object result : results.values()) {
Boolean contains = toObject(result);
if (contains) {
return true;
}
}
return false;
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.spi.OperationFactory in project hazelcast by hazelcast.
the class AbstractInternalCacheProxy method clearInternal.
void clearInternal() {
try {
OperationService operationService = getNodeEngine().getOperationService();
OperationFactory operationFactory = operationProvider.createClearOperationFactory();
Map<Integer, Object> results = operationService.invokeOnAllPartitions(getServiceName(), operationFactory);
for (Object result : results.values()) {
if (result != null && result instanceof CacheClearResponse) {
Object response = ((CacheClearResponse) result).getResponse();
if (response instanceof Throwable) {
throw (Throwable) response;
}
}
}
} catch (Throwable t) {
throw rethrowAllowedTypeFirst(t, CacheException.class);
}
}
Aggregations