com.aelitis.azureus.core.diskmanager.cache
Interface CacheFile
- All Known Implementing Classes:
- CacheFileWithCache, CacheFileWithoutCache, CacheFileWithoutCacheMT
public interface CacheFile
- Author:
- parg
CT_LINEAR
static final int CT_LINEAR
- See Also:
- Constant Field Values
CT_COMPACT
static final int CT_COMPACT
- See Also:
- Constant Field Values
CT_PIECE_REORDER
static final int CT_PIECE_REORDER
- See Also:
- Constant Field Values
CT_PIECE_REORDER_COMPACT
static final int CT_PIECE_REORDER_COMPACT
- See Also:
- Constant Field Values
CF_READ
static final int CF_READ
- See Also:
- Constant Field Values
CF_WRITE
static final int CF_WRITE
- See Also:
- Constant Field Values
CP_NONE
static final short CP_NONE
- See Also:
- Constant Field Values
CP_READ_CACHE
static final short CP_READ_CACHE
- See Also:
- Constant Field Values
CP_FLUSH
static final short CP_FLUSH
- See Also:
- Constant Field Values
getTorrentFile
TOTorrentFile getTorrentFile()
exists
boolean exists()
moveFile
void moveFile(java.io.File new_file)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
renameFile
void renameFile(java.lang.String new_name)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
setAccessMode
void setAccessMode(int mode)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
getAccessMode
int getAccessMode()
setStorageType
void setStorageType(int type)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
getStorageType
int getStorageType()
getLength
long getLength()
throws CacheFileManagerException
- Throws:
CacheFileManagerException
compareLength
long compareLength(long compare_to)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
setLength
void setLength(long length)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
setPieceComplete
void setPieceComplete(int piece_number,
DirectByteBuffer piece_data)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
read
void read(DirectByteBuffer buffer,
long offset,
short policy)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
read
void read(DirectByteBuffer[] buffers,
long offset,
short policy)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
write
void write(DirectByteBuffer buffer,
long position)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
write
void write(DirectByteBuffer[] buffers,
long position)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
writeAndHandoverBuffer
void writeAndHandoverBuffer(DirectByteBuffer buffer,
long position)
throws CacheFileManagerException
- writes the block to the cache and gives control of the buffer to the cache.
- Parameters:
buffer
- position
-
- Throws:
CacheFileManagerException
- write failed and buffer *not* taken - i.e. caller must de-allocate
writeAndHandoverBuffers
void writeAndHandoverBuffers(DirectByteBuffer[] buffers,
long position)
throws CacheFileManagerException
- Throws:
CacheFileManagerException
flushCache
void flushCache()
throws CacheFileManagerException
- flushes the cache to disk but retains entries
- Throws:
CacheFileManagerException
clearCache
void clearCache()
throws CacheFileManagerException
- flushes the cache and discards entries
- Throws:
CacheFileManagerException
close
void close()
throws CacheFileManagerException
- Throws:
CacheFileManagerException
isOpen
boolean isOpen()
getSessionBytesRead
long getSessionBytesRead()
getSessionBytesWritten
long getSessionBytesWritten()
delete
void delete()
throws CacheFileManagerException
- Throws:
CacheFileManagerException