关注 spark技术分享,
撸spark源码 玩spark最佳实践

BlockTransferService — Pluggable Block Transfers (To Fetch and Upload Blocks)

BlockTransferService — Pluggable Block Transfers (To Fetch and Upload Blocks)

BlockTransferService is the base for ShuffleClients that can fetch and upload blocks of data synchronously or asynchronously.

Note
BlockTransferService is a private[spark] contract.
Table 1. (Subset of) BlockTransferService Contract
Method Description

init

Used when…​FIXME

close

Used when…​FIXME

port

Used when…​FIXME

hostName

Used when…​FIXME

fetchBlocks

Fetches a sequence of blocks from a remote node asynchronously

Used exclusively when BlockTransferService is requested to fetch only one block (in a blocking fashion)

Note
fetchBlocks is part of ShuffleClient Contract to…​FIXME.

uploadBlock

Used exclusively when BlockTransferService is requested to upload a single block to a remote node (in a blocking fashion).

Note
NettyBlockTransferService is the one and only known implementation of BlockTransferService Contract.
Note
BlockTransferService was introduced in SPARK-3019 Pluggable block transfer interface (BlockTransferService) and is available since Spark 1.2.0.

fetchBlockSync Method

fetchBlockSync…​FIXME

Synchronous (and hence blocking) fetchBlockSync to fetch one block blockId (that corresponds to the ShuffleClient parent’s asynchronous fetchBlocks).

fetchBlockSync is a mere wrapper around fetchBlocks to fetch one blockId block that waits until the fetch finishes.

Note
fetchBlockSync is used when…​FIXME

Uploading Single Block to Remote Node (Blocking Fashion) — uploadBlockSync Method

uploadBlockSync…​FIXME

uploadBlockSync is a mere blocking wrapper around uploadBlock that waits until the upload finishes.

Note
uploadBlockSync is used exclusively when BlockManager is requested to replicate (when a replication level is greater than 1).
赞(0) 打赏
未经允许不得转载:spark技术分享 » BlockTransferService — Pluggable Block Transfers (To Fetch and Upload Blocks)
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏