Class RDResumeHandler
java.lang.Object
com.biglybt.core.disk.impl.resume.RDResumeHandler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private boolean
private boolean
private int
private boolean
(package private) final DMChecker
(package private) final DiskManagerImpl
private static final LogIDs
static final byte
static final byte
static final byte
static final byte
(package private) static boolean
(package private) static boolean
private boolean
private boolean
private boolean
private static final boolean
(package private) static boolean
-
Constructor Summary
ConstructorsConstructorDescriptionRDResumeHandler
(DiskManagerImpl _disk_manager, DMChecker _writer_and_checker) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAllPieces
(boolean newfiles, boolean forceRecheck, Map<DiskManagerFileInfo, Long> file_sizes, RDResumeHandler.ProgressListener listener) static void
clearResumeData
(DownloadManager download_manager, DiskManagerFileInfo file) private static int
clearResumeDataSupport
(DownloadManager download_manager, DiskManagerFileInfo file, boolean recheck, boolean onlyClearUnsharedFirstLast) static boolean
fileMustExist
(DownloadManager download_manager, DiskManagerFileInfo file) Deprecated.Kept for xmwebuistatic boolean
fileMustExist
(DownloadManager download_manager, DiskManagerFileInfoSet fileSet, DiskManagerFileInfo file) 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 timeprivate Map
protected static Map
getResumeData
(DownloadManager download_manager) protected static Map
getResumeData
(DownloadManagerState download_manager_state) boolean
private static boolean
isTorrentResumeDataComplete
(int piece_count, Map resume_data) static boolean
static boolean
static void
recheckFile
(DownloadManager download_manager, DiskManagerFileInfo file) void
saveResumeData
(boolean interim_save) private static void
saveResumeData
(DownloadManagerState download_manager_state, Map resume_data) private void
saveResumeData
(Map resume_data) static void
setTorrentResumeDataComplete
(DownloadManagerState download_manager_state) static void
setTorrentResumeDataNearlyComplete
(DownloadManagerState download_manager_state) static void
setTorrentResumeTotallyIncomplete
(DownloadManagerState download_manager_state) static void
setupPieces
(DownloadManagerState dms, DiskManagerPiece[] pieces) void
start()
void
stop
(boolean closing) static int
storageTypeChanged
(DownloadManager download_manager, DiskManagerFileInfo file)
-
Field Details
-
LOGID
-
TEST_RECHECK_FAILURE_HANDLING
private static final boolean TEST_RECHECK_FAILURE_HANDLING- See Also:
-
PIECE_NOT_DONE
public static final byte PIECE_NOT_DONE- See Also:
-
PIECE_DONE
public static final byte PIECE_DONE- See Also:
-
PIECE_RECHECK_REQUIRED
public static final byte PIECE_RECHECK_REQUIRED- See Also:
-
PIECE_STARTED
public static final byte PIECE_STARTED- See Also:
-
use_fast_resume_recheck_all
static boolean use_fast_resume_recheck_all -
skip_comp_dl_file_checks
static boolean skip_comp_dl_file_checks -
skip_incomp_dl_file_checks
static boolean skip_incomp_dl_file_checks -
disk_manager
-
checker
-
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_cancelled
private volatile boolean check_cancelled -
check_position
private volatile int check_position
-
-
Constructor Details
-
RDResumeHandler
-
-
Method Details
-
start
public void start() -
stop
public void stop(boolean closing) -
checkAllPieces
public void checkAllPieces(boolean newfiles, boolean forceRecheck, Map<DiskManagerFileInfo, Long> file_sizes, RDResumeHandler.ProgressListener listener) -
saveResumeData
- Throws:
Exception
-
getResumeData
-
saveResumeData
-
isCancelled
public boolean isCancelled() -
getResumeData
-
getResumeData
-
saveResumeData
-
setTorrentResumeDataComplete
-
clearResumeDataSupport
private static int clearResumeDataSupport(DownloadManager download_manager, DiskManagerFileInfo file, boolean recheck, boolean onlyClearUnsharedFirstLast) -
findFirstFileWithPieceN
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 -
fileMustExist
Deprecated.Kept for xmwebui -
fileMustExist
public static boolean fileMustExist(DownloadManager download_manager, DiskManagerFileInfoSet fileSet, DiskManagerFileInfo file) -
storageTypeChanged
-
clearResumeData
-
recheckFile
-
setTorrentResumeTotallyIncomplete
-
setTorrentResumeDataNearlyComplete
-
isTorrentResumeDataComplete
-
isTorrentResumeDataValid
-
isTorrentResumeDataComplete
-
setupPieces
-