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, writeRetries
public SplitFileInserterSegmentBlockChooser(SplitFileInserterSegmentStorage segment, int blocks, java.util.Random random, int maxRetries, KeysFetchingLocally keysFetching, int consecutiveRNFsCountAsSuccess)
protected int getMaxBlockNumber()
SimpleBlockChooser
getMaxBlockNumber
in class SimpleBlockChooser
protected void onCompletedAll()
onCompletedAll
in class SimpleBlockChooser
protected boolean checkValid(int chosen)
SimpleBlockChooser
checkValid
in class SimpleBlockChooser
public void onRNF(int blockNo)
public boolean pushRNFs(int blockNo)
public void write(java.io.DataOutputStream dos) throws java.io.IOException
SimpleBlockChooser
write
in class SimpleBlockChooser
java.io.IOException
public void read(java.io.DataInputStream dis) throws java.io.IOException, StorageFormatException
read
in class SimpleBlockChooser
java.io.IOException
StorageFormatException