|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.aelitis.azureus.core.lws.LWSDiskManager
public class LWSDiskManager
Nested Class Summary | |
---|---|
protected static class |
LWSDiskManager.sePiece
|
Nested classes/interfaces inherited from interface org.gudy.azureus2.core3.disk.DiskManager |
---|
DiskManager.GettingThere, DiskManager.OperationStatus |
Field Summary |
---|
Fields inherited from interface org.gudy.azureus2.core3.disk.DiskManager |
---|
ALLOCATING, BLOCK_SIZE, BLOCK_SIZE_KB, CHECKING, ET_INSUFFICIENT_SPACE, ET_NONE, ET_OTHER, FAULTY, INITIALIZING, READY |
Constructor Summary | |
---|---|
protected |
LWSDiskManager(LightWeightSeed _lws,
java.io.File _save_file)
|
Method Summary | |
---|---|
void |
accessModeChanged(DiskManagerFileInfoImpl file,
int old_mode,
int new_mode)
|
void |
addListener(DiskManagerListener l)
|
boolean |
checkBlockConsistencyForHint(java.lang.String originator,
int pieceNumber,
int offset,
int length)
|
boolean |
checkBlockConsistencyForRead(java.lang.String originator,
boolean peer_request,
int pieceNumber,
int offset,
int length)
method for checking that the block details are sensible |
boolean |
checkBlockConsistencyForWrite(java.lang.String originator,
int pieceNumber,
int offset,
DirectByteBuffer data)
method for checking that the block details are sensible |
DiskManagerCheckRequest |
createCheckRequest(int pieceNumber,
java.lang.Object user_data)
Create a request to check a particular piece |
DiskManagerReadRequest |
createReadRequest(int pieceNumber,
int offset,
int length)
|
DiskManagerWriteRequest |
createWriteRequest(int pieceNumber,
int offset,
DirectByteBuffer data,
java.lang.Object user_data)
|
void |
downloadEnded(DiskManager.OperationStatus op_status)
|
void |
downloadRemoved()
|
void |
enqueueCheckRequest(DiskManagerCheckRequest request,
DiskManagerCheckRequestListener listener)
enqueue an asynchronous single piece check |
void |
enqueueCompleteRecheckRequest(DiskManagerCheckRequest request,
DiskManagerCheckRequestListener listener)
recheck the entire torrent asynchronously, reporting each piece to the listener |
void |
enqueueReadRequest(DiskManagerReadRequest request,
DiskManagerReadRequestListener listener)
Enqueue an async disk read request. |
void |
enqueueWriteRequest(DiskManagerWriteRequest request,
DiskManagerWriteRequestListener listener)
enqueue an async write request |
boolean |
filesExist()
|
void |
generateEvidence(IndentWriter writer)
|
long |
getAllocated()
|
int |
getCacheMode()
|
protected DMChecker |
getChecker()
|
int |
getCompleteRecheckStatus()
returns -1 if no recheck in progress, percentage complete in 1000 notation otherwise |
DiskAccessController |
getDiskAccessController()
|
DownloadManagerState |
getDownloadState()
|
java.lang.String |
getErrorMessage()
|
int |
getErrorType()
|
protected DiskManagerFileInfoImpl[] |
getFileInfo(DMPieceMapperFile[] pm_files,
java.io.File save_location)
|
DiskManagerFileInfo[] |
getFiles()
|
DiskManagerFileInfoSet |
getFileSet()
|
java.lang.String |
getInternalName()
|
int |
getLastPieceLength()
|
int |
getMoveProgress()
When a download's data is moving (for completion or removal events) this gives the progress in 1000 notation. |
java.lang.String |
getName()
|
int |
getNbPieces()
|
int |
getPercentDone()
Get the percentage done during checking, allocation or initializing |
int |
getPercentDoneExcludingDND()
|
DiskManagerPiece |
getPiece(int index)
|
byte[] |
getPieceHash(int piece_number)
|
int |
getPieceLength()
|
int |
getPieceLength(int piece_number)
|
DMPieceList |
getPieceList(int piece_number)
|
DMPieceMap |
getPieceMap()
DON'T CACHE the DMPieceMap - as it is designed to be discarded when not in use |
DiskManagerPiece[] |
getPieces()
|
long |
getPriorityChangeMarker()
|
long[] |
getReadStats()
|
DiskManagerRecheckScheduler |
getRecheckScheduler()
|
long |
getRemaining()
Get remaining bytes to completion *including* DND files |
long |
getRemainingExcludingDND()
|
java.io.File |
getSaveLocation()
|
long |
getSizeExcludingDND()
|
int |
getState()
|
java.lang.String |
getStorageType(int fileIndex)
|
java.lang.String[] |
getStorageTypes()
|
TOTorrent |
getTorrent()
|
long |
getTotalLength()
|
boolean |
hasListener(DiskManagerListener l)
|
boolean |
hasOutstandingCheckRequestForPiece(int piece_number)
|
boolean |
hasOutstandingReadRequestForPiece(int piece_number)
|
boolean |
hasOutstandingWriteRequestForPiece(int piece_number)
|
boolean |
isDone(int piece_num)
|
boolean |
isInteresting(int piece_num)
|
boolean |
isStopped()
|
void |
moveDataFiles(java.io.File new_parent_dir,
java.lang.String new_name,
DiskManager.OperationStatus op_status)
|
void |
priorityChanged(DiskManagerFileInfo file)
|
DirectByteBuffer |
readBlock(int pieceNumber,
int offset,
int length)
|
void |
removeListener(DiskManagerListener l)
|
void |
saveResumeData(boolean interim_save)
|
void |
saveState()
Save the individual file priorities map to DownloadManager.getData( "file_priorities" ). |
void |
setAllocated(long num)
|
void |
setFailed(DiskManagerFileInfo file,
java.lang.String reason)
|
void |
setFailed(java.lang.String reason)
Stops the disk manager and informs the download manager that things have gone wrong. |
void |
setPercentDone(int num)
|
void |
setPieceCheckingEnabled(boolean enabled)
|
void |
setPieceDone(DiskManagerPieceImpl dmPiece,
boolean done)
|
void |
skippedFileSetChanged(DiskManagerFileInfo file)
|
void |
start()
Start checking/allocating |
boolean |
stop(boolean closing)
Stop can go async if the download is in a 'starting' state - if so this method returns true |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LWSDiskManager(LightWeightSeed _lws, java.io.File _save_file)
Method Detail |
---|
public java.lang.String getName()
public int getCacheMode()
getCacheMode
in interface DiskManager
public long[] getReadStats()
getReadStats
in interface DiskManager
public void start()
DiskManager
start
in interface DiskManager
protected DiskManagerFileInfoImpl[] getFileInfo(DMPieceMapperFile[] pm_files, java.io.File save_location)
public void setPieceDone(DiskManagerPieceImpl dmPiece, boolean done)
setPieceDone
in interface DiskManagerHelper
public boolean stop(boolean closing)
DiskManager
stop
in interface DiskManager
public boolean isStopped()
isStopped
in interface DiskManager
public boolean filesExist()
filesExist
in interface DiskManager
public DiskManagerWriteRequest createWriteRequest(int pieceNumber, int offset, DirectByteBuffer data, java.lang.Object user_data)
createWriteRequest
in interface DiskManager
public void enqueueWriteRequest(DiskManagerWriteRequest request, DiskManagerWriteRequestListener listener)
DiskManager
enqueueWriteRequest
in interface DiskManager
public boolean hasOutstandingWriteRequestForPiece(int piece_number)
hasOutstandingWriteRequestForPiece
in interface DiskManager
public boolean hasOutstandingReadRequestForPiece(int piece_number)
hasOutstandingReadRequestForPiece
in interface DiskManager
public boolean hasOutstandingCheckRequestForPiece(int piece_number)
hasOutstandingCheckRequestForPiece
in interface DiskManager
public DirectByteBuffer readBlock(int pieceNumber, int offset, int length)
readBlock
in interface DiskManager
public DiskManagerReadRequest createReadRequest(int pieceNumber, int offset, int length)
createReadRequest
in interface DiskManager
public void enqueueReadRequest(DiskManagerReadRequest request, DiskManagerReadRequestListener listener)
DiskManager
enqueueReadRequest
in interface DiskManager
public DiskManagerCheckRequest createCheckRequest(int pieceNumber, java.lang.Object user_data)
DiskManager
createCheckRequest
in interface DiskManager
pieceNumber
- -1 for a complete recheck request
public void enqueueCheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener)
DiskManager
enqueueCheckRequest
in interface DiskManager
public void enqueueCompleteRecheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener)
DiskManager
enqueueCompleteRecheckRequest
in interface DiskManager
public void setPieceCheckingEnabled(boolean enabled)
setPieceCheckingEnabled
in interface DiskManager
public void saveResumeData(boolean interim_save)
saveResumeData
in interface DiskManager
public DiskManagerPiece[] getPieces()
getPieces
in interface DiskManager
public DiskManagerPiece getPiece(int index)
getPiece
in interface DiskManager
public boolean isInteresting(int piece_num)
isInteresting
in interface DiskManager
public boolean isDone(int piece_num)
isDone
in interface DiskManager
public int getNbPieces()
getNbPieces
in interface DiskManager
public DiskManagerFileInfo[] getFiles()
getFiles
in interface DiskManager
public DiskManagerFileInfoSet getFileSet()
getFileSet
in interface DiskManager
public int getState()
getState
in interface DiskManager
public long getTotalLength()
getTotalLength
in interface DiskManager
public int getPieceLength()
getPieceLength
in interface DiskManager
public int getPieceLength(int piece_number)
getPieceLength
in interface DiskManager
public int getLastPieceLength()
public long getRemaining()
DiskManager
getRemaining
in interface DiskManager
public long getRemainingExcludingDND()
getRemainingExcludingDND
in interface DiskManager
public int getPercentDone()
DiskManager
getPercentDone
in interface DiskManager
public int getPercentDoneExcludingDND()
getPercentDoneExcludingDND
in interface DiskManager
public long getSizeExcludingDND()
getSizeExcludingDND
in interface DiskManager
public java.lang.String getErrorMessage()
getErrorMessage
in interface DiskManager
public int getErrorType()
getErrorType
in interface DiskManager
public void downloadEnded(DiskManager.OperationStatus op_status)
downloadEnded
in interface DiskManager
public void moveDataFiles(java.io.File new_parent_dir, java.lang.String new_name, DiskManager.OperationStatus op_status)
moveDataFiles
in interface DiskManager
public int getCompleteRecheckStatus()
DiskManager
getCompleteRecheckStatus
in interface DiskManager
public int getMoveProgress()
DiskManager
getMoveProgress
in interface DiskManager
public boolean checkBlockConsistencyForWrite(java.lang.String originator, int pieceNumber, int offset, DirectByteBuffer data)
DiskManager
checkBlockConsistencyForWrite
in interface DiskManager
public boolean checkBlockConsistencyForRead(java.lang.String originator, boolean peer_request, int pieceNumber, int offset, int length)
DiskManager
checkBlockConsistencyForRead
in interface DiskManager
public boolean checkBlockConsistencyForHint(java.lang.String originator, int pieceNumber, int offset, int length)
checkBlockConsistencyForHint
in interface DiskManager
public void addListener(DiskManagerListener l)
addListener
in interface DiskManager
public void removeListener(DiskManagerListener l)
removeListener
in interface DiskManager
public boolean hasListener(DiskManagerListener l)
hasListener
in interface DiskManager
public void saveState()
DiskManager
saveState
in interface DiskManager
public DiskAccessController getDiskAccessController()
getDiskAccessController
in interface DiskManagerHelper
public DMPieceMap getPieceMap()
DiskManager
getPieceMap
in interface DiskManager
public DMPieceList getPieceList(int piece_number)
getPieceList
in interface DiskManager
getPieceList
in interface DiskManagerHelper
protected DMChecker getChecker()
public byte[] getPieceHash(int piece_number) throws TOTorrentException
getPieceHash
in interface DiskManagerHelper
TOTorrentException
public DiskManagerRecheckScheduler getRecheckScheduler()
getRecheckScheduler
in interface DiskManagerHelper
public void downloadRemoved()
downloadRemoved
in interface DiskManager
public void setFailed(java.lang.String reason)
DiskManagerHelper
setFailed
in interface DiskManagerHelper
public void setFailed(DiskManagerFileInfo file, java.lang.String reason)
setFailed
in interface DiskManagerHelper
public long getAllocated()
getAllocated
in interface DiskManagerHelper
public void setAllocated(long num)
setAllocated
in interface DiskManagerHelper
public void setPercentDone(int num)
setPercentDone
in interface DiskManagerHelper
public TOTorrent getTorrent()
getTorrent
in interface DiskManager
getTorrent
in interface DiskManagerHelper
public java.lang.String[] getStorageTypes()
getStorageTypes
in interface DiskManagerHelper
public java.lang.String getStorageType(int fileIndex)
getStorageType
in interface DiskManagerHelper
public void accessModeChanged(DiskManagerFileInfoImpl file, int old_mode, int new_mode)
accessModeChanged
in interface DiskManagerHelper
public void skippedFileSetChanged(DiskManagerFileInfo file)
skippedFileSetChanged
in interface DiskManagerHelper
public void priorityChanged(DiskManagerFileInfo file)
priorityChanged
in interface DiskManagerHelper
public java.io.File getSaveLocation()
getSaveLocation
in interface DiskManager
public java.lang.String getInternalName()
getInternalName
in interface DiskManagerHelper
public DownloadManagerState getDownloadState()
getDownloadState
in interface DiskManagerHelper
public long getPriorityChangeMarker()
getPriorityChangeMarker
in interface DiskManager
public void generateEvidence(IndentWriter writer)
generateEvidence
in interface DiskManager
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |