Package org.infinispan.remoting.rpc

Examples of org.infinispan.remoting.rpc.RpcManager.invokeRemotely()


      if (inputTaskKeysEmpty()) {
         cmd = factory.buildMapReduceCommand(mapper, reducer, rpc.getAddress(), keys);
         selfCmd = cmd;
         try {
            log.debug("Invoking %s across entire cluster ", cmd);
            Map<Address, Response> map = rpc.invokeRemotely(null, cmd, true, false);
            log.debug("Invoked %s across entire cluster, results are %s", cmd, map);
            results.putAll(map);
         } catch (Throwable e) {
            throw new CacheException("Could not invoke MapReduce task on remote nodes ", e);
         }
View Full Code Here


      //first create tmp caches on all nodes
      CreateCacheCommand ccc = factory.buildCreateCacheCommand(tmpCacheName, DEFAULT_TMP_CACHE_CONFIGURATION_NAME);
     
      try{
         log.debugf("Invoking %s across entire cluster ", ccc);
         Map<Address, Response> map = rpc.invokeRemotely(null, ccc, true, false);
         //locally
         ccc.init(cache.getCacheManager());
         ccc.perform(null);
         log.debugf("Invoked %s across entire cluster, results are %s", ccc, map);
      }
View Full Code Here

                     cc.perform(null);
                  } catch (Throwable e) {
                     log.couldNotExecuteCancellationLocally(e.getLocalizedMessage());
                  }
               } else {
                  rpc.invokeRemotely(Collections.singletonList(task.getExecutionTarget()), cc, true);
               }
               cancelled = true;
            }
         }
         return cancelled;
View Full Code Here

         CommandsFactory cf = TestingUtil.extractCommandsFactory(c1);
         PutKeyValueCommand cmd = cf.buildPutKeyValueCommand("k", "v2",
               new EmbeddedMetadata.Builder().build(), null);

         Map<Address,Response> responseMap = rpcManager.invokeRemotely(addresses, cmd, rpcManager.getDefaultRpcOptions(true, false));
         assert responseMap.size() == 2;

         TestingUtil.killCacheManagers(cm2);
         TestingUtil.blockUntilViewsReceived(30000, false, c1, c3);
View Full Code Here

         TestingUtil.killCacheManagers(cm2);
         TestingUtil.blockUntilViewsReceived(30000, false, c1, c3);

         try {
            responseMap = rpcManager.invokeRemotely(addresses, cmd, rpcManager.getDefaultRpcOptions(true, false));
            assert false: "invokeRemotely should have thrown an exception";
         } catch (SuspectException e) {
            // expected
         }
      } finally {
View Full Code Here

      when(rpcManager.getAddress()).thenReturn(addresses[0]);
      when(rpcManager.getTransport()).thenReturn(transport);

      final Map<Address, Set<Integer>> requestedSegments = CollectionFactory.makeConcurrentMap();
      final Set<Integer> flatRequestedSegments = new ConcurrentSkipListSet<Integer>();
      when(rpcManager.invokeRemotely(any(Collection.class), any(StateRequestCommand.class), any(RpcOptions.class)))
            .thenAnswer(new Answer<Map<Address, Response>>() {
               @Override
               public Map<Address, Response> answer(InvocationOnMock invocation) {
                  Collection<Address> recipients = (Collection<Address>) invocation.getArguments()[0];
                  Address recipient = recipients.iterator().next();
View Full Code Here

               throw new CacheException("Could not initialize temporary caches for MapReduce task on remote nodes ", e);
            }
         }
      });
      future.get();
      rpc.invokeRemotely(cache.getRpcManager().getMembers(), ccc, rpcOptionsBuilder.build());
      Map<Address, Response> map = rpc.invokeRemotely(cache.getRpcManager().getMembers(), ccc, rpcOptionsBuilder.build());
      for (Entry<Address, Response> e : map.entrySet()) {
         if (!e.getValue().isSuccessful()) {
            throw new IllegalStateException("Could not initialize tmp cache " + tmpCacheName + " at " + e.getKey()
                  + " for  " + this);
View Full Code Here

            }
         }
      });
      future.get();
      rpc.invokeRemotely(cache.getRpcManager().getMembers(), ccc, rpcOptionsBuilder.build());
      Map<Address, Response> map = rpc.invokeRemotely(cache.getRpcManager().getMembers(), ccc, rpcOptionsBuilder.build());
      for (Entry<Address, Response> e : map.entrySet()) {
         if (!e.getValue().isSuccessful()) {
            throw new IllegalStateException("Could not initialize tmp cache " + tmpCacheName + " at " + e.getKey()
                  + " for  " + this);
         }
View Full Code Here

                        cc.perform(null);
                     } catch (Throwable e) {
                        log.couldNotExecuteCancellationLocally(e.getLocalizedMessage());
                     }
                  } else {
                     rpc.invokeRemotely(Collections.singletonList(task.getExecutionTarget()), cc, rpcOptionsBuilder.build());
                  }
                  cancelled = true;
                  done = true;
               }
            }
View Full Code Here

      when(rpcManager.getAddress()).thenReturn(addresses[0]);
      when(rpcManager.getTransport()).thenReturn(transport);

      final Map<Address, Set<Integer>> requestedSegments = CollectionFactory.makeConcurrentMap();
      final Set<Integer> flatRequestedSegments = new ConcurrentSkipListSet<Integer>();
      when(rpcManager.invokeRemotely(any(Collection.class), any(StateRequestCommand.class), any(RpcOptions.class)))
            .thenAnswer(new Answer<Map<Address, Response>>() {
               @Override
               public Map<Address, Response> answer(InvocationOnMock invocation) {
                  Collection<Address> recipients = (Collection<Address>) invocation.getArguments()[0];
                  Address recipient = recipients.iterator().next();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.