Package org.infinispan.commands.control

Examples of org.infinispan.commands.control.RehashControlCommand


         if (trace)
            log.tracef("Coordinator: sending rehash completed notification for view %d, lastView %d, notifications received: %s", viewId, lastViewId, pushConfirmations);

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


      if (t.isCoordinator()) {
         if (trace) log.tracef("Node %s is the coordinator, marking push for %d as complete directly", self, viewId);
         markNodePushCompleted(viewId, self);
      } else {
         final RehashControlCommand cmd = cf.buildRehashControlCommand(RehashControlCommand.Type.NODE_PUSH_COMPLETED, self, viewId);
         Address coordinator = rpcManager.getTransport().getCoordinator();

         if (trace) log.tracef("Node %s is not the coordinator, sending request to mark push for %d as complete to %s", self, viewId, coordinator);
         rpcManager.invokeRemotely(Collections.singleton(coordinator), cmd, ResponseMode.SYNCHRONOUS, configuration.getRehashRpcTimeout());
      }
View Full Code Here

         final Address target = entry.getKey();
         Map<Object, InternalCacheValue> state = entry.getValue();
         log.debugf("Pushing to node %s %d keys", target, state.size());
         log.tracef("Pushing to node %s keys: %s", target, state.keySet());

         final RehashControlCommand cmd = cf.buildRehashControlCommand(RehashControlCommand.Type.APPLY_STATE, self,
                                                                       newViewId, state, chOld, chNew);

         rpcManager.invokeRemotelyInFuture(Collections.singleton(target), cmd,
                                           false, stateTransferFuture, configuration.getRehashRpcTimeout());
      }
View Full Code Here

                  }
               }
            }
            break;
         case RehashControlCommand.COMMAND_ID:
            RehashControlCommand rcc = (RehashControlCommand) c;
            rcc.init(distributionManager, configuration, dataContainer, this);
            break;
         case GetInDoubtTransactionsCommand.COMMAND_ID:
            GetInDoubtTransactionsCommand gptx = (GetInDoubtTransactionsCommand) c;
            gptx.init(recoveryManager);
            break;
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

      return new RehashControlCommand(cacheName, type, sender, viewId);
   }

   public RehashControlCommand buildRehashControlCommand(RehashControlCommand.Type type, Address sender,
         int viewId, Map<Object, InternalCacheValue> state, ConsistentHash oldCH, ConsistentHash newCH) {
      return new RehashControlCommand(cacheName, type, sender, viewId, state, oldCH, newCH);
   }
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_JOIN, myAddress, null, chOld, chNew,null);
               // TODO I should be able to process state chunks from different nodes simultaneously!!
               List<Address> addressesWhoMaySendStuff = getAddressesWhoMaySendStuff(chNew, configuration.getNumOwners());
               List<Response> resps = rpcManager.invokeRemotely(addressesWhoMaySendStuff, cmd, SYNCHRONOUS, configuration.getRehashRpcTimeout(), true);
  
               // 7.  Apply state
View Full Code Here

            log.info("{0} completed join rehash!", self);
      }
   }

   private void broadcastNewCh() {
      RehashControlCommand rehashControlCommand = cf.buildRehashControlCommand(JOIN_REHASH_START, self);
      rehashControlCommand.setNodeTopologyInfo(dmi.topologyInfo.getNodeTopologyInfo(rpcManager.getAddress()));
      List<Response> responseList = rpcManager.invokeRemotely(null, rehashControlCommand, true, true);
      updateTopologyInfo(responseList);
   }
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

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.