class TransportContext extends Closeable
Contains the context to create a TransportServer, TransportClientFactory, and to
setup Netty Channel pipelines with a
org.apache.spark.network.server.TransportChannelHandler.
There are two communication protocols that the TransportClient provides, control-plane RPCs and data-plane "chunk fetching". The handling of the RPCs is performed outside of the scope of the TransportContext (i.e., by a user-provided handler), and it is responsible for setting up streams which can be streamed through the data plane in chunks using zero-copy IO.
The TransportServer and TransportClientFactory both create a TransportChannelHandler for each channel. As each TransportChannelHandler contains a TransportClient, this enables server processes to send messages back to the client on an existing channel.
- Alphabetic
- By Inheritance
- TransportContext
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TransportContext(conf: TransportConf, rpcHandler: RpcHandler, closeIdleConnections: Boolean, isClientOnly: Boolean)
Enables TransportContext initialization for underlying client and server.
Enables TransportContext initialization for underlying client and server.
- conf
TransportConf
- rpcHandler
RpcHandler responsible for handling requests and responses.
- closeIdleConnections
Close idle connections if it is set to true.
- isClientOnly
This config indicates the TransportContext is only used by a client. This config is more important when external shuffle is enabled. It stops creating extra event loop and subsequent thread pool for shuffle clients to handle chunked fetch requests.
- new TransportContext(conf: TransportConf, rpcHandler: RpcHandler, closeIdleConnections: Boolean)
- new TransportContext(conf: TransportConf, rpcHandler: RpcHandler)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
- Definition Classes
- TransportContext → Closeable → AutoCloseable
- def createClientFactory(): TransportClientFactory
- def createClientFactory(bootstraps: List[TransportClientBootstrap]): TransportClientFactory
Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning a new Client.
Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning a new Client. Bootstraps will be executed synchronously, and must run successfully in order to create a Client.
- def createServer(): TransportServer
- def createServer(bootstraps: List[TransportServerBootstrap]): TransportServer
Creates a new server, binding to any available ephemeral port.
- def createServer(host: String, port: Int, bootstraps: List[TransportServerBootstrap]): TransportServer
Create a server which will attempt to bind to a specific host and port.
- def createServer(port: Int, bootstraps: List[TransportServerBootstrap]): TransportServer
Create a server which will attempt to bind to a specific port.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getConf(): TransportConf
- def getRegisteredConnections(): Counter
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initializePipeline(channel: SocketChannel, channelRpcHandler: RpcHandler): TransportChannelHandler
Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and has a
org.apache.spark.network.server.TransportChannelHandlerto handle request or response messages.Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and has a
org.apache.spark.network.server.TransportChannelHandlerto handle request or response messages.- channel
The channel to initialize.
- channelRpcHandler
The RPC handler to use for the channel.
- returns
Returns the created TransportChannelHandler, which includes a TransportClient that can be used to communicate on this channel. The TransportClient is directly associated with a ChannelHandler to ensure all users of the same channel get the same TransportClient object.
- def initializePipeline(channel: SocketChannel): TransportChannelHandler
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()