Package org.infinispan.test.fwk

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()


      // Allow the non-owner cache to request transactions from the owners (in any order)
      checkPoint.trigger("OUT_GET_TRANSACTIONS_" + primary);
      checkPoint.trigger("OUT_GET_TRANSACTIONS_" + backup1);
      checkPoint.awaitStrict("IN_GET_TRANSACTIONS_" + primary, 10, SECONDS);
      checkPoint.awaitStrict("IN_GET_TRANSACTIONS_" + backup1, 10, SECONDS);

      // See which cache receives the START_STATE_TRANSFER command first. We'll kill the other.
      String event = checkPoint.peek(5, TimeUnit.SECONDS, "IN_START_STATE_TRANSFER_" + primary,
            "IN_START_STATE_TRANSFER_" + backup1);
      Address liveNode = event.endsWith(primary.toString()) ? primary : backup1;
View Full Code Here


      // Kill cache cacheToStop to force a topology update.
      // The topology update will remove the transfers from cache(nodeToKill).
      manager(nodeToKill).getCache().stop();

      // Now allow cache 0 to process the state from cache(liveNode)
      checkPoint.awaitStrict("IN_RESPONSE_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_RESPONSE_" + liveNode);

      log.debugf("Received segments?");
      Thread.sleep(1000);
View Full Code Here

      log.debugf("Received segments?");
      Thread.sleep(1000);

      // Wait for cache 0 to request the transactions for the failed segments from cache 1
      checkPoint.awaitStrict("IN_GET_TRANSACTIONS_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_GET_TRANSACTIONS_" + liveNode);

      // ISPN-3120: Now cache 0 should think it finished receiving state. Allow all the commands to proceed.
      checkPoint.awaitStrict("IN_START_STATE_TRANSFER_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_START_STATE_TRANSFER_" + liveNode);
View Full Code Here

      // Wait for cache 0 to request the transactions for the failed segments from cache 1
      checkPoint.awaitStrict("IN_GET_TRANSACTIONS_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_GET_TRANSACTIONS_" + liveNode);

      // ISPN-3120: Now cache 0 should think it finished receiving state. Allow all the commands to proceed.
      checkPoint.awaitStrict("IN_START_STATE_TRANSFER_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_START_STATE_TRANSFER_" + liveNode);

      checkPoint.awaitStrict("IN_RESPONSE_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_RESPONSE_" + liveNode);
View Full Code Here

      // ISPN-3120: Now cache 0 should think it finished receiving state. Allow all the commands to proceed.
      checkPoint.awaitStrict("IN_START_STATE_TRANSFER_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_START_STATE_TRANSFER_" + liveNode);

      checkPoint.awaitStrict("IN_RESPONSE_" + liveNode, 10, SECONDS);
      checkPoint.trigger("OUT_RESPONSE_" + liveNode);

      TestingUtil.waitForRehashToComplete(nonOwnerCache, manager(liveNode).getCache());

      log.debugf("Final checkpoint status: %s", checkPoint);
View Full Code Here

            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            Object result = invocation.callRealMethod();
            checkpoint.trigger("post_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return result;
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));

      // Start cache 1, but the tx data request will be blocked on cache 0
View Full Code Here

      // Start cache 1, but the tx data request will be blocked on cache 0
      StateTransferManager stm0 = TestingUtil.extractComponent(cache0, StateTransferManager.class);
      int initialTopologyId = stm0.getCacheTopology().getTopologyId();
      int rebalanceTopologyId = initialTopologyId + 1;
      AdvancedCache<Object, Object> cache1 = advancedCache(1, CACHE_NAME);
      checkpoint.awaitStrict("post_get_transactions_" + rebalanceTopologyId + "_from_" + address(1), 10, SECONDS);

      // Start many transaction on cache 0, which will block on cache 1
      Future<Object>[] futures = new Future[NUM_TXS];
      for (int i = 0; i < NUM_TXS; i++) {
         // The rollback command should be invoked on cache 1 and it should block until the tx is created there
View Full Code Here

            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            Object result = invocation.callRealMethod();
            checkpoint.trigger("post_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return result;
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));

      // Start a transaction on cache 0, which will block on cache 1
View Full Code Here

      // Start cache 1, but the tx data request will be blocked on cache 0
      StateTransferManager stm0 = TestingUtil.extractComponent(cache0, StateTransferManager.class);
      int initialTopologyId = stm0.getCacheTopology().getTopologyId();
      int rebalanceTopologyId = initialTopologyId + 1;
      AdvancedCache<Object, Object> cache1 = advancedCache(1, CACHE_NAME);
      checkpoint.awaitStrict("post_get_transactions_" + rebalanceTopologyId + "_from_" + address(1), 10, SECONDS);

      // The commit/rollback command should be invoked on cache 1 and it should block until the tx is created there
      Future<Object> future = fork(new Callable<Object>() {
         @Override
         public Object call() throws Exception {
View Full Code Here

         public Object answer(InvocationOnMock invocation) throws Throwable {
            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            checkpoint.trigger("pre_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));
      doAnswer(new Answer<Object>() {
         @Override
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.