Package org.apache.hadoop.test.MultithreadedTestUtil

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


      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
      System.err.println("===========================\n\n\n\n");
      harness.shutdown();
View Full Code Here


        // Loop printing results every second until the specified
        // time has elapsed
        for (int i = 0; i < opts.secondsToRun ; i++) {
          long st = System.nanoTime();
          ctx.waitFor(1000);
          long et = System.nanoTime();
          long ct = callCount.getAndSet(0);
          totalCalls += ct;
          double callsPerSec = (ct * 1000000000)/(et - st);
          System.out.println("Calls per second: " + callsPerSec);
View Full Code Here

      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      togglers.startThreads();
     
      togglers.waitFor(RUNTIME);
      togglers.stop();
      harness.stopThreads();

      // CHeck that the files can be read without throwing
      for (int i = 0; i < NUM_THREADS; i++) {
View Full Code Here

      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
      System.err.println("===========================\n\n\n\n");
      harness.shutdown();
View Full Code Here

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

        // Loop printing results every second until the specified
        // time has elapsed
        for (int i = 0; i < opts.secondsToRun ; i++) {
          long st = System.nanoTime();
          ctx.waitFor(1000);
          long et = System.nanoTime();
          long ct = callCount.getAndSet(0);
          totalCalls += ct;
          double callsPerSec = (ct * 1000000000)/(et - st);
          System.out.println("Calls per second: " + callsPerSec);
View Full Code Here

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

      });
    }
    assertEquals(0, threadsRun.get());
    ctx.startThreads();
    long st = System.currentTimeMillis();
    ctx.waitFor(30000);
    long et = System.currentTimeMillis();

    // All threads should have run
    assertEquals(3, threadsRun.get());
    // Test shouldn't have waited the full 30 seconds, since
View Full Code Here

      }
    });
    ctx.startThreads();
    long st = System.currentTimeMillis();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
      // expected
      assertEquals(FAIL_MSG, rte.getCause().getMessage());
    }
View Full Code Here

      }
    });
    ctx.startThreads();
    long st = System.currentTimeMillis();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
      // expected
      assertEquals("my ioe", rte.getCause().getMessage());
    }
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.