RetryingBlockFetcher is…​FIXME

RetryingBlockFetcher is created and immediately started when:

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):

Retrying fetch ([retryCount]/[maxRetries]) for [size] outstanding blocks after [retryWaitTime] ms

RetryingBlockFetcher uses a RetryingBlockFetchListener to remove block IDs from the outstandingBlocksIds internal registry.

Creating RetryingBlockFetcher Instance

RetryingBlockFetcher takes the following when created:

Starting RetryingBlockFetcher — start Method

void start()

start simply fetchAllOutstanding.

start is used when:

initiateRetry Internal Method

synchronized void initiateRetry()


initiateRetry is used when:

fetchAllOutstanding Internal Method

void fetchAllOutstanding()

fetchAllOutstanding requests BlockFetchStarter to createAndStart for the outstandingBlocksIds.

fetchAllOutstanding is used when RetryingBlockFetcher is requested to start and initiateRetry.


RetryingBlockFetchListener is a BlockFetchingListener that RetryingBlockFetcher uses to remove block IDs from the outstandingBlocksIds internal registry.

onBlockFetchSuccess Method

void onBlockFetchSuccess(String blockId, ManagedBuffer data)
onBlockFetchSuccess is part of BlockFetchingListener Contract.


onBlockFetchFailure Method

void onBlockFetchFailure(String blockId, Throwable exception)
onBlockFetchFailure is part of BlockFetchingListener Contract.