public class RarestFirstSelector extends Object implements PieceSelector
Constructor and Description |
---|
RarestFirstSelector() |
Modifier and Type | Method and Description |
---|---|
protected int |
getIterationIdx(int i) |
IntStream |
getNextPieces(BitSet relevantChunks,
PieceStatistics pieceStatistics)
Select pieces based on the chunks which are relevant.
|
static RarestFirstSelector |
randomizedRarest()
Randomized rarest-first selector.
|
static RarestFirstSelector |
rarest()
Regular rarest-first selector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initSelector
public static RarestFirstSelector rarest()
public static RarestFirstSelector randomizedRarest()
public IntStream getNextPieces(BitSet relevantChunks, PieceStatistics pieceStatistics)
PieceSelector
getNextPieces
in interface PieceSelector
relevantChunks
- the relevant chunks to chose (in the peer's completed list,pieceStatistics
- the piece statisticsprotected int getIterationIdx(int i)
Copyright © 2016–2021. All rights reserved.