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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
package org.apache.spark.network abstract class BlockTransferService extends ShuffleClient { // only required methods that have no implementation // the others follow def init(blockDataManager: BlockDataManager): Unit def close(): Unit def port: Int def hostName: String def fetchBlocks( host: String, port: Int, execId: String, blockIds: Array[String], listener: BlockFetchingListener, tempFileManager: TempFileManager): Unit def uploadBlock( hostname: String, port: Int, execId: String, blockId: BlockId, blockData: ManagedBuffer, level: StorageLevel, classTag: ClassTag[_]): Future[Unit] } |
Note
|
BlockTransferService is a private[spark] contract.
|
Method | Description | ||
---|---|---|---|
|
Used when…FIXME |
||
|
Used when…FIXME |
||
|
Used when…FIXME |
||
|
Used when…FIXME |
||
|
Used exclusively when
|
||
|
Used exclusively when |
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
1 2 3 4 5 6 7 8 9 10 |
fetchBlockSync( host: String, port: Int, execId: String, blockId: String, tempFileManager: TempFileManager): ManagedBuffer |
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
1 2 3 4 5 6 7 8 9 10 11 12 |
uploadBlockSync( hostname: String, port: Int, execId: String, blockId: BlockId, blockData: ManagedBuffer, level: StorageLevel, classTag: ClassTag[_]): Unit |
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).
|