java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, Dispatcherpublic class MultiDispatcher extends org.apache.hadoop.service.AbstractService implements Dispatcher
Events in a parallel thread.
The Dispatcher.getEventHandler() method can be used to post an event to the dispatcher.
The posted event will be separated based on the hashcode of the Event.getLockKey().
If the getLockKey() method returns with null,
then the first executor thread will be used as default worker
The MultiDispatcherConfig contains the information,
how many thread will be used, for parallel execution.
The MultiDispatcherExecutor contains the worker threads, which handle the events.
The MultiDispatcherLibrary contains the information,
how to pair event types with EventHandlers
The Dispatcher provides metric data using the DispatcherEventMetricsImpl.| Constructor | Description |
|---|---|
MultiDispatcher(java.lang.String dispatcherName) |
| Modifier and Type | Method | Description |
|---|---|---|
EventHandler |
getEventHandler() |
|
void |
register(java.lang.Class<? extends java.lang.Enum> eventType,
EventHandler handler) |
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
|
protected void |
serviceStop() |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceStart, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStop()
throws java.lang.Exception
serviceStop in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic EventHandler getEventHandler()
getEventHandler in interface Dispatcherpublic void register(java.lang.Class<? extends java.lang.Enum> eventType,
EventHandler handler)
register in interface DispatcherCopyright © 2008–2025 Apache Software Foundation. All rights reserved.