Class RDResumeHandler


  • public class RDResumeHandler
    extends java.lang.Object
    • Field Detail

      • LOGID

        private static final LogIDs LOGID
      • TEST_RECHECK_FAILURE_HANDLING

        private static final boolean TEST_RECHECK_FAILURE_HANDLING
        See Also:
        Constant Field Values
      • PIECE_RECHECK_REQUIRED

        public static final byte PIECE_RECHECK_REQUIRED
        See Also:
        Constant Field Values
      • use_fast_resume

        static boolean use_fast_resume
      • use_fast_resume_recheck_all

        static boolean use_fast_resume_recheck_all
      • skip_comp_dl_file_checks

        static boolean skip_comp_dl_file_checks
      • started

        private volatile boolean started
      • stopped

        private volatile boolean stopped
      • stopped_for_close

        private volatile boolean stopped_for_close
      • check_in_progress

        private volatile boolean check_in_progress
      • check_resume_was_valid

        private volatile boolean check_resume_was_valid
      • check_is_full_check

        private volatile boolean check_is_full_check
      • check_interrupted

        private volatile boolean check_interrupted
      • check_position

        private volatile int check_position
    • Method Detail

      • start

        public void start()
      • stop

        public void stop​(boolean closing)
      • saveResumeData

        public void saveResumeData​(boolean interim_save)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getResumeData

        private java.util.Map getResumeData()
      • saveResumeData

        private void saveResumeData​(java.util.Map resume_data)
      • getResumeData

        protected static java.util.Map getResumeData​(DownloadManager download_manager)
      • getResumeData

        protected static java.util.Map getResumeData​(DownloadManagerState download_manager_state)
      • saveResumeData

        private static void saveResumeData​(DownloadManagerState download_manager_state,
                                           java.util.Map resume_data)
      • setTorrentResumeDataComplete

        public static void setTorrentResumeDataComplete​(DownloadManagerState download_manager_state)
      • clearResumeDataSupport

        private static int clearResumeDataSupport​(DownloadManager download_manager,
                                                  DiskManagerFileInfo file,
                                                  boolean recheck,
                                                  boolean onlyClearUnsharedFirstLast)
      • findFirstFileWithPieceN

        private static int findFirstFileWithPieceN​(int firstPiece,
                                                   DiskManagerFileInfo[] files)
        finds the first affected file via binary search, this is necessary as some methods might be invoked for all files, which would result in O(n²) if we'd scan the whole file array every time
      • setTorrentResumeDataNearlyComplete

        public static void setTorrentResumeDataNearlyComplete​(DownloadManagerState download_manager_state)
      • isTorrentResumeDataComplete

        public static boolean isTorrentResumeDataComplete​(DownloadManagerState dms)
      • isTorrentResumeDataComplete

        private static boolean isTorrentResumeDataComplete​(int piece_count,
                                                           java.util.Map resume_data)