Package org.infinispan.commands.control

Examples of org.infinispan.commands.control.StateTransferControlCommand


      }
      assert sizes.get(1) < sizes.get(0) : "JBoss Marshaller should write less bytes: bytesJBoss=" + sizes.get(1) + ", bytesHome=" + sizes.get(0);
   }
  
   public void testReplicableCommandsMarshalling() throws Exception {
      StateTransferControlCommand c1 = new StateTransferControlCommand(true);

      List<Integer> sizes = new ArrayList<Integer>(2);
      for (Marshaller marshaller : marshallers) {
         byte[] bytes = marshaller.objectToByteBuffer(c1);
         StateTransferControlCommand rc1 = (StateTransferControlCommand) marshaller.objectFromByteBuffer(bytes);
         assert rc1.getCommandId() == c1.getCommandId() : "Writen[" + c1.getCommandId() + "] and read[" + rc1.getCommandId() + "] objects should be the same";
         assert Arrays.equals(rc1.getParameters(), c1.getParameters()) : "Writen[" + c1.getParameters() + "] and read[" + rc1.getParameters() + "] objects should be the same";
         sizes.add(bytes.length);
      }
      assert sizes.get(1) < sizes.get(0) : "JBoss Marshaller should write less bytes: bytesJBoss=" + sizes.get(1) + ", bytesHome=" + sizes.get(0);

      ClusteredGetCommand c2 = new ClusteredGetCommand("key", "mycache");
View Full Code Here


      assert extended.isReplayIgnoredRequests() == readObj.isReplayIgnoredRequests() :
            "Writen[" + extended.isReplayIgnoredRequests() + "] and read[" + readObj.isReplayIgnoredRequests() + "] objects should be the same";
   }

   public void testReplicableCommandsMarshalling() throws Exception {
      StateTransferControlCommand c1 = new StateTransferControlCommand(true);
      byte[] bytes = marshaller.objectToByteBuffer(c1);
      StateTransferControlCommand rc1 = (StateTransferControlCommand) marshaller.objectFromByteBuffer(bytes);
      assert rc1.getCommandId() == c1.getCommandId() : "Writen[" + c1.getCommandId() + "] and read[" + rc1.getCommandId() + "] objects should be the same";
      assert Arrays.equals(rc1.getParameters(), c1.getParameters()) : "Writen[" + c1.getParameters() + "] and read[" + rc1.getParameters() + "] objects should be the same";

      ClusteredGetCommand c2 = new ClusteredGetCommand("key", "mycache");
      marshallAndAssertEquality(c2);

      // SizeCommand does not have an empty constructor, so doesn't look to be one that is marshallable.
View Full Code Here

         type =  StateTransferControlCommand.Type.APPLY_LOCKS;
      } else {
         throw new IllegalStateException("Cannot have both locks and state set to null.");
      }

      final StateTransferControlCommand cmd = cf.buildStateTransferCommand(type, getAddress(), viewId, state, lockInfo);

      rpcManager.invokeRemotelyInFuture(targets, cmd, false, stateTransferFuture, getTimeout());
   }
View Full Code Here

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

   }

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

   }

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

               break;
            case ClusteredGetCommand.COMMAND_ID:
               command = new ClusteredGetCommand(cacheName);
               break;
            case StateTransferControlCommand.COMMAND_ID:
               command = new StateTransferControlCommand(cacheName);
               break;
            case RemoveCacheCommand.COMMAND_ID:
               command = new RemoveCacheCommand(cacheName, cacheManager, registry);
               break;
            case TxCompletionNotificationCommand.COMMAND_ID:
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

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.