Package org.infinispan.commands.control

Examples of org.infinispan.commands.control.RehashControlCommand


   public RehashControlCommand buildRehashControlCommandTxLog(Address sender, List<WriteCommand> commands) {
      return new RehashControlCommand(cacheName, DRAIN_TX, sender, commands, null, this);
   }

   public RehashControlCommand buildRehashControlCommandTxLogPendingPrepares(Address sender, List<PrepareCommand> commands) {
      return new RehashControlCommand(cacheName, DRAIN_TX_PREPARES, sender, null, commands, this);
   }
View Full Code Here


   public RehashControlCommand buildRehashControlCommandTxLogPendingPrepares(Address sender, List<PrepareCommand> commands) {
      return new RehashControlCommand(cacheName, DRAIN_TX_PREPARES, sender, null, commands, this);
   }

   public RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type type, Address sender, Map<Object, InternalCacheValue> state, ConsistentHash consistentHash) {
      return new RehashControlCommand(cacheName, type, sender, state, consistentHash, this);
   }
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

            // 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

      // nothing to push, but we need to inform the coordinator that we have finished our push
      if (t.isCoordinator()) {
         markNodePushCompleted(t.getViewId(), t.getAddress());
      } else {
         final RehashControlCommand cmd = cf.buildRehashControlCommand(RehashControlCommand.Type.NODE_PUSH_COMPLETED, self, t.getViewId());

         // doesn't matter when the coordinator receives the command, the transport will ensure that it eventually gets there
         rpcManager.invokeRemotely(Collections.singleton(rpcManager.getTransport().getCoordinator()), cmd, false);
      }
   }
View Full Code Here

         if (trace)
            log.tracef("Coordinator: sending rehash completed notification for view %s", viewId);

         // all the nodes are up-to-date, broadcast the rehash completed command
         final RehashControlCommand cmd = cf.buildRehashControlCommand(RehashControlCommand.Type.REHASH_COMPLETED, getSelf(), viewId);

         // all nodes will eventually receive the command, no need to wait here
         rpcManager.broadcastRpcCommand(cmd, false);
         // The broadcast doesn't send the message to the local node
         markRehashCompleted(viewId);
View Full Code Here

   public LockControlCommand buildLockControlCommand(Collection keys, boolean implicit, Set<Flag> flags) {
      return new LockControlCommand(keys, cacheName, flags, implicit);
   }

   public RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type type, Address sender, int viewId) {
      return new RehashControlCommand(cacheName, type, sender, viewId);
   }
View Full Code Here

   }

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

            break;
         case ClusteredGetCommand.COMMAND_ID:
            command = new ClusteredGetCommand();
            break;
         case RehashControlCommand.COMMAND_ID:
            command = new RehashControlCommand(transport);
            break;
         case RemoveCacheCommand.COMMAND_ID:
            command = new RemoveCacheCommand(cacheManager, registry);
            break;
         case RemoveRecoveryInfoCommand.COMMAND_ID:
View Full Code Here

            if (isReceiver) {
               // optimise ...
               providers.remove(self);

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

                  log.debugf("I %s am pulling state from %s", self, providers);
                  Set<Future<Void>> stateRetrievalProcesses = new HashSet<Future<Void>>(providers.size());
                  for (Address stateProvider : providers) {
                     stateRetrievalProcesses.add(
                           statePullExecutor.submit(new LeaveStateGrabber(stateProvider, cmd, newCH))
                     );
                  }

                  // Wait for all this state to be applied, in parallel.
                  log.trace("State retrieval being processed.");
                  for (Future<Void> f : stateRetrievalProcesses) f.get();
                  log.tracef("State retrieval from %s completed.", providers);

               } finally {
                  // Inform state senders that state has been applied successfully so they can proceed.
                  // Needs to be SYNC - we need to make sure these messages don't get 'lost' or you end up with a
                  // blocked up cluster
                  log.tracef("Informing %s that state has been applied.", providers);
                  RehashControlCommand c = cf.buildRehashControlCommand(LEAVE_REHASH_END, self);
                  rpcManager.invokeRemotely(providers, c, SYNCHRONOUS, configuration.getRehashRpcTimeout(), true);
               }
            }
            if (isSender) {
               Set<Address> recCopy = new HashSet<Address>(receivers);
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.