@SuppressWarnings("unchecked") /** * This method is called to notify the application that * new application is stored or updated in state store * @param event App event containing the app id and event type */ private void notifyApplication(RMAppEvent event) { rmDispatcher.getEventHandler().handle(event); }
@Override public void handle(Event event) { dispatcher.getEventHandler().handle(event); }
protected void initDispatcher(Configuration conf) { // create async handler dispatcher = new AsyncDispatcher("NodeLabelManager dispatcher"); AsyncDispatcher asyncDispatcher = (AsyncDispatcher) dispatcher; asyncDispatcher.init(conf); asyncDispatcher.setDrainEventsOnStop(); }
@Override public void handle(Event event) { synchronized (mutex) { actual.handle(event); drained = false; } } };
/** * Unit test friendly. */ protected AsyncDispatcher createNMDispatcher() { return new AsyncDispatcher("NM Event dispatcher"); }
@Override public void register(Class<? extends Enum> eventType, EventHandler handler) { for (AsyncDispatcher dispatcher : dispatchers) { dispatcher.register(eventType, handler); } }
protected void stopDispatcher() { AsyncDispatcher asyncDispatcher = (AsyncDispatcher) dispatcher; if (null != asyncDispatcher) { asyncDispatcher.stop(); } }
@Override protected AsyncDispatcher createDispatcher() { dispatcher = new DrainDispatcher(); return dispatcher; }
@Override public String toString() { return super.toString() + " for container " + containerID + " taskAttempt " + taskAttemptID; }
@Override public String toString() { return "EventType: " + getType(); } }
@Override public void handle(Event event) { dispatch(event); } }
public DrainDispatcher(BlockingQueue<Event> eventQueue) { super(eventQueue); this.queue = eventQueue; this.mutex = this; // Disable system exit since this class is only for unit tests. disableExitOnDispatchException(); }
@SuppressWarnings("unchecked") /** * This method is called to notify the application attempt * that new attempt is stored or updated in state store * @param event App attempt event containing the app attempt * id and event type */ private void notifyApplicationAttempt(RMAppAttemptEvent event) { rmDispatcher.getEventHandler().handle(event); }
@Override public void handle(Event event) { dispatcher.getEventHandler().handle(event); }
@SuppressWarnings("unchecked") /** * This method is called to notify the application that * new application is stored or updated in state store * @param event App event containing the app id and event type */ private void notifyApplication(RMAppEvent event) { rmDispatcher.getEventHandler().handle(event); }
@SuppressWarnings("unchecked") /** * This method is called to notify the application that * new application is stored or updated in state store * @param event App event containing the app id and event type */ private void notifyApplication(RMAppEvent event) { rmDispatcher.getEventHandler().handle(event); }
@SuppressWarnings("unchecked") /** * This method is called to notify the application attempt * that new attempt is stored or updated in state store * @param event App attempt event containing the app attempt * id and event type */ private void notifyApplicationAttempt(RMAppAttemptEvent event) { rmDispatcher.getEventHandler().handle(event); }
@SuppressWarnings("unchecked") /** * This method is called to notify the application attempt * that new attempt is stored or updated in state store * @param event App attempt event containing the app attempt * id and event type */ private void notifyApplicationAttempt(RMAppAttemptEvent event) { rmDispatcher.getEventHandler().handle(event); }