Package org.infinispan.commands.control

Examples of org.infinispan.commands.control.StateTransferControlCommand


    * @param addressToFlush address to flush in addition to the current address
    * @param block          if true, mimics setting a flush.  Otherwise, mimics un-setting a flush.
    * @throws Exception if there are issues
    */
   private void mimicPartialFlushViaRPC(Address addressToFlush, boolean block) throws Exception {
      StateTransferControlCommand cmd = commandsFactory.buildStateTransferControlCommand(block);
      if (!block) rpcManager.getTransport().getDistributedSync().releaseSync();
      rpcManager.invokeRemotely(Collections.singletonList(addressToFlush), cmd, ResponseMode.SYNCHRONOUS, configuration.getStateRetrievalTimeout(), true);
      if (block) rpcManager.getTransport().getDistributedSync().acquireSync();
   }
View Full Code Here


                  }
               }
            }
            break;
         case StateTransferControlCommand.COMMAND_ID:
            StateTransferControlCommand rcc = (StateTransferControlCommand) c;
            rcc.init(stateTransferManager, configuration, dataContainer, this);
            break;
         case GetInDoubtTransactionsCommand.COMMAND_ID:
            GetInDoubtTransactionsCommand gptx = (GetInDoubtTransactionsCommand) c;
            gptx.init(recoveryManager);
            break;
View Full Code Here

      return new LockControlCommand(keys,  cacheName, flags, null);
   }

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

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

   public StateTransferControlCommand buildStateTransferCommand(StateTransferControlCommand.Type type, Address sender,
                                                         int viewId, Collection<InternalCacheEntry> state) {
      return new StateTransferControlCommand(cacheName, type, sender, viewId, state);
   }
View Full Code Here

      if (trace) log.tracef("Node %s joining the cluster, broadcasting join request.", self, viewId);

      // the broadcast won't include the local node, call the method directly
      pushConfirmations.confirmJoin(self, viewId);
      // then broadcast to the entire cluster
      final StateTransferControlCommand cmd = cf.buildStateTransferCommand(StateTransferControlCommand.Type.REQUEST_JOIN, self, viewId);
      rpcManager.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, configuration.getRehashRpcTimeout());
   }
View Full Code Here

      if (trace) log.tracef("Node %s finished pushing state for view %s, broadcasting push complete signal.", self, viewId);

      // the broadcast won't include the local node, call the method directly
      pushConfirmations.confirmPush(self, viewId);
      // then broadcast to the entire cluster
      final StateTransferControlCommand cmd = cf.buildStateTransferCommand(StateTransferControlCommand.Type.PUSH_COMPLETED, self, viewId);
      rpcManager.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, configuration.getRehashRpcTimeout());

      boolean clusterPushCompleted = pushConfirmations.waitForClusterToCompletePush(viewId, configuration.getRehashWaitTime());
      if (!clusterPushCompleted) {
         throw new PendingStateTransferException();
View Full Code Here

      checkForPendingRehash(viewId);

      log.debugf("Pushing to node %s %d keys", target, state.size());
      log.tracef("Pushing to node %s keys: %s", target, keys(state));

      final StateTransferControlCommand cmd = cf.buildStateTransferCommand(StateTransferControlCommand.Type.APPLY_STATE, getAddress(), viewId, state);

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

    * @param addressToFlush address to flush in addition to the current address
    * @param block          if true, mimics setting a flush.  Otherwise, mimics un-setting a flush.
    * @throws Exception if there are issues
    */
   private void mimicPartialFlushViaRPC(Address addressToFlush, boolean block) throws Exception {
      StateTransferControlCommand cmd = commandsFactory.buildStateTransferControlCommand(block);
      if (!block) rpcManager.getTransport().getDistributedSync().releaseSync();
      rpcManager.invokeRemotely(Collections.singletonList(addressToFlush), cmd, ResponseMode.SYNCHRONOUS, configuration.getStateRetrievalTimeout(), true);
      if (block) rpcManager.getTransport().getDistributedSync().acquireSync();
   }
View Full Code Here

   public SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call) {
      return new SingleRpcCommand(cacheName, call);
   }

   public StateTransferControlCommand buildStateTransferControlCommand(boolean block) {
      return new StateTransferControlCommand(block);
   }
View Full Code Here

            break;
         case InvalidateL1Command.COMMAND_ID:
            command = new InvalidateL1Command();
            break;
         case StateTransferControlCommand.COMMAND_ID:
            command = new StateTransferControlCommand();
            ((StateTransferControlCommand) command).init(transport);
            break;
         case ClusteredGetCommand.COMMAND_ID:
            command = new ClusteredGetCommand();
            break;
View Full Code Here

TOP

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

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.