FileDocCategorySizeDatePackage
DiskManager.javaAPI DocAzureus 3.0.3.45882Mon Aug 27 07:45:14 BST 2007org.gudy.azureus2.core3.disk

DiskManager

public interface DiskManager
author
MjrTom 2005/Oct/08: Priority, getPieces done, etc changes for new piece-picking

Fields Summary
public static final int
INITIALIZING
public static final int
ALLOCATING
public static final int
CHECKING
public static final int
READY
public static final int
FAULTY
public static final int
BLOCK_SIZE_KB
public static final int
BLOCK_SIZE
Constructors Summary
Methods Summary
public voidaddListener(DiskManagerListener l)

public booleancheckBlockConsistencyForHint(java.lang.String originator, int pieceNumber, int offset, int length)

public booleancheckBlockConsistencyForRead(java.lang.String originator, int pieceNumber, int offset, int length)
method for checking that the block details are sensible

param
pieceNumber
param
offset
param
length
return

public booleancheckBlockConsistencyForWrite(java.lang.String originator, int pieceNumber, int offset, org.gudy.azureus2.core3.util.DirectByteBuffer data)
method for checking that the block details are sensible

param
pieceNumber
param
offset
param
data
return

public DiskManagerCheckRequestcreateCheckRequest(int pieceNumber, java.lang.Object user_data)
Create a request to check a particular piece

param
pieceNumber -1 for a complete recheck request
param
user_data
return

public DiskManagerReadRequestcreateReadRequest(int pieceNumber, int offset, int length)

public DiskManagerWriteRequestcreateWriteRequest(int pieceNumber, int offset, org.gudy.azureus2.core3.util.DirectByteBuffer data, java.lang.Object user_data)

public voiddownloadEnded()

public voiddownloadRemoved()

public voidenqueueCheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener)
enqueue an asynchronous single piece check

param
pieceNumber
param
listener
param
user_data

public voidenqueueCompleteRecheckRequest(DiskManagerCheckRequest request, DiskManagerCheckRequestListener listener)
recheck the entire torrent asynchronously, reporting each piece to the listener

param
listener
param
user_data

public voidenqueueReadRequest(DiskManagerReadRequest request, DiskManagerReadRequestListener listener)
Enqueue an async disk read request.

param
request
param
listener

public voidenqueueWriteRequest(DiskManagerWriteRequest request, DiskManagerWriteRequestListener listener)
enqueue an async write request

param
pieceNumber
param
offset
param
data
param
user_data this will be provided to the listener when called back
param
listener

public booleanfilesExist()

return
whether all files exist and sizes match

public booleanforceNoCache()

public voidgenerateEvidence(org.gudy.azureus2.core3.util.IndentWriter writer)

public intgetCompleteRecheckStatus()
returns -1 if no recheck in progress, percentage complete in 1000 notation otherwise

return

public java.lang.StringgetErrorMessage()

public DiskManagerFileInfo[]getFiles()

public intgetNbPieces()

public intgetPercentDone()

public DiskManagerPiecegetPiece(int PieceNumber)

public intgetPieceLength()

public intgetPieceLength(int piece_number)

public org.gudy.azureus2.core3.disk.impl.piecemapper.DMPieceListgetPieceList(int pieceNumber)

public DiskManagerPiece[]getPieces()

public longgetRemaining()

public longgetRemainingExcludingDND()

public java.io.FilegetSaveLocation()

public intgetState()

public org.gudy.azureus2.core3.torrent.TOTorrentgetTorrent()

public longgetTotalLength()

public booleanhasOutstandingWriteRequestForPiece(int piece_number)

public booleanisDone(int pieceNumber)

public booleanisInteresting(int pieceNumber)

param
pieceNumber
return
true if the pieceNumber is Needed and not Done

public voidmoveDataFiles(java.io.File new_parent_dir, java.lang.String dl_name)

public org.gudy.azureus2.core3.util.DirectByteBufferreadBlock(int pieceNumber, int offset, int length)

public voidremoveListener(DiskManagerListener l)

public voidsaveResumeData(boolean interim_save)

public voidsaveState()
Save the individual file priorities map to DownloadManager.getData( "file_priorities" ).

public voidsetPieceCheckingEnabled(boolean enabled)

public voidstart()
Start checking/allocating

public voidstop(boolean closing)