Пример #1
0
 /** {@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);
   }
 }
Пример #2
0
 protected void getAllObjectInternal(List<Data> keys, List<Object> resultingKeyValuePairs) {
   if (keys == null || keys.isEmpty()) {
     return;
   }
   if (keys.isEmpty()) {
     return;
   }
   Collection<Integer> partitions = getPartitionsForKeys(keys);
   Map<Integer, Object> responses;
   try {
     OperationFactory operationFactory =
         operationProvider.createGetAllOperationFactory(name, keys);
     responses = operationService.invokeOnPartitions(SERVICE_NAME, operationFactory, partitions);
     for (Object response : responses.values()) {
       MapEntries entries = toObject(response);
       for (int i = 0; i < entries.size(); i++) {
         resultingKeyValuePairs.add(toObject(entries.getKey(i)));
         resultingKeyValuePairs.add(toObject(entries.getValue(i)));
       }
     }
   } catch (Exception e) {
     throw rethrow(e);
   }
 }