Class FullPieceSelect

  • All Implemented Interfaces:
    IPieceSelector

    public class FullPieceSelect
    extends Object
    implements IPieceSelector
    A Piece selection algorithm which favors completing a started piece over starting a second piece. This selector also favors rarer pieces over highly available ones (as advised by BEP #3).
    Author:
    Johnnei
    • Constructor Detail

      • FullPieceSelect

        public FullPieceSelect​(Torrent torrent)
    • Method Detail

      • getPieceForPeer

        public Optional<Piece> getPieceForPeer​(Peer peer)
        Description copied from interface: IPieceSelector
        Gets the next piece to download
        Specified by:
        getPieceForPeer in interface IPieceSelector
        Returns:
        The piece info of the next piece to download or null if no next piece is available