Package org.apache.hadoop.test.MultithreadedTestUtil

Examples of org.apache.hadoop.test.MultithreadedTestUtil.RepeatingTestThread


          cluster, conf);
     
      TestContext ctx = new TestContext();
      for (int i = 0; i < 50; i++) {
        final int finalI = i;
        ctx.addThread(new RepeatingTestThread(ctx) {
          @Override
          public void doAnAction() throws Exception {
            Path p = new Path("/test-" + finalI);
            fs.mkdirs(p);
            fs.delete(p, true);
          }
        });
      }
     
      ctx.addThread(new RepeatingTestThread(ctx) {
        @Override
        public void doAnAction() throws Exception {
          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
View Full Code Here


          cluster, conf);
     
      TestContext ctx = new TestContext();
      for (int i = 0; i < 50; i++) {
        final int finalI = i;
        ctx.addThread(new RepeatingTestThread(ctx) {
          @Override
          public void doAnAction() throws Exception {
            Path p = new Path("/test-" + finalI);
            fs.mkdirs(p);
            fs.delete(p, true);
          }
        });
      }
     
      ctx.addThread(new RepeatingTestThread(ctx) {
        @Override
        public void doAnAction() throws Exception {
          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
View Full Code Here

   * heartbeats, and NN-side block work.
   * @param interval millisecond period on which to run
   */
  public void addReplicationTriggerThread(final int interval) {

    testCtx.addThread(new RepeatingTestThread(testCtx) {
     
      @Override
      public void doAnAction() throws Exception {
        for (DataNode dn : cluster.getDataNodes()) {
          DataNodeTestUtils.triggerDeletionReport(dn);
View Full Code Here

  /**
   * Add a thread which periodically triggers failover back and forth between
   * the two namenodes.
   */
  public void addFailoverThread(final int msBetweenFailovers) {
    testCtx.addThread(new RepeatingTestThread(testCtx) {
     
      @Override
      public void doAnAction() throws Exception {
        System.err.println("==============================\n" +
            "Failing over from 0->1\n" +
View Full Code Here

  @Test
  public void testRepeatingThread() throws Exception {
    final AtomicInteger counter = new AtomicInteger();

    TestContext ctx = new TestContext();
    ctx.addThread(new RepeatingTestThread(ctx) {
      @Override
      public void doAnAction() throws Exception {
        counter.incrementAndGet();
      }
    });
View Full Code Here

          cluster, conf);
     
      TestContext ctx = new TestContext();
      for (int i = 0; i < 50; i++) {
        final int finalI = i;
        ctx.addThread(new RepeatingTestThread(ctx) {
          @Override
          public void doAnAction() throws Exception {
            Path p = new Path("/test-" + finalI);
            fs.mkdirs(p);
            fs.delete(p, true);
          }
        });
      }
     
      ctx.addThread(new RepeatingTestThread(ctx) {
        @Override
        public void doAnAction() throws Exception {
          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
View Full Code Here

  @Test
  public void testRepeatingThread() throws Exception {
    final AtomicInteger counter = new AtomicInteger();

    TestContext ctx = new TestContext();
    ctx.addThread(new RepeatingTestThread(ctx) {
      @Override
      public void doAnAction() throws Exception {
        counter.incrementAndGet();
      }
    });
View Full Code Here

   * heartbeats, and NN-side block work.
   * @param interval millisecond period on which to run
   */
  public void addReplicationTriggerThread(final int interval) {

    testCtx.addThread(new RepeatingTestThread(testCtx) {
     
      @Override
      public void doAnAction() throws Exception {
        for (DataNode dn : cluster.getDataNodes()) {
          DataNodeTestUtils.triggerDeletionReport(dn);
View Full Code Here

  /**
   * Add a thread which periodically triggers failover back and forth between
   * the two namenodes.
   */
  public void addFailoverThread(final int msBetweenFailovers) {
    testCtx.addThread(new RepeatingTestThread(testCtx) {
     
      @Override
      public void doAnAction() throws Exception {
        System.err.println("==============================\n" +
            "Failing over from 0->1\n" +
View Full Code Here

          cluster, conf);
     
      TestContext ctx = new TestContext();
      for (int i = 0; i < 50; i++) {
        final int finalI = i;
        ctx.addThread(new RepeatingTestThread(ctx) {
          @Override
          public void doAnAction() throws Exception {
            Path p = new Path("/test-" + finalI);
            fs.mkdirs(p);
            fs.delete(p, true);
          }
        });
      }
     
      ctx.addThread(new RepeatingTestThread(ctx) {
        @Override
        public void doAnAction() throws Exception {
          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.test.MultithreadedTestUtil.RepeatingTestThread

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.