@ThreadSafe public final class BlockManagerWorker extends Object
Modifier and Type | Method and Description |
---|---|
void |
commitBlock(String blockId,
DataStoreProperty.Value blockStore,
List<Long> partitionSizeInfo,
String srcIRVertexId,
int expectedReadTotal,
UsedDataHandlingProperty.Value usedDataHandling)
Notifies that all writes for a block is end.
|
void |
createBlock(String blockId,
DataStoreProperty.Value blockStore)
Creates a new block.
|
void |
onPullRequest(BlockOutputStream<?> outputStream)
Respond to a pull request by another executor.
|
void |
onPushNotification(BlockInputStream inputStream)
Respond to a push notification by another executor.
|
Optional<List<Long>> |
putPartitions(String blockId,
Iterable<Partition> partitions,
DataStoreProperty.Value blockStore)
Store an iterable of data partitions to a block in the target
BlockStore . |
CompletableFuture<Iterator> |
queryBlock(String blockId,
String runtimeEdgeId,
DataStoreProperty.Value blockStore,
KeyRange keyRange)
Inquiries the location of the specific block and routes the request to the local block manager worker
or to the lower data plane.
|
void |
removeBlock(String blockId,
DataStoreProperty.Value blockStore)
Remove the block from store.
|
public void createBlock(String blockId, DataStoreProperty.Value blockStore)
blockId
- the ID of the block to create.blockStore
- the store to place the block.public CompletableFuture<Iterator> queryBlock(String blockId, String runtimeEdgeId, DataStoreProperty.Value blockStore, KeyRange keyRange)
blockId
- of the block.runtimeEdgeId
- id of the runtime edge that corresponds to the block.blockStore
- for the data storage.keyRange
- the key range descriptorCompletableFuture
of the block.public Optional<List<Long>> putPartitions(String blockId, Iterable<Partition> partitions, DataStoreProperty.Value blockStore)
BlockStore
.
Invariant: This should not be invoked after a block is committed.
Invariant: This method may not support concurrent write for a single block.
Only one thread have to write at once.blockId
- of the block.partitions
- to save to a block.blockStore
- to store the block.Optional
of the size of each written block.public void commitBlock(String blockId, DataStoreProperty.Value blockStore, List<Long> partitionSizeInfo, String srcIRVertexId, int expectedReadTotal, UsedDataHandlingProperty.Value usedDataHandling)
blockId
- the ID of the block.blockStore
- the store to save the block.partitionSizeInfo
- the size metric of partitions.srcIRVertexId
- the IR vertex ID of the source task.expectedReadTotal
- the expected number of read for this block.usedDataHandling
- how to handle the used block.public void removeBlock(String blockId, DataStoreProperty.Value blockStore)
blockId
- the ID of the block to remove.blockStore
- the store which contains the block.public void onPullRequest(BlockOutputStream<?> outputStream)
This method is executed by {edu.snu.coral.runtime.executor.data.blocktransfer.BlockTransport} thread. \ Never execute a blocking call in this method!
outputStream
- BlockOutputStream
public void onPushNotification(BlockInputStream inputStream)
A push notification is generated when a remote executor invokes .blocktransfer.BlockTransfer#initiatePush(String, boolean, String, String, HashRange)
to transfer
a block to another executor.
This method is executed by {edu.snu.coral.runtime.executor.data.blocktransfer.BlockTransport} thread. Never execute a blocking call in this method!
inputStream
- BlockInputStream
Copyright © 2018. All rights reserved.