Java 类org.apache.hadoop.mapred.gridmix.TestResourceUsageEmulators.FakeProgressive 实例源码

项目:hadoop    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:aliyun-oss-hadoop-fs    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:big-c    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-plus    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hops    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-TCP    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hardfs    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-on-lustre2    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationAccuracy(Configuration conf, 
                      FakeHeapUsageEmulatorCore fakeCore,
                      ResourceCalculatorPlugin monitor,
                      ResourceUsageMetrics metrics,
                      TotalHeapUsageEmulatorPlugin heapPlugin,
                      long expectedTotalHeapUsageInMB,
                      long expectedTotalNumCalls)
throws Exception {
  FakeProgressive fakeProgress = new FakeProgressive();
  fakeCore.resetFake();
  heapPlugin.initialize(conf, metrics, monitor, fakeProgress);
  int numLoops = 0;
  while (fakeProgress.getProgress() < 1) {
    ++numLoops;
    float progress = numLoops / 100.0F;
    fakeProgress.setProgress(progress);
    heapPlugin.emulate();
  }

  // test if the resource plugin shows the expected usage
  assertEquals("Cumulative heap usage emulator plugin failed (total usage)!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 1L);
  // test if the resource plugin shows the expected num calls
  assertEquals("Cumulative heap usage emulator plugin failed (num calls)!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:aliyun-oss-hadoop-fs    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:big-c    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-plus    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hops    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-TCP    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hardfs    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}
项目:hadoop-on-lustre2    文件:TestGridmixMemoryEmulation.java   
private static void testEmulationBoundary(float progress, 
    FakeHeapUsageEmulatorCore fakeCore, FakeProgressive fakeProgress, 
    TotalHeapUsageEmulatorPlugin heapPlugin, long expectedTotalHeapUsageInMB, 
    long expectedTotalNumCalls, String info) throws Exception {
  fakeProgress.setProgress(progress);
  heapPlugin.emulate();
  // test heap usage
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalHeapUsageInMB, fakeCore.getHeapUsageInMB(), 0L);
  // test num calls
  assertEquals("Emulation interval test for heap usage failed " + info + "!", 
               expectedTotalNumCalls, fakeCore.getNumCalls(), 0L);
}