@Override
 public void run() {
   try {
     final OperationService operationService = nodeEngine.getOperationService();
     final Map<Integer, Object> results =
         operationService.invokeOnAllPartitions(getServiceName(), operationFactory);
     validateResults(results);
     if (completionListener != null) {
       completionListener.onCompletion();
     }
   } catch (Exception e) {
     if (completionListener != null) {
       completionListener.onException(e);
     }
   }
 }
예제 #2
0
 @Override
 public void loadAll(
     Set<? extends K> keys, boolean replaceExistingValues, CompletionListener completionListener) {
   ensureOpen();
   validateNotNull(keys);
   for (K key : keys) {
     CacheProxyUtil.validateConfiguredTypes(cacheConfig, key);
   }
   validateCacheLoader(completionListener);
   HashSet<Data> keysData = new HashSet<Data>();
   for (K key : keys) {
     keysData.add(toData(key));
   }
   ClientMessage request =
       CacheLoadAllCodec.encodeRequest(nameWithPrefix, keysData, replaceExistingValues);
   try {
     submitLoadAllTask(request, completionListener);
   } catch (Exception e) {
     if (completionListener != null) {
       completionListener.onException(e);
     }
     throw new CacheException(e);
   }
 }