Skip to content


= BlockDataManager

BlockDataManager is an <> of <> that manage storage for blocks of data (aka block storage management API).

BlockDataManager uses[] to uniquely identify blocks of data and[] to represent them.

BlockDataManager is used to initialize a[].

BlockDataManager is used to create a[].

== [[contract]] Contract

=== [[getBlockData]] getBlockData


getBlockData( blockId: BlockId): ManagedBuffer

Fetches a block data (as a[]) for the given[]

Used when:

  • NettyBlockRpcServer is requested to[handle a OpenBlocks message]

  • ShuffleBlockFetcherIterator is requested to[fetchLocalBlocks]

=== [[putBlockData]] putBlockData

[source, scala]

putBlockData( blockId: BlockId, data: ManagedBuffer, level: StorageLevel, classTag: ClassTag[_]): Boolean

Stores (puts) a block data (as a[]) for the given[]. Returns true when completed successfully or false when failed.

Used when NettyBlockRpcServer is requested to[handle an UploadBlock message]

=== [[putBlockDataAsStream]] putBlockDataAsStream

[source, scala]

putBlockDataAsStream( blockId: BlockId, level: StorageLevel, classTag: ClassTag[_]): StreamCallbackWithID

Stores a block data that will be received as a stream

Used when NettyBlockRpcServer is requested to[receiveStream]

=== [[releaseLock]] releaseLock

[source, scala]

releaseLock( blockId: BlockId, taskAttemptId: Option[Long]): Unit

Releases a lock

Used when:

  • TorrentBroadcast is requested to[releaseLock]

  • BlockManager is requested to[handleLocalReadFailure],[getLocalValues],[getOrElseUpdate],[doPut], and[releaseLockAndDispose]

== [[implementations]] Available BlockDataManagers[] is the default and only known BlockDataManager in Apache Spark.

Last update: 2020-10-06