Class NettyProtocol


  • public class NettyProtocol
    extends Object
    Defines the server and client channel handlers, i.e. the protocol, used by netty.
    • Method Detail

      • getServerChannelHandlers

        public org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler[] getServerChannelHandlers()
        Returns the server channel handlers.
         +-------------------------------------------------------------------+
         |                        SERVER CHANNEL PIPELINE                    |
         |                                                                   |
         |    +----------+----------+ (3) write  +----------------------+    |
         |    | Queue of queues     +----------->| Message encoder      |    |
         |    +----------+----------+            +-----------+----------+    |
         |              /|\                                 \|/              |
         |               | (2) enqueue                       |               |
         |    +----------+----------+                        |               |
         |    | Request handler     |                        |               |
         |    +----------+----------+                        |               |
         |              /|\                                  |               |
         |               |                                   |               |
         |   +-----------+-----------+                       |               |
         |   | Message+Frame decoder |                       |               |
         |   +-----------+-----------+                       |               |
         |              /|\                                  |               |
         +---------------+-----------------------------------+---------------+
         |               | (1) client request               \|/
         +---------------+-----------------------------------+---------------+
         |               |                                   |               |
         |       [ Socket.read() ]                    [ Socket.write() ]     |
         |                                                                   |
         |  Netty Internal I/O Threads (Transport Implementation)            |
         +-------------------------------------------------------------------+
         
        Returns:
        channel handlers
      • getClientChannelHandlers

        public org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler[] getClientChannelHandlers()
        Returns the client channel handlers.
             +-----------+----------+            +----------------------+
             | Remote input channel |            | request client       |
             +-----------+----------+            +-----------+----------+
                         |                                   | (1) write
         +---------------+-----------------------------------+---------------+
         |               |     CLIENT CHANNEL PIPELINE       |               |
         |               |                                  \|/              |
         |    +----------+----------+            +----------------------+    |
         |    | Request handler     +            | Message encoder      |    |
         |    +----------+----------+            +-----------+----------+    |
         |              /|\                                 \|/              |
         |               |                                   |               |
         |    +----------+------------+                      |               |
         |    | Message+Frame decoder |                      |               |
         |    +----------+------------+                      |               |
         |              /|\                                  |               |
         +---------------+-----------------------------------+---------------+
         |               | (3) server response              \|/ (2) client request
         +---------------+-----------------------------------+---------------+
         |               |                                   |               |
         |       [ Socket.read() ]                    [ Socket.write() ]     |
         |                                                                   |
         |  Netty Internal I/O Threads (Transport Implementation)            |
         +-------------------------------------------------------------------+
         
        Returns:
        channel handlers