Class GridNioTracerFilter
- java.lang.Object
-
- org.apache.ignite.internal.util.nio.GridNioFilterAdapter
-
- org.apache.ignite.internal.util.nio.GridNioTracerFilter
-
- All Implemented Interfaces:
GridNioFilter
public class GridNioTracerFilter extends GridNioFilterAdapter
Filter that inject and extract tracing span from/to process.
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.util.nio.GridNioFilterAdapter
nextFilter, prevFilter
-
-
Constructor Summary
Constructors Constructor Description GridNioTracerFilter(IgniteLogger log, Tracing tracer)Creates a tracer filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonExceptionCaught(GridNioSession ses, IgniteCheckedException ex)Invoked when exception is caught in filter processing.voidonMessageReceived(GridNioSession ses, Object msg)Invoked when a new messages received.GridNioFuture<Boolean>onSessionClose(GridNioSession ses)Invoked when a session close request is performed on session.voidonSessionClosed(GridNioSession ses)Invoked after session get closed.voidonSessionIdleTimeout(GridNioSession ses)Called when session is idle for longer time that is allowed by NIO server.voidonSessionOpened(GridNioSession ses)Invoked when a new session was created.GridNioFuture<?>onSessionWrite(GridNioSession ses, Object msg, boolean fut, IgniteInClosure<IgniteException> ackC)Invoked when a write request is performed on a session.voidonSessionWriteTimeout(GridNioSession ses)Called when session has not empty write buffer that has not been fully flushed during max timeout allowed by NIO server.StringtoString()-
Methods inherited from class org.apache.ignite.internal.util.nio.GridNioFilterAdapter
nextFilter, nextFilter, onPauseReads, onResumeReads, previousFilter, previousFilter, proceedExceptionCaught, proceedMessageReceived, proceedPauseReads, proceedResumeReads, proceedSessionClose, proceedSessionClosed, proceedSessionIdleTimeout, proceedSessionOpened, proceedSessionWrite, proceedSessionWriteTimeout, start, stop
-
-
-
-
Constructor Detail
-
GridNioTracerFilter
public GridNioTracerFilter(IgniteLogger log, Tracing tracer)
Creates a tracer filter.- Parameters:
log- Log instance to use.tracer- Tracing processor.
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toStringin classGridNioFilterAdapter
-
onSessionOpened
public void onSessionOpened(GridNioSession ses) throws IgniteCheckedException
Invoked when a new session was created.- Parameters:
ses- Opened session.- Throws:
IgniteCheckedException- If GridNioException occurred while handling event.
-
onSessionClosed
public void onSessionClosed(GridNioSession ses) throws IgniteCheckedException
Invoked after session get closed.- Parameters:
ses- Closed session.- Throws:
IgniteCheckedException- If GridNioException occurred while handling event.
-
onExceptionCaught
public void onExceptionCaught(GridNioSession ses, IgniteCheckedException ex) throws IgniteCheckedException
Invoked when exception is caught in filter processing.- Parameters:
ses- Session that caused IgniteCheckedException.ex- GridNioException instance.- Throws:
IgniteCheckedException- If IgniteCheckedException occurred while handling event.
-
onSessionWrite
public GridNioFuture<?> onSessionWrite(GridNioSession ses, Object msg, boolean fut, IgniteInClosure<IgniteException> ackC) throws IgniteCheckedException
Invoked when a write request is performed on a session.- Parameters:
ses- Session on which message should be written.msg- Message being written.fut-Trueif write future should be created.ackC- Closure invoked when message ACK is received.- Returns:
- Write future or
null. - Throws:
GridNioException- If GridNioException occurred while handling event.IgniteCheckedException
-
onMessageReceived
public void onMessageReceived(GridNioSession ses, Object msg) throws IgniteCheckedException
Invoked when a new messages received.- Parameters:
ses- Session on which message was received.msg- Received message.- Throws:
IgniteCheckedException- If IgniteCheckedException occurred while handling event.
-
onSessionClose
public GridNioFuture<Boolean> onSessionClose(GridNioSession ses) throws IgniteCheckedException
Invoked when a session close request is performed on session.- Parameters:
ses- Session to close.- Returns:
- Close future.
- Throws:
IgniteCheckedException- If IgniteCheckedException occurred while handling event.
-
onSessionIdleTimeout
public void onSessionIdleTimeout(GridNioSession ses) throws IgniteCheckedException
Called when session is idle for longer time that is allowed by NIO server.- Parameters:
ses- Session that is idle.- Throws:
IgniteCheckedException- If filter is not in chain or GridNioException occurred in the underlying filter.
-
onSessionWriteTimeout
public void onSessionWriteTimeout(GridNioSession ses) throws IgniteCheckedException
Called when session has not empty write buffer that has not been fully flushed during max timeout allowed by NIO server.- Parameters:
ses- Session that has timed out writes.- Throws:
IgniteCheckedException- If filter is not in chain or GridNioException occurred in the underlying filter.
-
-