NettyBlockTransferService uses the TransportConf for the following:
NettyBlockTransferService uses the TransportClientFactory for the following:
shuffleMetrics is part of the ShuffleClient abstraction.
fetchBlocks( host: String, port: Int, execId: String, blockIds: Array[String], listener: BlockFetchingListener): Unit
When executed, fetchBlocks prints out the following TRACE message in the logs:
TRACE Fetch blocks from [host]:[port] (executor id [execId])
fetchBlocks then creates a
Depending on the maximum number of acceptable IO exceptions (such as connection timeouts) per request, if the number is greater than
0, fetchBlocks creates a RetryingBlockFetcher and starts it immediately.
If however the number of retries is not greater than
0 (it could be
0 or less), the
RetryingBlockFetcher.BlockFetchStarter created earlier is started (with the input
In case of any
Exception, you should see the following ERROR message in the logs and the input
BlockFetchingListener gets notified (using
onBlockFetchFailure for every block id).
ERROR Exception while beginning fetchBlocks
fetchBlocks is part of BlockTransferService abstraction.
close is part of the BlockTransferService abstraction.
init( blockDataManager: BlockDataManager): Unit
init creates the internal
clientFactory and a server.
|FIXME What’s the "a server"?|
In the end, you should see the INFO message in the logs:
Server created on [hostName]:[port]
init is part of the BlockTransferService abstraction.
uploadBlock( hostname: String, port: Int, execId: String, blockId: BlockId, blockData: ManagedBuffer, level: StorageLevel, classTag: ClassTag[_]): Future[Unit]
Internally, uploadBlock creates a
TransportClient client to send a
UploadBlock message (to the input
UploadBlock message holds the application id, the input
blockId. It also holds the serialized bytes for block metadata with
classTag serialized (using the internal
JavaSerializer) as well as the serialized bytes for the input
blockData itself (this time however the serialization uses
UploadBlock message is further serialized before sending (using
blockId block was successfully uploaded, you should see the following TRACE message in the logs:
TRACE NettyBlockTransferService: Successfully uploaded block [blockId]
When an upload failed, you should see the following ERROR message in the logs:
ERROR Error while uploading block [blockId]
uploadBlock is part of the BlockTransferService abstraction.
The application id (the block belongs to)
The executor id
The block id
The block data as an array of bytes
UploadBlock can calculate the encoded size and do encoding and decoding itself to or from a
createServer( bootstraps: List[TransportServerBootstrap]): TransportServer
createServer is used when NettyBlockTransferService is requested to initialize.
ALL logging level for
org.apache.spark.network.netty.NettyBlockTransferService logger to see what happens inside.
Add the following line to
Refer to Logging.