Package org.infinispan.commands.control

Examples of org.infinispan.commands.control.RehashControlCommand


            break;
         case ClusteredGetCommand.COMMAND_ID:
            command = new ClusteredGetCommand();
            break;
         case RehashControlCommand.COMMAND_ID:
            command = new RehashControlCommand(transport);
            break;
         default:
            throw new CacheException("Unknown command id " + id + "!");
      }
      command.setParameters(id, parameters);
View Full Code Here


         // 5.  txLogger being enabled will cause CLusteredGetCommands to return uncertain responses.

         // 6.  pull state from everyone.
         Address myAddress = rpcManager.getTransport().getAddress();
         RehashControlCommand cmd = cf.buildRehashControlCommand(PULL_STATE, myAddress, null, chNew);
         // TODO I should be able to process state chunks from different nodes simultaneously!!
         List<Address> addressesWhoMaySendStuff = getAddressesWhoMaySendStuff(configuration.getNumOwners());
         List<Response> resps = rpcManager.invokeRemotely(addressesWhoMaySendStuff, cmd, SYNCHRONOUS, configuration.getRehashRpcTimeout(), true);

         // 7.  Apply state
View Full Code Here

               // txLogger being enabled will cause ClusteredGetCommands to return uncertain responses.
  
               // pull state from everyone.
               Address myAddress = rpcManager.getTransport().getAddress();
              
               RehashControlCommand cmd = cf.buildRehashControlCommand(PULL_STATE_JOIN, myAddress, null, chOld, chNew, null);

               List<Address> addressesWhoMaySendStuff = getAddressesWhoMaySendStuff(chNew, configuration.getNumOwners());
               Set<Future<Void>> stateRetrievalProcesses = new HashSet<Future<Void>>(addressesWhoMaySendStuff.size());

               // This process happens in parallel
View Full Code Here

         log.info("%s completed join rehash in %s!", self, Util.prettyPrintTime(System.currentTimeMillis() - start));
      }
   }

   private void broadcastNewCh() {
      RehashControlCommand rehashControlCommand = cf.buildRehashControlCommand(JOIN_REHASH_START, self);
      rehashControlCommand.setNodeTopologyInfo(distributionManager.getTopologyInfo().getNodeTopologyInfo(rpcManager.getAddress()));
      Map<Address, Response> responses = rpcManager.invokeRemotely(null, rehashControlCommand, true, true);
      updateTopologyInfo(responses.values());
   }
View Full Code Here

         case LockControlCommand.COMMAND_ID:
            LockControlCommand lcc = (LockControlCommand) c;
            lcc.init(interceptorChain, icc, txTable);
            break;
         case RehashControlCommand.COMMAND_ID:
            RehashControlCommand rcc = (RehashControlCommand) c;
            rcc.init(distributionManager, configuration, dataContainer);
            break;
         default:
            if (trace)
               log.trace("Nothing to initialize for command: " + c);
      }
View Full Code Here

   public RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type type, Address sender, Map<Object, InternalCacheValue> state) {
      return buildRehashControlCommand(type, sender, state, null);
   }

   public RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type type, Address sender, Map<Object, InternalCacheValue> state, ConsistentHash consistentHash) {
      return new RehashControlCommand(cacheName, type, sender, state, consistentHash);
   }
View Full Code Here

         // push state.
         Set<Future<Void>> pushFutures = new HashSet<Future<Void>>();
         for (Map.Entry<Address, Map<Object, InternalCacheValue>> entry : statemap.getState().entrySet()) {
            if (log.isDebugEnabled()) log.debug("Pushing {0} entries to {1}", entry.getValue().size(), entry.getKey());
            RehashControlCommand push = cf.buildRehashControlCommand(RehashControlCommand.Type.PUSH_STATE, self, entry.getValue());
            NotifyingNotifiableFuture f = new NotifyingFutureImpl(null);
            pushFutures.add(f);
            rpcManager.invokeRemotelyInFuture(Collections.singleton(entry.getKey()), push, true, f, configuration.getRehashRpcTimeout());
         }
View Full Code Here

                  configuration.isRehashEnabled(), isReceiver, isSender, self);

         if (configuration.isRehashEnabled()) {
            if (isReceiver) {
               try {
                  RehashControlCommand cmd = cf.buildRehashControlCommand(PULL_STATE_LEAVE, self,
                           null, oldCH, newCH, leaversHandled);

                  log.debug("I {0} am pulling state from {1}", self, providers);
                  List<Response> resps = rpcManager.invokeRemotely(providers, cmd, SYNCHRONOUS,
                           configuration.getRehashRpcTimeout(), true);

                  log.debug("I {0} received response {1} ", self, resps);
                  for (Response r : resps) {
                     if (r instanceof SuccessfulResponse) {
                        Map<Object, InternalCacheValue> state = getStateFromResponse((SuccessfulResponse) r);
                        log.debug("I {0} am applying state {1} ", self, state);
                        dmi.applyState(newCH, state);
                     }
                  }
               } finally {
                  RehashControlCommand c = cf.buildRehashControlCommand(LEAVE_REHASH_END, self);
                  rpcManager.invokeRemotely(providers, c, ASYNCHRONOUS, configuration.getRehashRpcTimeout(), false);
               }
            }
            if (isSender) {
               Set<Address> recCopy = new HashSet<Address>(receivers);
View Full Code Here

      Set<Future<Object>> pushFutures = new HashSet<Future<Object>>();
      for (Map.Entry<Address, List<PrepareCommand>> e : state.getState().entrySet()) {
         if (log.isDebugEnabled())
            log.debug("Pushing {0} uncommitted prepares to {1}", e.getValue().size(), e.getKey());
         RehashControlCommand push = cf.buildRehashControlCommandTxLogPendingPrepares(self, e.getValue());
         NotifyingNotifiableFuture<Object> f = new NotifyingFutureImpl(null);
         pushFutures.add(f);
         rpcManager.invokeRemotelyInFuture(Collections.singleton(e.getKey()), push, true, f, configuration.getRehashRpcTimeout());
      }
View Full Code Here

      Set<Future<Object>> pushFutures = new HashSet<Future<Object>>();
      for (Map.Entry<Address, List<WriteCommand>> entry : state.getState().entrySet()) {
         if (log.isDebugEnabled())
            log.debug("Pushing {0} modifications to {1}", entry.getValue().size(), entry.getKey());
         RehashControlCommand push = cf.buildRehashControlCommandTxLog(self, entry.getValue());
         NotifyingNotifiableFuture<Object> f = new NotifyingFutureImpl(null);
         pushFutures.add(f);
         rpcManager.invokeRemotelyInFuture(Collections.singleton(entry.getKey()), push, true, f,
                  configuration.getRehashRpcTimeout());
      }
View Full Code Here

TOP

Related Classes of org.infinispan.commands.control.RehashControlCommand

Copyright © 2018 www.massapicom. 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.