TransportContext is used to create a server or ClientFactory.

Creating Instance

TransportContext takes the following to be created:

TransportContext is created when:

createClientFactory Method

TransportClientFactory createClientFactory(
  List<TransportClientBootstrap> bootstraps)


createClientFactory is used when TransportContext is requested to initializePipeline.

createChannelHandler Method

TransportChannelHandler createChannelHandler(
  Channel channel,
  RpcHandler rpcHandler)


createChannelHandler is used when TransportContext is requested to initializePipeline.

initializePipeline Method

TransportChannelHandler initializePipeline(
  SocketChannel channel) (1)
TransportChannelHandler initializePipeline(
  SocketChannel channel,
  RpcHandler channelRpcHandler)
1 Uses the RpcHandler


initializePipeline is used when:

  • TransportServer is requested to init

  • TransportClientFactory is requested to createClient

Creating Server

TransportServer createServer()
TransportServer createServer(
  int port,
  List<TransportServerBootstrap> bootstraps)
TransportServer createServer(
  List<TransportServerBootstrap> bootstraps)
TransportServer createServer(
  String host,
  int port,
  List<TransportServerBootstrap> bootstraps)

createServer simply creates a TransportServer (with the current TransportContext, the host, the port, the RpcHandler and the bootstraps).

createServer is used when:

  • NettyBlockTransferService is requested to createServer

  • NettyRpcEnv is requested to startServer

  • ExternalShuffleService is requested to start

  • Spark on YARN’s YarnShuffleService is requested to serviceInit