public class SplitFileInserterSegmentBlockChooser extends SimpleBlockChooser
maxRetries| Constructor and Description |
|---|
SplitFileInserterSegmentBlockChooser(SplitFileInserterSegmentStorage segment,
int blocks,
java.util.Random random,
int maxRetries,
KeysFetchingLocally keysFetching,
int consecutiveRNFsCountAsSuccess) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkValid(int chosen)
Is the proposed block valid? Override to implement custom logic e.g.
|
protected int |
getMaxBlockNumber()
Can be overridden to restrict chooseKey() to a subset of the available blocks.
|
protected void |
onCompletedAll() |
void |
onRNF(int blockNo)
Handle an RNF if the n-consecutive-RNFs-count-as-success hack is enabled.
|
boolean |
pushRNFs(int blockNo)
Count the previous RNFs towards the retry limit, when the following error wasn't an RNF.
|
void |
read(java.io.DataInputStream dis) |
void |
write(java.io.DataOutputStream dos)
Write everything
|
chooseKey, copyDownloadedBlocks, countFailedBlocks, countFetchable, getBlockNumber, getRetries, hasSucceeded, hasSucceededAll, innerOnNonFatalFailure, onNonFatalFailure, onSuccess, onUnSuccess, readRetries, replaceSuccesses, successCount, writeRetriespublic SplitFileInserterSegmentBlockChooser(SplitFileInserterSegmentStorage segment, int blocks, java.util.Random random, int maxRetries, KeysFetchingLocally keysFetching, int consecutiveRNFsCountAsSuccess)
protected int getMaxBlockNumber()
SimpleBlockChoosergetMaxBlockNumber in class SimpleBlockChooserprotected void onCompletedAll()
onCompletedAll in class SimpleBlockChooserprotected boolean checkValid(int chosen)
SimpleBlockChoosercheckValid in class SimpleBlockChooserpublic void onRNF(int blockNo)
public boolean pushRNFs(int blockNo)
public void write(java.io.DataOutputStream dos)
throws java.io.IOException
SimpleBlockChooserwrite in class SimpleBlockChooserjava.io.IOExceptionpublic void read(java.io.DataInputStream dis)
throws java.io.IOException,
StorageFormatException
read in class SimpleBlockChooserjava.io.IOExceptionStorageFormatException