@Override public Map<Integer, Object> invokeOnAllPartitions(Object request) throws Exception { checkInstanceOf(OperationFactory.class, request, "request"); OperationFactory factory = (OperationFactory) request; return operationService.invokeOnAllPartitions(MapService.SERVICE_NAME, factory); }
@Override public Map<Integer, Object> invokeOnAllPartitions(Object request) throws Exception { checkInstanceOf(OperationFactory.class, request, "request"); OperationFactory factory = (OperationFactory) request; return operationService.invokeOnAllPartitions(MapService.SERVICE_NAME, factory); }
protected void removeAllInternal(Predicate predicate) { OperationFactory operation = operationProvider.createPartitionWideEntryWithPredicateOperationFactory(name, ENTRY_REMOVING_PROCESSOR, predicate); try { operationService.invokeOnAllPartitions(SERVICE_NAME, operation); } catch (Throwable t) { throw rethrow(t); } }
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); } }
@Override public int size() { try { OperationFactory sizeOperationFactory = operationProvider.createMapSizeOperationFactory(name); Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, sizeOperationFactory); int total = 0; for (Object result : results.values()) { Integer size = toObject(result); total += size; } return total; } catch (Throwable t) { throw rethrow(t); } }
@Override public int size() { try { OperationFactory sizeOperationFactory = operationProvider.createMapSizeOperationFactory(name); Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, sizeOperationFactory); int total = 0; for (Object result : results.values()) { Integer size = toObject(result); total += size; } return total; } catch (Throwable t) { throw rethrow(t); } }
int sizeInternal() { try { OperationFactory sizeOperationFactory = operationProvider.createMapSizeOperationFactory(name); Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, sizeOperationFactory); int total = 0; for (Object result : results.values()) { Integer size = getNodeEngine().toObject(result); total += size; } return total; } catch (Throwable t) { throw rethrow(t); } }
int sizeInternal() { try { OperationFactory sizeOperationFactory = operationProvider.createMapSizeOperationFactory(name); Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, sizeOperationFactory); int total = 0; for (Object result : results.values()) { Integer size = getNodeEngine().toObject(result); total += size; } return total; } catch (Throwable t) { throw rethrow(t); } }
@Override public void clear() { OperationService operationService = nodeEngine.getOperationService(); try { Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, new ClearOperationFactory(name)); int deletedEntrySize = 0; for (Object deletedEntryPerPartition : results.values()) { deletedEntrySize += (Integer) deletedEntryPerPartition; } eventPublishingService.fireMapClearedEvent(deletedEntrySize, name); } catch (Throwable t) { throw rethrow(t); } }
@Override public void clear() { OperationService operationService = nodeEngine.getOperationService(); try { Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, new ClearOperationFactory(name)); int deletedEntrySize = 0; for (Object deletedEntryPerPartition : results.values()) { deletedEntrySize += (Integer) deletedEntryPerPartition; } eventPublishingService.fireMapClearedEvent(deletedEntrySize, name); } catch (Throwable t) { throw rethrow(t); } }
protected Map valuesInternal() { NodeEngine nodeEngine = getNodeEngine(); try { Map<Integer, Object> results = nodeEngine.getOperationService() .invokeOnAllPartitions( MultiMapService.SERVICE_NAME, new MultiMapOperationFactory(name, OperationFactoryType.VALUES) ); return results; } catch (Throwable throwable) { throw ExceptionUtil.rethrow(throwable); } }
public void clear() { NodeEngine nodeEngine = getNodeEngine(); try { Map<Integer, Object> resultMap = nodeEngine.getOperationService().invokeOnAllPartitions( MultiMapService.SERVICE_NAME, new MultiMapOperationFactory(name, OperationFactoryType.CLEAR) ); int numberOfAffectedEntries = 0; for (Object o : resultMap.values()) { numberOfAffectedEntries += (Integer) o; } publishMultiMapEvent(numberOfAffectedEntries, EntryEventType.CLEAR_ALL); } catch (Throwable throwable) { throw ExceptionUtil.rethrow(throwable); } }
protected void evictAllInternal() { try { Operation operation = operationProvider.createEvictAllOperation(name); BinaryOperationFactory factory = new BinaryOperationFactory(operation, getNodeEngine()); Map<Integer, Object> resultMap = operationService.invokeOnAllPartitions(SERVICE_NAME, factory); int evictedCount = 0; for (Object object : resultMap.values()) { evictedCount += (Integer) object; } if (evictedCount > 0) { publishMapEvent(evictedCount, EntryEventType.EVICT_ALL); } } catch (Throwable t) { throw rethrow(t); } }
protected Map entrySetInternal() { NodeEngine nodeEngine = getNodeEngine(); try { Map<Integer, Object> results = nodeEngine.getOperationService() .invokeOnAllPartitions( MultiMapService.SERVICE_NAME, new MultiMapOperationFactory(name, OperationFactoryType.ENTRY_SET) ); return results; } catch (Throwable throwable) { throw ExceptionUtil.rethrow(throwable); } }
protected Map entrySetInternal() { NodeEngine nodeEngine = getNodeEngine(); try { Map<Integer, Object> results = nodeEngine.getOperationService() .invokeOnAllPartitions( MultiMapService.SERVICE_NAME, new MultiMapOperationFactory(name, OperationFactoryType.ENTRY_SET) ); return results; } catch (Throwable throwable) { throw ExceptionUtil.rethrow(throwable); } }
protected Map valuesInternal() { NodeEngine nodeEngine = getNodeEngine(); try { Map<Integer, Object> results = nodeEngine.getOperationService() .invokeOnAllPartitions( MultiMapService.SERVICE_NAME, new MultiMapOperationFactory(name, OperationFactoryType.VALUES) ); return results; } catch (Throwable throwable) { throw ExceptionUtil.rethrow(throwable); } }
@Override public void addIndex(String attribute, boolean ordered) { validateIndexAttribute(attribute); try { AddIndexOperation addIndexOperation = new AddIndexOperation(name, attribute, ordered); operationService.invokeOnAllPartitions(SERVICE_NAME, new BinaryOperationFactory(addIndexOperation, getNodeEngine())); } catch (Throwable t) { throw rethrow(t); } }
@Override public void addIndex(String attribute, boolean ordered) { validateIndexAttribute(attribute); try { AddIndexOperation addIndexOperation = new AddIndexOperation(name, attribute, ordered); operationService.invokeOnAllPartitions(SERVICE_NAME, new BinaryOperationFactory(addIndexOperation, getNodeEngine())); } catch (Throwable t) { throw rethrow(t); } }
private <V> void retrieveAllPartitionOwnedScheduled(Map<Member, List<IScheduledFuture<V>>> accumulator) { try { accumulateTaskHandlersAsScheduledFutures(accumulator, getNodeEngine().getOperationService().invokeOnAllPartitions(getServiceName(), new GetAllScheduledOnPartitionOperationFactory(name))); } catch (Throwable t) { throw rethrow(t); } }
private <V> void retrieveAllPartitionOwnedScheduled(Map<Member, List<IScheduledFuture<V>>> accumulator) { try { accumulateTaskHandlersAsScheduledFutures(accumulator, getNodeEngine().getOperationService().invokeOnAllPartitions(getServiceName(), new GetAllScheduledOnPartitionOperationFactory(name))); } catch (Throwable t) { throw rethrow(t); } }