Example usage for org.apache.hadoop.yarn.server.resourcemanager RMContext getDispatcher

List of usage examples for org.apache.hadoop.yarn.server.resourcemanager RMContext getDispatcher

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.resourcemanager RMContext getDispatcher.

Prototype

Dispatcher getDispatcher();

Source Link

Usage

From source file:org.apache.myriad.scheduler.yarn.MyriadCapacityScheduler.java

License:Apache License

/**
 * Register an event handler that receives {@link RMNodeEvent} events.
 * This event handler is registered ahead of RM's own event handler for RMNodeEvents.
 * For e.g. myriad can inspect a node's HB (RMNodeStatusEvent) before the HB is handled by
 * RM and the scheduler.// ww w . j a v a  2s  .c  o m
 *
 * @param rmContext
 */
@Override
public synchronized void setRMContext(RMContext rmContext) {
    this.rmContext = rmContext;
    this.yarnSchedulerInterceptor = new CompositeInterceptor();
    rmNodeEventHandler = new RMNodeEventHandler(yarnSchedulerInterceptor, rmContext);
    rmContext.getDispatcher().register(RMNodeEventType.class, rmNodeEventHandler);
    super.setRMContext(rmContext);
}