public interface ListenerBus<L,E>
extends org.apache.spark.internal.Logging
Modifier and Type | Method and Description |
---|---|
void |
addListener(L listener)
Add a listener to listen events.
|
void |
doPostEvent(L listener,
E event)
Post an event to the specified listener.
|
<T extends L> |
findListenersByClass(scala.reflect.ClassTag<T> evidence$1) |
scala.Option<com.codahale.metrics.Timer> |
getTimer(L listener)
Returns a CodaHale metrics Timer for measuring the listener's event processing time.
|
boolean |
isIgnorableException(Throwable e)
Allows bus implementations to prevent error logging for certain exceptions.
|
java.util.List<L> |
listeners() |
void |
postToAll(E event)
Post the event to all registered listeners.
|
E |
redactEvent(E e) |
void |
removeAllListeners()
Remove all listeners and they won't receive any events.
|
void |
removeListener(L listener)
Remove a listener and it won't receive any events.
|
void |
removeListenerOnError(L listener)
This can be overridden by subclasses if there is any extra cleanup to do when removing a
listener.
|
$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitialize
void addListener(L listener)
listener
- (undocumented)void doPostEvent(L listener, E event)
onPostEvent
is guaranteed to be called in the same
thread for all listeners.listener
- (undocumented)event
- (undocumented)<T extends L> scala.collection.Seq<T> findListenersByClass(scala.reflect.ClassTag<T> evidence$1)
scala.Option<com.codahale.metrics.Timer> getTimer(L listener)
listener
- (undocumented)boolean isIgnorableException(Throwable e)
java.util.List<L> listeners()
void postToAll(E event)
postToAll
caller should guarantee calling
postToAll
in the same thread for all events.event
- (undocumented)void removeAllListeners()
void removeListener(L listener)
listener
- (undocumented)void removeListenerOnError(L listener)
listener
- (undocumented)