Examples of logicalThread()


Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      final Object[] allKeys = new Object[] {k0, k1, k2, k3, k4, k5, k6, k7};
      for (Object k : allKeys) cache(a0).put(k, k);

      StateSequencer ss = new StateSequencer();
      ss.logicalThread("main", "main:st_in_progress", "main:2nd_node_left", "main:cluster_unavailable");

      final StateTransferManager stm0 = advancedCache(a0).getComponentRegistry().getStateTransferManager();
      final int initialTopologyId = stm0.getCacheTopology().getTopologyId();
      StateSequencerUtil.advanceOnInboundRpc(ss, manager(a1), new CommandMatcher() {
         @Override
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      doTest(CacheMode.DIST_ASYNC);
   }

   private void doTest(CacheMode cacheMode) throws Throwable {
      final StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("st", "st:block_get_transactions", "st:resume_get_transactions", "st:block_ch_update", "st:resume_ch_update");
      sequencer.logicalThread("tx", "tx:before_lock", "tx:block_remote_lock", "tx:resume_remote_lock", "tx:after_commit");

      // The lock will be acquired after rebalance has started, but before cache0 starts sending the transaction data to cache1
      sequencer.order("st:block_get_transactions", "tx:before_lock", "tx:block_remote_lock", "st:resume_get_transactions");
      // The tx will be committed (1PC) after cache1 has received all the state, but before the topology is updated
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

   }

   private void doTest(CacheMode cacheMode) throws Throwable {
      final StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("st", "st:block_get_transactions", "st:resume_get_transactions", "st:block_ch_update", "st:resume_ch_update");
      sequencer.logicalThread("tx", "tx:before_lock", "tx:block_remote_lock", "tx:resume_remote_lock", "tx:after_commit");

      // The lock will be acquired after rebalance has started, but before cache0 starts sending the transaction data to cache1
      sequencer.order("st:block_get_transactions", "tx:before_lock", "tx:block_remote_lock", "st:resume_get_transactions");
      // The tx will be committed (1PC) after cache1 has received all the state, but before the topology is updated
      sequencer.order("st:block_ch_update", "tx:resume_remote_lock", "tx:after_commit", "st:resume_ch_update");
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      // Start another transaction on A: put(k, v2) with the same key
      // Check that the new transaction writes successfully
      // Allow the commit to proceed on C
      // Check that k=v2 everywhere
      StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("tx1", "tx1:begin", "tx1:block_commit_on_backup", "tx1:after_rollback_on_primary",
            "tx1:after_rollback_on_backup", "tx1:resume_commit_on_backup", "tx1:after_commit_on_backup", "tx1:check");
      sequencer.logicalThread("tx2", "tx2:begin", "tx2:end");

      sequencer.order("tx1:after_rollback_on_backup", "tx2:begin", "tx2:end", "tx1:resume_commit_on_backup");
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      // Allow the commit to proceed on C
      // Check that k=v2 everywhere
      StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("tx1", "tx1:begin", "tx1:block_commit_on_backup", "tx1:after_rollback_on_primary",
            "tx1:after_rollback_on_backup", "tx1:resume_commit_on_backup", "tx1:after_commit_on_backup", "tx1:check");
      sequencer.logicalThread("tx2", "tx2:begin", "tx2:end");

      sequencer.order("tx1:after_rollback_on_backup", "tx2:begin", "tx2:end", "tx1:resume_commit_on_backup");

      advanceOnInterceptor(sequencer, cache(2), StateTransferInterceptor.class,
            matchCommand(CommitCommand.class).matchCount(0).build())
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      // Allow the commit to proceed on C
      // Allow the rollback to proceed on C
      // Check that k=v1 everywhere
      // Check that locks are released on B
      final StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("tx1", "tx1:begin", "tx1:block_commit_on_backup", "tx1:after_rollback_on_primary",
            "tx1:block_rollback_on_backup", "tx1:resume_commit_on_backup", "tx1:after_commit_on_backup",
            "tx1:resume_rollback_on_backup", "tx1:after_rollback_on_backup", "tx1:check");

      advanceOnInterceptor(sequencer, cache(2), StateTransferInterceptor.class,
            matchCommand(CommitCommand.class).matchCount(0).build())
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

   ControlledConsistentHashFactory consistentHashFactory = new ControlledConsistentHashFactory(0, 1, 2);

   public void testReplay() throws Exception {
      final StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("tx", "tx:before_prepare_replay", "tx:resume_prepare_replay");
      sequencer.logicalThread("sim", "sim:before_extra_commit", "sim:during_extra_commit");
      sequencer.order("tx:before_prepare_replay", "sim:before_extra_commit", "sim:during_extra_commit", "tx:resume_prepare_replay");

      final Object key = "key";
      assertEquals(Arrays.asList(address(0), address(1), address(2)), advancedCache(0).getDistributionManager().locate(key));
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

   ControlledConsistentHashFactory consistentHashFactory = new ControlledConsistentHashFactory(0, 1, 2);

   public void testReplay() throws Exception {
      final StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("tx", "tx:before_prepare_replay", "tx:resume_prepare_replay");
      sequencer.logicalThread("sim", "sim:before_extra_commit", "sim:during_extra_commit");
      sequencer.order("tx:before_prepare_replay", "sim:before_extra_commit", "sim:during_extra_commit", "tx:resume_prepare_replay");

      final Object key = "key";
      assertEquals(Arrays.asList(address(0), address(1), address(2)), advancedCache(0).getDistributionManager().locate(key));
      Cache<Object, Object> primaryOwnerCache = cache(0);
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      // Block the prepare on B and C so that it times out
      // Wait for the rollback command to be executed on B and C
      // Unblock the prepare on B and C
      // Check that there are no locked keys or remote transactions on B and C
      StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("main", "main:start", "main:check");
      sequencer.logicalThread("primary", "primary:block_prepare", "primary:after_rollback", "primary:resume_prepare",
            "primary:after_prepare");
      sequencer.logicalThread("backup", "backup:block_prepare", "backup:after_rollback", "backup:resume_prepare",
            "backup:after_prepare");
View Full Code Here

Examples of org.infinispan.test.concurrent.StateSequencer.logicalThread()

      // Wait for the rollback command to be executed on B and C
      // Unblock the prepare on B and C
      // Check that there are no locked keys or remote transactions on B and C
      StateSequencer sequencer = new StateSequencer();
      sequencer.logicalThread("main", "main:start", "main:check");
      sequencer.logicalThread("primary", "primary:block_prepare", "primary:after_rollback", "primary:resume_prepare",
            "primary:after_prepare");
      sequencer.logicalThread("backup", "backup:block_prepare", "backup:after_rollback", "backup:resume_prepare",
            "backup:after_prepare");

      sequencer.order("main:start", "primary:block_prepare", "primary:after_prepare", "main:check");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.