RetryingBlockFetcher
RetryingBlockFetcher is…FIXME
-
NettyBlockTransferServiceis requested to fetchBlocks (when maxIORetries is greater than0which it is by default) -
ExternalShuffleClientis requested to fetchBlocks (when maxIORetries is greater than0which it is by default)
RetryingBlockFetcher uses a BlockFetchStarter to createAndStart when requested to start and later initiateRetry.
RetryingBlockFetcher uses outstandingBlocksIds internal registry of outstanding block IDs to fetch that is initially the block IDs to fetch when created.
At initiateRetry, RetryingBlockFetcher prints out the following INFO message to the logs (with the number of outstandingBlocksIds):
|
1 2 3 4 5 |
Retrying fetch ([retryCount]/[maxRetries]) for [size] outstanding blocks after [retryWaitTime] ms |
On onBlockFetchSuccess and onBlockFetchFailure, RetryingBlockFetchListener removes the block ID from outstandingBlocksIds.
RetryingBlockFetcher uses a RetryingBlockFetchListener to remove block IDs from the outstandingBlocksIds internal registry.
Starting RetryingBlockFetcher — start Method
|
1 2 3 4 5 |
void start() |
start simply fetchAllOutstanding.
|
Note
|
|
initiateRetry Internal Method
|
1 2 3 4 5 |
synchronized void initiateRetry() |
initiateRetry…FIXME
|
Note
|
|
fetchAllOutstanding Internal Method
|
1 2 3 4 5 |
void fetchAllOutstanding() |
fetchAllOutstanding requests BlockFetchStarter to createAndStart for the outstandingBlocksIds.
|
Note
|
fetchAllOutstanding is used when RetryingBlockFetcher is requested to start and initiateRetry.
|
RetryingBlockFetchListener
RetryingBlockFetchListener is a BlockFetchingListener that RetryingBlockFetcher uses to remove block IDs from the outstandingBlocksIds internal registry.
onBlockFetchSuccess Method
|
1 2 3 4 5 |
void onBlockFetchSuccess(String blockId, ManagedBuffer data) |
|
Note
|
onBlockFetchSuccess is part of BlockFetchingListener Contract to…FIXME.
|
onBlockFetchSuccess…FIXME
onBlockFetchFailure Method
|
1 2 3 4 5 |
void onBlockFetchFailure(String blockId, Throwable exception) |
|
Note
|
onBlockFetchFailure is part of BlockFetchingListener Contract to…FIXME.
|
onBlockFetchFailure…FIXME
spark技术分享