getBlockData(blockId: BlockId): ManagedBuffer
BlockDataManager - Block Storage Management API
BlockDataManager
is a pluggable interface to manage storage for blocks (aka block storage management API). Blocks are identified by BlockId and stored as ManagedBuffer.
Note
|
BlockManager is currently the only available implementation of BlockDataManager .
|
Note
|
org.apache.spark.network.BlockDataManager is a private[spark] Scala trait in Spark.
|
BlockDataManager Contract
Every BlockDataManager
offers the following services:
-
getBlockData
to fetch a local block data byblockId
. -
putBlockData
to upload a block data locally byblockId
. The return value says whether the operation has succeeded (true
) or failed (false
).putBlockData( blockId: BlockId, data: ManagedBuffer, level: StorageLevel, classTag: ClassTag[_]): Boolean
-
releaseLock
is a release lock forgetBlockData
andputBlockData
operations.releaseLock(blockId: BlockId): Unit
BlockId
BlockId
identifies a block of data. It has a globally unique identifier (name
)
There are the following types of BlockId
:
-
RDDBlockId - described by
rddId
andsplitIndex
-
ShuffleBlockId - described by
shuffleId
,mapId
andreduceId
-
ShuffleDataBlockId - described by
shuffleId
,mapId
andreduceId
-
ShuffleIndexBlockId - described by
shuffleId
,mapId
andreduceId
-
BroadcastBlockId - described by
broadcastId
and optionalfield
- a piece of broadcast value -
TaskResultBlockId - described by
taskId
-
StreamBlockId - described by
streamId
anduniqueId
BroadcastBlockId
BroadcastBlockId
is an BlockId with a long
identifier and an optional field
.