Java 类org.apache.hadoop.mapreduce.v2.app.MRAppMaster 实例源码

项目:hops    文件:TestRMContainerAllocator.java   
/**
 * MAPREDUCE-6771. Test if RMContainerAllocator generates the events in the
 * right order while processing finished containers.
 */
@Test
public void testHandlingFinishedContainers() {
  EventHandler eventHandler = mock(EventHandler.class);

  AppContext context = mock(MRAppMaster.RunningAppContext.class);
  when(context.getClock()).thenReturn(new ControlledClock());
  when(context.getClusterInfo()).thenReturn(
      new ClusterInfo(Resource.newInstance(10240, 1)));
  when(context.getEventHandler()).thenReturn(eventHandler);
  RMContainerAllocator containerAllocator =
      new RMContainerAllocatorForFinishedContainer(null, context);

  ContainerStatus finishedContainer = ContainerStatus.newInstance(
      mock(ContainerId.class), ContainerState.COMPLETE, "", 0);
  containerAllocator.processFinishedContainer(finishedContainer);

  InOrder inOrder = inOrder(eventHandler);
  inOrder.verify(eventHandler).handle(
      isA(TaskAttemptDiagnosticsUpdateEvent.class));
  inOrder.verify(eventHandler).handle(isA(TaskAttemptEvent.class));
  inOrder.verifyNoMoreInteractions();
}
项目:hadoop    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:hadoop    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:big-c    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:big-c    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:FlexMap    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:FlexMap    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:hops    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}
项目:hops    文件:TestMRJobs.java   
/**
 * Verifies that the class was loaded by the job classloader if it is in the
 * context of the MRAppMaster, and if not throws an exception to fail the
 * job.
 */
private void verifyClassLoader(Class<?> cls) {
  // to detect that it is instantiated in the context of the MRAppMaster, we
  // inspect the stack trace and determine a caller is MRAppMaster
  for (StackTraceElement e: new Throwable().getStackTrace()) {
    if (e.getClassName().equals(MRAppMaster.class.getName()) &&
        !(cls.getClassLoader() instanceof ApplicationClassLoader)) {
      throw new ExceptionInInitializerError("incorrect classloader used");
    }
  }
}