org.apache.hadoop.yarn.event
Class AsyncDispatcher

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.event.AsyncDispatcher
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service, Dispatcher

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class AsyncDispatcher
extends org.apache.hadoop.service.AbstractService
implements Dispatcher

Dispatches Events in a separate thread. Currently only single thread does that. Potentially there could be multiple channels for each event type class and a thread pool can be used to dispatch the events.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
protected  Map<Class<? extends Enum>,EventHandler> eventDispatchers
           
 
Fields inherited from interface org.apache.hadoop.yarn.event.Dispatcher
DEFAULT_DISPATCHER_EXIT_ON_ERROR, DISPATCHER_EXIT_ON_ERROR_KEY
 
Constructor Summary
AsyncDispatcher()
           
AsyncDispatcher(BlockingQueue<Event> eventQueue)
           
 
Method Summary
protected  void dispatch(Event event)
           
 EventHandler getEventHandler()
           
 void register(Class<? extends Enum> eventType, EventHandler handler)
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
 void setDrainEventsOnStop()
           
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eventDispatchers

protected final Map<Class<? extends Enum>,EventHandler> eventDispatchers
Constructor Detail

AsyncDispatcher

public AsyncDispatcher()

AsyncDispatcher

public AsyncDispatcher(BlockingQueue<Event> eventQueue)
Method Detail

serviceInit

protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                    throws Exception
Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStart

protected void serviceStart()
                     throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

setDrainEventsOnStop

public void setDrainEventsOnStop()

serviceStop

protected void serviceStop()
                    throws Exception
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
Exception

dispatch

protected void dispatch(Event event)

register

public void register(Class<? extends Enum> eventType,
                     EventHandler handler)
Specified by:
register in interface Dispatcher

getEventHandler

public EventHandler getEventHandler()
Specified by:
getEventHandler in interface Dispatcher


Copyright © 2014 Apache Software Foundation. All Rights Reserved.