Class DiskManagerPieceImpl

    • Field Detail

      • PIECE_STATUS2_MERGE_READ

        private static final byte PIECE_STATUS2_MERGE_READ
        See Also:
        Constant Field Values
      • PIECE_STATUS2_MERGE_WRITE

        private static final byte PIECE_STATUS2_MERGE_WRITE
        See Also:
        Constant Field Values
      • PIECE_STATUS_MASK_DOWNLOADABLE

        private static final byte PIECE_STATUS_MASK_DOWNLOADABLE
        See Also:
        Constant Field Values
      • PIECE_STATUS_MASK_NEEDS_CHECK

        private static final byte PIECE_STATUS_MASK_NEEDS_CHECK
        See Also:
        Constant Field Values
      • 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 Detail

      • DiskManagerPieceImpl

        public DiskManagerPieceImpl​(DiskManagerHelper _disk_manager,
                                    int pieceIndex,
                                    int length)