public class CooldownBlockChooser extends SimpleBlockChooser
maxRetries| Constructor and Description |
|---|
CooldownBlockChooser(int blocks,
java.util.Random random,
int maxRetries,
int cooldownTries,
long cooldownTime) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkValid(int blockNo)
Is the proposed block valid? Override to implement custom logic e.g.
|
int |
chooseKey()
Choose a key to fetch, taking into account retries
|
void |
clearCooldown()
Should be called e.g.
|
long |
getCooldownTime(int blockNumber) |
protected int |
innerOnNonFatalFailure(int blockNo)
Notify when a block has failed.
|
void |
onUnSuccess(int blockNo)
Notify that a block has no longer succeeded.
|
long |
overallCooldownTime() |
copyDownloadedBlocks, countFailedBlocks, countFetchable, getBlockNumber, getMaxBlockNumber, getRetries, hasSucceeded, hasSucceededAll, onCompletedAll, onNonFatalFailure, onSuccess, read, readRetries, replaceSuccesses, successCount, write, writeRetriespublic CooldownBlockChooser(int blocks,
java.util.Random random,
int maxRetries,
int cooldownTries,
long cooldownTime)
public int chooseKey()
SimpleBlockChooserchooseKey in class SimpleBlockChooserprotected boolean checkValid(int blockNo)
SimpleBlockChoosercheckValid in class SimpleBlockChooserprotected int innerOnNonFatalFailure(int blockNo)
SimpleBlockChooserinnerOnNonFatalFailure in class SimpleBlockChooserpublic final void clearCooldown()
public void onUnSuccess(int blockNo)
SimpleBlockChooseronUnSuccess in class SimpleBlockChooserpublic long overallCooldownTime()
public long getCooldownTime(int blockNumber)