public abstract class FailureSummaryAppenderListener<Event extends DeferredProcessingAware> extends Object implements TcpAppenderListener<Event>
TcpAppenderListener that invokes different callbacks for
the first successful append/send/connect after a series of failures.
The callback includes a summary of the failures that occurred.
Subclasses implement handleFailureSummary(FailureSummary, CallbackType)
to define behavior when the first successful append/send/connect
occurs after a series of consecutive failures.
| Modifier and Type | Class and Description |
|---|---|
static class |
FailureSummaryAppenderListener.CallbackType
The type of listener callback.
|
static interface |
FailureSummaryAppenderListener.FailureSummary
Summary details of consecutive failures
|
| Constructor and Description |
|---|
FailureSummaryAppenderListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
appenderStarted(Appender<Event> appender)
Called when the given appender is started.
|
void |
appenderStopped(Appender<Event> appender)
Called when the given appender is stopped.
|
void |
connectionClosed(Appender<Event> appender,
Socket socket)
Called after the given appender closes the given socket
(either due to a reconnect, or shutdown)
|
void |
connectionFailed(Appender<Event> appender,
InetSocketAddress address,
Throwable reason)
Called after the given appender fails to open a socket
|
void |
connectionOpened(Appender<Event> appender,
Socket socket)
Called after the given appender successfully opens the given socket
|
void |
eventAppended(Appender<Event> appender,
Event event,
long durationInNanos)
Called when the given event was successfully appended by the given appender.
|
void |
eventAppendFailed(Appender<Event> appender,
Event event,
Throwable reason)
Called when the given event was failed to be appended by the given appender.
|
void |
eventSendFailure(Appender<Event> appender,
Event event,
Throwable reason)
Called when the given appender fails to send the given event over a TCP connection.
|
void |
eventSent(Appender<Event> appender,
Socket socket,
Event event,
long durationInNanos)
Called after given appender successfully sent the given event over the TCP connection.
|
protected abstract void |
handleFailureSummary(FailureSummaryAppenderListener.FailureSummary failureSummary,
FailureSummaryAppenderListener.CallbackType callbackType)
Called after the first success after the a series of consecutive failures.
|
public void appenderStarted(Appender<Event> appender)
AppenderListenerappenderStarted in interface AppenderListener<Event extends DeferredProcessingAware>appender - the appender that was startedpublic void appenderStopped(Appender<Event> appender)
AppenderListenerappenderStopped in interface AppenderListener<Event extends DeferredProcessingAware>appender - the appender that was stoppedpublic void eventAppended(Appender<Event> appender, Event event, long durationInNanos)
AppenderListenereventAppended in interface AppenderListener<Event extends DeferredProcessingAware>appender - the appender when successfully appended the eventevent - the event that was appendeddurationInNanos - the time (in nanoseconds) it took to append the eventpublic void eventAppendFailed(Appender<Event> appender, Event event, Throwable reason)
AppenderListenereventAppendFailed in interface AppenderListener<Event extends DeferredProcessingAware>appender - the appender when successfully appended the eventevent - the event that was appendedreason - what caused the failurepublic void eventSent(Appender<Event> appender, Socket socket, Event event, long durationInNanos)
TcpAppenderListenereventSent in interface TcpAppenderListener<Event extends DeferredProcessingAware>appender - the appender that sent the eventsocket - the socket over which the appender sent the eventevent - the event that was sentdurationInNanos - the time (in nanoseconds) it took to send the eventpublic void eventSendFailure(Appender<Event> appender, Event event, Throwable reason)
TcpAppenderListenereventSendFailure in interface TcpAppenderListener<Event extends DeferredProcessingAware>appender - the appender that attempted to send the eventevent - the event that failed to sendreason - what caused the failurepublic void connectionOpened(Appender<Event> appender, Socket socket)
TcpAppenderListenerconnectionOpened in interface TcpAppenderListener<Event extends DeferredProcessingAware>appender - the appender that opened the socketsocket - the socket that was openedpublic void connectionFailed(Appender<Event> appender, InetSocketAddress address, Throwable reason)
TcpAppenderListenerconnectionFailed in interface TcpAppenderListener<Event extends DeferredProcessingAware>appender - the appender that attempted to open a socketaddress - the address to which the appender attempted to connectreason - what caused the failurepublic void connectionClosed(Appender<Event> appender, Socket socket)
TcpAppenderListenerconnectionClosed in interface TcpAppenderListener<Event extends DeferredProcessingAware>appender - the appender that closed the socketsocket - the socket that was closedprotected abstract void handleFailureSummary(FailureSummaryAppenderListener.FailureSummary failureSummary, FailureSummaryAppenderListener.CallbackType callbackType)
failureSummary - contains summary details of all the consecutive failurescallbackType - the type of callback (append/send/connect)Copyright © 2020. All rights reserved.