Package org.apache.hadoop.test.MultithreadedTestUtil

Examples of org.apache.hadoop.test.MultithreadedTestUtil.TestContext.startThreads()


      @Override
      public void doAnAction() throws Exception {
        counter.incrementAndGet();
      }
    });
    ctx.startThreads();
    long st = System.currentTimeMillis();
    ctx.waitFor(3000);
    ctx.stop();
    long et = System.currentTimeMillis();
    long elapsed = et - st;
View Full Code Here


      // happens quickly by triggering deletion reports and replication
      // work calculation frequently.
      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
View Full Code Here

          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
        }
      });
      ctx.startThreads();
      ctx.waitFor(20000);
      ctx.stop();
    } finally {
      cluster.shutdown();
    }
View Full Code Here

          threadsRun.incrementAndGet();
        }
      });
    }
    assertEquals(0, threadsRun.get());
    ctx.startThreads();
    long st = Time.now();
    ctx.waitFor(30000);
    long et = Time.now();

    // All threads should have run
View Full Code Here

      @Override
      public void doWork() throws Exception {
        fail(FAIL_MSG);
      }
    });
    ctx.startThreads();
    long st = Time.now();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
View Full Code Here

      @Override
      public void doWork() throws Exception {
        throw new IOException("my ioe");
      }
    });
    ctx.startThreads();
    long st = Time.now();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
View Full Code Here

      @Override
      public void doAnAction() throws Exception {
        counter.incrementAndGet();
      }
    });
    ctx.startThreads();
    long st = Time.now();
    ctx.waitFor(3000);
    ctx.stop();
    long et = Time.now();
    long elapsed = et - st;
View Full Code Here

      // happens quickly by triggering deletion reports and replication
      // work calculation frequently.
      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      togglers.startThreads();
     
      togglers.waitFor(RUNTIME);
      togglers.stop();
      harness.stopThreads();
View Full Code Here

      // happens quickly by triggering deletion reports and replication
      // work calculation frequently.
      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
View Full Code Here

          cluster.transitionToStandby(0);
          Thread.sleep(50);
          cluster.transitionToActive(0);
        }
      });
      ctx.startThreads();
      ctx.waitFor(20000);
      ctx.stop();
    } finally {
      cluster.shutdown();
    }
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.