Package com.biglybt.core.disk.impl
Class DiskManagerImpl
java.lang.Object
com.biglybt.core.logging.LogRelation
com.biglybt.core.disk.impl.DiskManagerImpl
- All Implemented Interfaces:
DiskManager
,DiskManagerHelper
,DiskManagerUtil.MoveTaskAapter
public class DiskManagerImpl
extends LogRelation
implements DiskManagerHelper, DiskManagerUtil.MoveTaskAapter
The disk Wrapper.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.biglybt.core.disk.DiskManager
DiskManager.DownloadEndedProgress
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private long
private static final DiskManagerAllocationScheduler
private String
private boolean
private final BitFlags
private DMChecker
private boolean
private static final DiskAccessController
private static final int
protected final DownloadManager
private String
private int
private final Object
private DiskManagerFileInfoImpl[]
private DiskManagerFileInfoSet
long
private int
private static final int
private static final int
private static final int
private static final int
private final ListenerManager<DiskManagerListener>
protected static final ListenerManager<DiskManagerListener>
private static final LogIDs
(package private) static boolean
private boolean
private long[]
private int
private File
private int
private int
private DMPieceMap
private long
private DMPieceMapper
private int
private DiskManagerPieceImpl[]
private final AtomicLong
private DMReader
private static final DiskManagerRecheckScheduler
private long
private long
(package private) static boolean
(package private) static int
private RDResumeHandler
(package private) static boolean
(package private) static boolean
private long
private boolean
private long
private static final ThreadPool
(package private) final AEMonitor
private boolean
(package private) final AESemaphore
private boolean
private int
private boolean
private final TOTorrent
private long
private boolean
private DMWriter
Fields inherited from interface com.biglybt.core.disk.DiskManager
ALLOCATING, BLOCK_SIZE, BLOCK_SIZE_KB, CHECKING, ET_FILE_MISSING, ET_INSUFFICIENT_SPACE, ET_NONE, ET_OTHER, ET_READ_ERROR, ET_STOP_DURING_INIT, ET_WRITE_ERROR, FAULTY, INITIALIZING, READY, SNAPSHOT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
private boolean
allocateFile
(DiskManagerAllocationScheduler.AllocationInstance allocation_instance, DiskManagerFileInfoImpl fileInfo, File data_file, long existing_length, long target_length, boolean[] stop_after_start, long alloc_strategy) private int[]
allocateFiles
(boolean[] stop_after_start) boolean
checkBlockConsistencyForHint
(String originator, int pieceNumber, int offset, int length) boolean
checkBlockConsistencyForRead
(String originator, boolean peer_request, int pieceNumber, int offset, int length) method for checking that the block details are sensibleboolean
checkBlockConsistencyForWrite
(String originator, int pieceNumber, int offset, DirectByteBuffer data) method for checking that the block details are sensiblevoid
checkFreePieceList
(boolean force_discard) private static int
countDataFiles
(TOTorrent torrent, String torrent_save_dir, String torrent_save_file) private static int
countFiles
(File f, int stopAfterCount) createCheckRequest
(int pieceNumber, Object user_data) Create a request to check a particular pieceprivate DiskManagerFileInfoImpl
createFileInfo
(DownloadManagerState state, DMPieceMapperFile pm_info, int file_index, File root_dir, String relative_file, int storage_type) createReadRequest
(int pieceNumber, int offset, int length) createWriteRequest
(int pieceNumber, int offset, DirectByteBuffer data, Object user_data) private static void
deleteDataFileContents
(TOTorrent torrent, String torrent_save_dir, String torrent_save_file, boolean force_no_recycle) static void
deleteDataFiles
(TOTorrent torrent, String torrent_save_dir, String torrent_save_file, boolean force_no_recycle) Deletes all data files associated with torrent.downloadEnded
(boolean start_of_day) void
void
enqueueCheckRequest
(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener) enqueue an asynchronous single piece checkvoid
enqueueCompleteRecheckRequest
(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener) recheck the entire torrent asynchronously, reporting each piece to the listenervoid
enqueueReadRequest
(DiskManagerReadRequest request, DiskManagerReadRequestListener listener) Enqueue an async disk read request.void
enqueueWriteRequest
(DiskManagerWriteRequest request, DiskManagerWriteRequestListener listener) enqueue an async write requestprivate void
fileAllocFailed
(File file, long length, boolean is_new, Throwable e) boolean
protected boolean
filesExist
(File root_dir, boolean exact) private void
void
generateEvidence
(IndentWriter writer) int
int
returns -1 if no recheck in progress, percentage complete in 1000 notation otherwisestatic DiskAccessController
int
getFiles()
int
long[]
long[]
When a download's data is moving (for completion or removal events) this gives the [progress in 1000 notation,total_size] null if nothing's going onint
int
int
Get the percentage done during checking, allocation or initializingint
getPiece
(int PieceNumber) byte[]
getPieceHash
(int piece_number) int
int
getPieceLength
(int piece_number) getPieceList
(int piece_number) DON'T CACHE the DMPieceMap - as it is designed to be discarded when not in uselong
Object[]
Query this class for a reference to another class that it may holdlong[]
boolean
A short description of what your class holds that can be printed by the loggerlong
Get remaining bytes to completion *including* DND fileslong
long
int
getState()
getStorageType
(int fileIndex) Returns the storage type for file atfileIndex
.static String
getStorageType
(DownloadManager download_manager, int fileIndex) Returns the storage type for aDownloadManager
's file atfileIndex
.String[]
Returns the storage type for all files.static String[]
getStorageTypes
(DownloadManager download_manager) Returns the storage type for each file inDownloadManager
.long
long[]
boolean
boolean
hasOutstandingCheckRequestForPiece
(int piece_number) boolean
hasOutstandingReadRequestForPiece
(int piece_number) boolean
hasOutstandingWriteRequestForPiece
(int piece_number) boolean
isDone
(int pieceNumber) private boolean
isFileDestinationIsItself
(SaveLocationChange loc_change) boolean
isInteresting
(int pieceNumber) boolean
private void
logMoveFileError
(File destination_path, String message) void
moveDataFiles
(File new_parent_dir, String new_name) private boolean
moveDataFiles0
(SaveLocationChange loc_change, boolean change_to_read_only) private void
moveDownloadFilesWhenEndedOrRemoved
(boolean removing, boolean torrent_file_exists, DiskManagerImpl.DownloadEndedProgressImpl progress, boolean start_of_day) private void
moveDownloadFilesWhenEndedOrRemoved0
(SaveLocationChange loc_change, DiskManagerImpl.DownloadEndedProgressImpl progress) protected void
moveFiles
(SaveLocationChange loc_change, boolean change_to_read_only) private void
moveTorrentFile
(SaveLocationChange loc_change) void
readBlock
(int pieceNumber, int offset, int length) void
void
saveResumeData
(boolean interim_save) void
saveState
(boolean interim) Save the individual file priorities map to DownloadManager.getData( "file_priorities" ).protected void
saveStateSupport
(boolean persist, boolean interim) private void
setErrorMessage
(long file_length, Throwable e, String str) private void
setErrorMessage
(String str) private void
setErrorMessage
(Throwable e, String str) private void
private void
setErrorState
(int type) private void
setErrorState
(int type, String msg) private void
setErrorState
(int type, String msg, Throwable cause) private void
setErrorState
(String msg) void
Stops the disk manager and informs the download manager that things have gone wrong.void
setFailedAndRecheck
(DiskManagerFileInfo file, String reason) static void
setFileLinks
(DownloadManager download_manager, LinkFileMap links) void
setMoveState
(int state) void
setPieceCheckingEnabled
(boolean enabled) void
setPieceDone
(DiskManagerPieceImpl dmPiece, boolean done) Called when status has CHANGED and should only be called by DiskManagerPieceImplprivate void
setState
(int _state) void
void
start()
Start checking/allocating(package private) void
boolean
stop
(boolean closing) Stop can go async if the download is in a 'starting' state - if so this method returns truevoid
protected static void
storeFileDownloaded
(DownloadManager download_manager, DiskManagerFileInfo[] files, boolean persist, boolean interim) protected void
protected static void
storeFilePriorities
(DownloadManager download_manager, DiskManagerFileInfo[] files) Methods inherited from class com.biglybt.core.logging.LogRelation
propogatedRelationText, queryForClass
-
Field Details
-
DM_FREE_PIECELIST_TIMEOUT
private static final int DM_FREE_PIECELIST_TIMEOUT- See Also:
-
LOGID
-
disk_access_controller
-
reorder_storage_mode
static boolean reorder_storage_mode -
reorder_storage_mode_min_mb
static int reorder_storage_mode_min_mb -
missing_file_dl_restart_enabled
static volatile boolean missing_file_dl_restart_enabled -
skip_incomp_dl_file_checks
static boolean skip_incomp_dl_file_checks -
skip_comp_dl_file_checks
static boolean skip_comp_dl_file_checks -
recheck_scheduler
-
allocation_scheduler
-
start_pool
-
used
private boolean used -
started
private boolean started -
started_sem
-
starting
private boolean starting -
stopping
private volatile boolean stopping -
state_set_via_method
private volatile int state_set_via_method -
errorMessage_set_via_method
-
errorType
private volatile int errorType -
pieceLength
private int pieceLength -
lastPieceLength
private int lastPieceLength -
nbPieces
private int nbPieces -
totalLength
private long totalLength -
percentDone
private int percentDone -
allocated
private long allocated -
allocate_not_required
private long allocate_not_required -
remaining
private long remaining -
allocation_task
-
remaining_excluding_dnd
private volatile long remaining_excluding_dnd -
torrent
-
reader
-
checker
-
writer
-
resume_handler
-
piece_mapper
-
pieces
-
piece_map_use_accessor
-
piece_map_use_accessor_time
private long piece_map_use_accessor_time -
files
-
fileset
-
download_manager
-
alreadyMoved
private boolean alreadyMoved -
skipped_file_set_changed
private boolean skipped_file_set_changed -
skipped_file_set_size
private long skipped_file_set_size -
skipped_but_downloaded
private long skipped_but_downloaded -
priority_change_marker
-
checking_enabled
private boolean checking_enabled -
move_in_progress
private volatile boolean move_in_progress -
move_progress
private volatile long[] move_progress -
move_subtask
-
move_state
private volatile int move_state -
LDT_STATE_CHANGED
private static final int LDT_STATE_CHANGED- See Also:
-
LDT_PRIO_CHANGED
private static final int LDT_PRIO_CHANGED- See Also:
-
LDT_PIECE_DONE_CHANGED
private static final int LDT_PIECE_DONE_CHANGED- See Also:
-
LDT_FILE_COMPLETED
private static final int LDT_FILE_COMPLETED- See Also:
-
listeners_aggregator
-
listeners
-
start_stop_mon
-
file_piece_lock
-
availability
-
garbage
public long garbage
-
-
Constructor Details
-
DiskManagerImpl
-
-
Method Details
-
getDefaultDiskAccessController
-
getDisplayName
- Specified by:
getDisplayName
in interfaceDiskManagerHelper
-
getDownload
- Specified by:
getDownload
in interfaceDiskManager
- Returns:
- MAY BE NULL
-
start
public void start()Description copied from interface:DiskManager
Start checking/allocating- Specified by:
start
in interfaceDiskManager
-
startSupport
void startSupport() -
stop
public boolean stop(boolean closing) Description copied from interface:DiskManager
Stop can go async if the download is in a 'starting' state - if so this method returns true- Specified by:
stop
in interfaceDiskManager
- Returns:
-
isStopped
public boolean isStopped()- Specified by:
isStopped
in interfaceDiskManager
-
filesExist
public boolean filesExist()- Specified by:
filesExist
in interfaceDiskManager
- Returns:
- whether all files exist and sizes match
-
filesExist
-
createFileInfo
private DiskManagerFileInfoImpl createFileInfo(DownloadManagerState state, DMPieceMapperFile pm_info, int file_index, File root_dir, String relative_file, int storage_type) throws CacheFileManagerException - Throws:
CacheFileManagerException
-
allocateFiles
private int[] allocateFiles(boolean[] stop_after_start) -
allocateFile
private boolean allocateFile(DiskManagerAllocationScheduler.AllocationInstance allocation_instance, DiskManagerFileInfoImpl fileInfo, File data_file, long existing_length, long target_length, boolean[] stop_after_start, long alloc_strategy) throws Throwable - Throws:
Throwable
-
fileAllocFailed
-
getDiskAccessController
- Specified by:
getDiskAccessController
in interfaceDiskManagerHelper
-
enqueueReadRequest
public void enqueueReadRequest(DiskManagerReadRequest request, DiskManagerReadRequestListener listener) Description copied from interface:DiskManager
Enqueue an async disk read request.- Specified by:
enqueueReadRequest
in interfaceDiskManager
-
hasOutstandingReadRequestForPiece
public boolean hasOutstandingReadRequestForPiece(int piece_number) - Specified by:
hasOutstandingReadRequestForPiece
in interfaceDiskManager
-
getNbPieces
public int getNbPieces()- Specified by:
getNbPieces
in interfaceDiskManager
-
getPercentDone
public int getPercentDone()Description copied from interface:DiskManager
Get the percentage done during checking, allocation or initializing- Specified by:
getPercentDone
in interfaceDiskManager
- Returns:
- percent done * 1000 (1000 = 100%)
-
getPercentAllocated
public int getPercentAllocated()- Specified by:
getPercentAllocated
in interfaceDiskManager
-
getLatency
public long[] getLatency()- Specified by:
getLatency
in interfaceDiskManager
-
getAllocationTask
- Specified by:
getAllocationTask
in interfaceDiskManager
-
getRemaining
public long getRemaining()Description copied from interface:DiskManager
Get remaining bytes to completion *including* DND files- Specified by:
getRemaining
in interfaceDiskManager
-
fixupSkippedCalculation
private void fixupSkippedCalculation() -
getRemainingExcludingDND
public long getRemainingExcludingDND()- Specified by:
getRemainingExcludingDND
in interfaceDiskManager
-
getSizeExcludingDND
public long getSizeExcludingDND()- Specified by:
getSizeExcludingDND
in interfaceDiskManager
-
getPercentDoneExcludingDND
public int getPercentDoneExcludingDND()- Specified by:
getPercentDoneExcludingDND
in interfaceDiskManager
-
setPieceDone
Called when status has CHANGED and should only be called by DiskManagerPieceImpl- Specified by:
setPieceDone
in interfaceDiskManagerHelper
-
getAvailability
- Specified by:
getAvailability
in interfaceDiskManager
-
getPieces
- Specified by:
getPieces
in interfaceDiskManager
-
getPiece
- Specified by:
getPiece
in interfaceDiskManager
-
getPieceLength
public int getPieceLength()- Specified by:
getPieceLength
in interfaceDiskManager
-
getPieceLength
public int getPieceLength(int piece_number) - Specified by:
getPieceLength
in interfaceDiskManager
-
getTotalLength
public long getTotalLength()- Specified by:
getTotalLength
in interfaceDiskManager
-
getLastPieceLength
public int getLastPieceLength() -
getState
public int getState()- Specified by:
getState
in interfaceDiskManager
-
setErrorMessage
-
setErrorMessage
-
setErrorMessage
-
setErrorState
private void setErrorState() -
setErrorState
-
setErrorState
-
setErrorState
-
setErrorState
private void setErrorState(int type) -
setState
private void setState(int _state) -
getFiles
- Specified by:
getFiles
in interfaceDiskManager
-
getFileSet
- Specified by:
getFileSet
in interfaceDiskManager
-
getErrorMessage
- Specified by:
getErrorMessage
in interfaceDiskManager
-
getErrorType
public int getErrorType()- Specified by:
getErrorType
in interfaceDiskManager
-
setFailed
Description copied from interface:DiskManagerHelper
Stops the disk manager and informs the download manager that things have gone wrong.- Specified by:
setFailed
in interfaceDiskManagerHelper
-
setFailedAndRecheck
- Specified by:
setFailedAndRecheck
in interfaceDiskManagerHelper
-
getCacheMode
public int getCacheMode()- Specified by:
getCacheMode
in interfaceDiskManager
-
getReadStats
public long[] getReadStats()- Specified by:
getReadStats
in interfaceDiskManager
-
getWriteStats
public long[] getWriteStats()- Specified by:
getWriteStats
in interfaceDiskManager
-
getPieceMap
Description copied from interface:DiskManager
DON'T CACHE the DMPieceMap - as it is designed to be discarded when not in use- Specified by:
getPieceMap
in interfaceDiskManager
- Returns:
-
getPieceList
- Specified by:
getPieceList
in interfaceDiskManager
- Specified by:
getPieceList
in interfaceDiskManagerHelper
-
checkFreePieceList
public void checkFreePieceList(boolean force_discard) -
getPieceHash
- Specified by:
getPieceHash
in interfaceDiskManagerHelper
- Throws:
TOTorrentException
-
createReadRequest
- Specified by:
createReadRequest
in interfaceDiskManager
-
createCheckRequest
Description copied from interface:DiskManager
Create a request to check a particular piece- Specified by:
createCheckRequest
in interfaceDiskManager
- Parameters:
pieceNumber
- -1 for a complete recheck request- Returns:
-
hasOutstandingCheckRequestForPiece
public boolean hasOutstandingCheckRequestForPiece(int piece_number) - Specified by:
hasOutstandingCheckRequestForPiece
in interfaceDiskManager
-
enqueueCompleteRecheckRequest
public void enqueueCompleteRecheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener) Description copied from interface:DiskManager
recheck the entire torrent asynchronously, reporting each piece to the listener- Specified by:
enqueueCompleteRecheckRequest
in interfaceDiskManager
-
enqueueCheckRequest
public void enqueueCheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener) Description copied from interface:DiskManager
enqueue an asynchronous single piece check- Specified by:
enqueueCheckRequest
in interfaceDiskManager
-
getCompleteRecheckStatus
public int getCompleteRecheckStatus()Description copied from interface:DiskManager
returns -1 if no recheck in progress, percentage complete in 1000 notation otherwise- Specified by:
getCompleteRecheckStatus
in interfaceDiskManager
- Returns:
-
getRecheckCancelled
public boolean getRecheckCancelled()- Specified by:
getRecheckCancelled
in interfaceDiskManager
-
getMoveProgress
public long[] getMoveProgress()Description copied from interface:DiskManager
When a download's data is moving (for completion or removal events) this gives the [progress in 1000 notation,total_size] null if nothing's going on- Specified by:
getMoveProgress
in interfaceDiskManager
- Specified by:
getMoveProgress
in interfaceDiskManagerUtil.MoveTaskAapter
-
getMoveSubTask
- Specified by:
getMoveSubTask
in interfaceDiskManager
- Specified by:
getMoveSubTask
in interfaceDiskManagerUtil.MoveTaskAapter
-
setMoveState
public void setMoveState(int state) - Specified by:
setMoveState
in interfaceDiskManager
- Specified by:
setMoveState
in interfaceDiskManagerUtil.MoveTaskAapter
-
setPieceCheckingEnabled
public void setPieceCheckingEnabled(boolean enabled) - Specified by:
setPieceCheckingEnabled
in interfaceDiskManager
-
readBlock
- Specified by:
readBlock
in interfaceDiskManager
-
createWriteRequest
public DiskManagerWriteRequest createWriteRequest(int pieceNumber, int offset, DirectByteBuffer data, Object user_data) - Specified by:
createWriteRequest
in interfaceDiskManager
-
enqueueWriteRequest
public void enqueueWriteRequest(DiskManagerWriteRequest request, DiskManagerWriteRequestListener listener) Description copied from interface:DiskManager
enqueue an async write request- Specified by:
enqueueWriteRequest
in interfaceDiskManager
-
hasOutstandingWriteRequestForPiece
public boolean hasOutstandingWriteRequestForPiece(int piece_number) - Specified by:
hasOutstandingWriteRequestForPiece
in interfaceDiskManager
-
checkBlockConsistencyForWrite
public boolean checkBlockConsistencyForWrite(String originator, int pieceNumber, int offset, DirectByteBuffer data) Description copied from interface:DiskManager
method for checking that the block details are sensible- Specified by:
checkBlockConsistencyForWrite
in interfaceDiskManager
- Returns:
-
checkBlockConsistencyForRead
public boolean checkBlockConsistencyForRead(String originator, boolean peer_request, int pieceNumber, int offset, int length) Description copied from interface:DiskManager
method for checking that the block details are sensible- Specified by:
checkBlockConsistencyForRead
in interfaceDiskManager
- Returns:
-
checkBlockConsistencyForHint
public boolean checkBlockConsistencyForHint(String originator, int pieceNumber, int offset, int length) - Specified by:
checkBlockConsistencyForHint
in interfaceDiskManager
-
saveResumeData
- Specified by:
saveResumeData
in interfaceDiskManager
- Throws:
Exception
-
downloadEnded
- Specified by:
downloadEnded
in interfaceDiskManager
-
downloadRemoved
public void downloadRemoved()- Specified by:
downloadRemoved
in interfaceDiskManager
-
moveDownloadFilesWhenEndedOrRemoved
private void moveDownloadFilesWhenEndedOrRemoved(boolean removing, boolean torrent_file_exists, DiskManagerImpl.DownloadEndedProgressImpl progress, boolean start_of_day) -
moveDownloadFilesWhenEndedOrRemoved0
private void moveDownloadFilesWhenEndedOrRemoved0(SaveLocationChange loc_change, DiskManagerImpl.DownloadEndedProgressImpl progress) -
moveDataFiles
- Specified by:
moveDataFiles
in interfaceDiskManager
-
moveFiles
-
logMoveFileError
-
isFileDestinationIsItself
-
moveDataFiles0
private boolean moveDataFiles0(SaveLocationChange loc_change, boolean change_to_read_only) throws Exception - Throws:
Exception
-
moveTorrentFile
-
getTorrent
- Specified by:
getTorrent
in interfaceDiskManager
- Specified by:
getTorrent
in interfaceDiskManagerHelper
-
addListener
- Specified by:
addListener
in interfaceDiskManager
-
removeListener
- Specified by:
removeListener
in interfaceDiskManager
-
hasListener
- Specified by:
hasListener
in interfaceDiskManager
-
deleteDataFiles
public static void deleteDataFiles(TOTorrent torrent, String torrent_save_dir, String torrent_save_file, boolean force_no_recycle) Deletes all data files associated with torrent. Currently, deletes all files, then tries to delete the path recursively if the paths are empty. An unexpected result may be that a empty directory that the user created will be removed. TODO: only remove empty directories that are created for the torrent -
countFiles
-
countDataFiles
-
deleteDataFileContents
private static void deleteDataFileContents(TOTorrent torrent, String torrent_save_dir, String torrent_save_file, boolean force_no_recycle) throws TOTorrentException, UnsupportedEncodingException, LocaleUtilEncodingException -
skippedFileSetChanged
- Specified by:
skippedFileSetChanged
in interfaceDiskManagerHelper
-
priorityChanged
- Specified by:
priorityChanged
in interfaceDiskManagerHelper
-
storageTypeChanged
- Specified by:
storageTypeChanged
in interfaceDiskManagerHelper
-
storeFilePriorities
protected void storeFilePriorities() -
storeFilePriorities
protected static void storeFilePriorities(DownloadManager download_manager, DiskManagerFileInfo[] files) -
storeFileDownloaded
protected static void storeFileDownloaded(DownloadManager download_manager, DiskManagerFileInfo[] files, boolean persist, boolean interim) -
saveState
public void saveState(boolean interim) Description copied from interface:DiskManager
Save the individual file priorities map to DownloadManager.getData( "file_priorities" ).- Specified by:
saveState
in interfaceDiskManager
-
saveStateSupport
protected void saveStateSupport(boolean persist, boolean interim) -
getDownloadManager
-
getInternalName
- Specified by:
getInternalName
in interfaceDiskManagerHelper
-
getDownloadState
- Specified by:
getDownloadState
in interfaceDiskManagerHelper
-
getSaveLocation
- Specified by:
getSaveLocation
in interfaceDiskManager
-
getStorageTypes
Description copied from interface:DiskManagerHelper
Returns the storage type for all files. According toDiskManagerUtil.convertDMStorageTypeFromString(String)
, values are:
"R"DiskManagerFileInfo.ST_REORDER
"L"DiskManagerFileInfo.ST_LINEAR
"C"DiskManagerFileInfo.ST_COMPACT
"X"DiskManagerFileInfo.ST_REORDER_COMPACT
- Specified by:
getStorageTypes
in interfaceDiskManagerHelper
-
getStorageType
Description copied from interface:DiskManagerHelper
Returns the storage type for file atfileIndex
. According toDiskManagerUtil.convertDMStorageTypeFromString(String)
, values are:
"R"DiskManagerFileInfo.ST_REORDER
"L"DiskManagerFileInfo.ST_LINEAR
"C"DiskManagerFileInfo.ST_COMPACT
"X"DiskManagerFileInfo.ST_REORDER_COMPACT
- Specified by:
getStorageType
in interfaceDiskManagerHelper
-
getStorageTypes
Returns the storage type for each file inDownloadManager
. According toDiskManagerUtil.convertDMStorageTypeFromString(String)
, String values are:
"R"DiskManagerFileInfo.ST_REORDER
"L"DiskManagerFileInfo.ST_LINEAR
"C"DiskManagerFileInfo.ST_COMPACT
"X"DiskManagerFileInfo.ST_REORDER_COMPACT
-
getStorageType
Returns the storage type for aDownloadManager
's file atfileIndex
. According toDiskManagerUtil.convertDMStorageTypeFromString(String)
, values are:
"R"DiskManagerFileInfo.ST_REORDER
"L"DiskManagerFileInfo.ST_LINEAR
"C"DiskManagerFileInfo.ST_COMPACT
"X"DiskManagerFileInfo.ST_REORDER_COMPACT
-
setFileLinks
-
getRelationText
Description copied from class:LogRelation
A short description of what your class holds that can be printed by the logger- Overrides:
getRelationText
in classLogRelation
- Returns:
-
getQueryableInterfaces
Description copied from class:LogRelation
Query this class for a reference to another class that it may hold- Overrides:
getQueryableInterfaces
in classLogRelation
- Returns:
- If found, the class desired. Otherwise, null.
-
getRecheckScheduler
- Specified by:
getRecheckScheduler
in interfaceDiskManagerHelper
-
isInteresting
public boolean isInteresting(int pieceNumber) - Specified by:
isInteresting
in interfaceDiskManager
- Returns:
- true if the pieceNumber is Needed and not Done
-
isDone
public boolean isDone(int pieceNumber) - Specified by:
isDone
in interfaceDiskManager
-
getPriorityChangeMarker
public long getPriorityChangeMarker()- Specified by:
getPriorityChangeMarker
in interfaceDiskManager
-
generateEvidence
- Specified by:
generateEvidence
in interfaceDiskManager
-