BlockTransferService is the base for ShuffleClients that can fetch and upload blocks of data synchronously or asynchronously.
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 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(
host: String,
port: Int,
execId: String,
blockId: String,
tempFileManager: TempFileManager): ManagedBufferfetchBlockSync…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
|
uploadBlockSync(
hostname: String,
port: Int,
execId: String,
blockId: BlockId,
blockData: ManagedBuffer,
level: StorageLevel,
classTag: ClassTag[_]): UnituploadBlockSync…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).
|