Examples of waitForCall()


Examples of com.google.common.util.concurrent.FuturesTest.SingleCallListener.waitForCall()

    assertFalse(listenableFuture.isDone());

    listenableFuture.addListener(singleCallListener, executorService);
    abstractFuture.set(DATA1);
    assertEquals(DATA1, listenableFuture.get());
    singleCallListener.waitForCall();

    assertTrue(spy.wasExecuted);
    assertTrue(singleCallListener.wasCalled());
    assertTrue(listenableFuture.isDone());
  }
View Full Code Here

Examples of com.google.common.util.concurrent.FuturesTest.SingleCallListener.waitForCall()

     */
    submitSuccessful.await();
    executorService.shutdownNow();
    abstractFuture.set(DATA1);
    assertEquals(DATA1, listenableFuture.get());
    singleCallListener.waitForCall();

    assertTrue(singleCallListener.wasCalled());
    assertTrue(listenableFuture.isDone());
  }

View Full Code Here

Examples of com.google.common.util.concurrent.FuturesTest.SingleCallListener.waitForCall()

    assertFalse(listenableFuture.isDone());

    listenableFuture.addListener(singleCallListener, executorService);
    abstractFuture.set(DATA1);
    assertEquals(DATA1, listenableFuture.get());
    singleCallListener.waitForCall();

    assertTrue(spy.wasExecuted);
    assertTrue(singleCallListener.wasCalled());
    assertTrue(listenableFuture.isDone());
  }
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

            return null;
          }
        });

        // Wait until saveNamespace calls getGenerationStamp
        delayer.waitForCall();
        // then cancel the saveNamespace
        Future<Void> cancelFuture = pool.submit(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            canceler.cancel("cancelled");
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

      // Force a block report to be generated. The block report will have
      // an RBW replica in it. Wait for the RPC to be sent, but block
      // it before it gets to the NN.
      dn.scheduleAllBlockReport(0);
      delayer.waitForCall();

    } finally {
      IOUtils.closeStream(out);
    }
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

            Mockito.eq(NameNodeFile.IMAGE), Mockito.any(Canceler.class));

    // Perform some edits and wait for a checkpoint to start on the SBN.
    doEdits(0, 1000);
    nn0.getRpcServer().rollEditLog();
    answerer.waitForCall();
    assertTrue("SBN is not performing checkpoint but it should be.",
        answerer.getFireCount() == 1 && answerer.getResultCount() == 0);
   
    // Make sure that the lock has actually been taken by the checkpointing
    // thread.
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

            Mockito.any(Canceler.class));
   
    // Perform some edits and wait for a checkpoint to start on the SBN.
    doEdits(0, 1000);
    nn0.getRpcServer().rollEditLog();
    answerer.waitForCall();
    assertTrue("SBN is not performing checkpoint but it should be.",
        answerer.getFireCount() == 1 && answerer.getResultCount() == 0);
   
    // Make sure that the lock has actually been taken by the checkpointing
    // thread.
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

      // Set up a thread to do a checkpoint from the first 2NN
      DoCheckpointThread checkpointThread = new DoCheckpointThread(secondary1);
      checkpointThread.start();

      // Wait for the first checkpointer to get to where it should save its image.
      delayer.waitForCall();
     
      // Now make the second checkpointer run an entire checkpoint
      secondary2.doCheckpoint();
     
      // Let the first one finish
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

      // Set up a thread to do a checkpoint from the first 2NN
      DoCheckpointThread checkpointThread = new DoCheckpointThread(secondary1);
      checkpointThread.start();

      // Wait for the first checkpointer to be about to call getEditLogManifest
      delayer.waitForCall();
     
      // Now make the second checkpointer run an entire checkpoint
      secondary2.doCheckpoint();
     
      // NN should have now received fsimage_4
View Full Code Here

Examples of org.apache.hadoop.test.GenericTestUtils.DelayAnswer.waitForCall()

      // Set up a thread to do a checkpoint from the first 2NN
      DoCheckpointThread checkpointThread = new DoCheckpointThread(secondary1);
      checkpointThread.start();

      // Wait for the first checkpointer to get to where it should save its image.
      delayer.waitForCall();
     
      // Now make the second checkpointer run an entire checkpoint
      secondary2.doCheckpoint();
     
      // Let the first one finish
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.