Class DiskManagerPieceImpl

java.lang.Object
com.biglybt.core.disk.impl.DiskManagerPieceImpl
All Implemented Interfaces:
DiskManagerPiece

public class DiskManagerPieceImpl extends Object implements DiskManagerPiece
  • Field Details

    • PIECE_STATUS_NEEDED

      private static final byte PIECE_STATUS_NEEDED
      See Also:
    • PIECE_STATUS_WRITTEN

      private static final byte PIECE_STATUS_WRITTEN
      See Also:
    • PIECE_STATUS_CHECKING

      private static final byte PIECE_STATUS_CHECKING
      See Also:
    • PIECE_STATUS2_MERGE_READ

      private static final byte PIECE_STATUS2_MERGE_READ
      See Also:
    • PIECE_STATUS2_MERGE_WRITE

      private static final byte PIECE_STATUS2_MERGE_WRITE
      See Also:
    • PIECE_STATUS_MASK_DOWNLOADABLE

      private static final byte PIECE_STATUS_MASK_DOWNLOADABLE
      See Also:
    • PIECE_STATUS_MASK_NEEDS_CHECK

      private static final byte PIECE_STATUS_MASK_NEEDS_CHECK
      See Also:
    • diskManager

      private final DiskManagerHelper diskManager
    • pieceNumber

      private final int pieceNumber
    • nbBlocks

      private final short nbBlocks
      the number of blocks in this piece: can be short as this gives up to .5GB piece sizes with 16K blocks
    • written

      protected volatile boolean[] written
    • statusFlags

      private byte statusFlags
    • statusFlags2

      private byte statusFlags2
    • read_count

      private short read_count
      it's *very* important to accurately maintain the "done" state of a piece. Currently the statusFlags are updated in a non-thread-safe manner so a 'done' field is maintained separately. Synchronizing access to statusFlags or done would cause a tremendous performance hit.
    • done

      private boolean done
  • Constructor Details

    • DiskManagerPieceImpl

      public DiskManagerPieceImpl(DiskManagerHelper _disk_manager, int pieceIndex, int length)
  • Method Details