Class CacheFileWithoutCache
java.lang.Object
com.biglybt.core.diskmanager.cache.impl.CacheFileWithoutCache
- All Implemented Interfaces:
CacheFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate longprotected final FMFileprotected final CacheFileManagerImplprotected final TOTorrentFileFields inherited from interface CacheFile
CF_READ, CF_WRITE, CP_FLUSH, CP_NONE, CP_READ_CACHE, CT_COMPACT, CT_LINEAR, CT_PIECE_REORDER, CT_PIECE_REORDER_COMPACT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCacheFileWithoutCache(CacheFileManagerImpl _manager, FMFile _file, TOTorrentFile _torrent_file) -
Method Summary
Modifier and TypeMethodDescriptionvoidflushes the cache and discards entriesvoidclose()longcompareLength(long compare_to) voiddelete()booleanexists()voidflushes the cache to disk but retains entriesvoidflushCache(long offset, int length) intlonglonglonglongintbooleanisOpen()voidmoveFile(File new_file, FileUtil.ProgressListener pl) voidread(DirectByteBuffer[] buffers, long position, short policy) voidread(DirectByteBuffer buffer, long position, short policy) voidrenameFile(String new_file) voidsetAccessMode(int mode) voidsetLength(long length) voidsetPieceComplete(int piece_number, DirectByteBuffer piece_data) voidsetStorageType(int type, boolean force) voidwrite(DirectByteBuffer[] buffers, long position) voidwrite(DirectByteBuffer buffer, long position) voidwriteAndHandoverBuffer(DirectByteBuffer buffer, long position) writes the block to the cache and gives control of the buffer to the cache.voidwriteAndHandoverBuffers(DirectByteBuffer[] buffers, long position)
-
Field Details
-
manager
-
file
-
torrent_file
-
bytes_written
private long bytes_written -
bytes_read
private long bytes_read
-
-
Constructor Details
-
CacheFileWithoutCache
protected CacheFileWithoutCache(CacheFileManagerImpl _manager, FMFile _file, TOTorrentFile _torrent_file)
-
-
Method Details
-
getTorrentFile
- Specified by:
getTorrentFilein interfaceCacheFile
-
exists
-
moveFile
- Specified by:
moveFilein interfaceCacheFile- Throws:
CacheFileManagerException
-
renameFile
- Specified by:
renameFilein interfaceCacheFile- Throws:
CacheFileManagerException
-
setAccessMode
- Specified by:
setAccessModein interfaceCacheFile- Throws:
CacheFileManagerException
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessModein interfaceCacheFile
-
setStorageType
- Specified by:
setStorageTypein interfaceCacheFile- Throws:
CacheFileManagerException
-
getStorageType
public int getStorageType()- Specified by:
getStorageTypein interfaceCacheFile
-
getLength
- Specified by:
getLengthin interfaceCacheFile- Throws:
CacheFileManagerException
-
compareLength
- Specified by:
compareLengthin interfaceCacheFile- Throws:
CacheFileManagerException
-
setLength
- Specified by:
setLengthin interfaceCacheFile- Throws:
CacheFileManagerException
-
setPieceComplete
public void setPieceComplete(int piece_number, DirectByteBuffer piece_data) throws CacheFileManagerException - Specified by:
setPieceCompletein interfaceCacheFile- Throws:
CacheFileManagerException
-
read
public void read(DirectByteBuffer[] buffers, long position, short policy) throws CacheFileManagerException - Specified by:
readin interfaceCacheFile- Throws:
CacheFileManagerException
-
read
public void read(DirectByteBuffer buffer, long position, short policy) throws CacheFileManagerException - Specified by:
readin interfaceCacheFile- Throws:
CacheFileManagerException
-
write
- Specified by:
writein interfaceCacheFile- Throws:
CacheFileManagerException
-
write
- Specified by:
writein interfaceCacheFile- Throws:
CacheFileManagerException
-
writeAndHandoverBuffer
public void writeAndHandoverBuffer(DirectByteBuffer buffer, long position) throws CacheFileManagerException Description copied from interface:CacheFilewrites the block to the cache and gives control of the buffer to the cache.- Specified by:
writeAndHandoverBufferin interfaceCacheFile- Parameters:
buffer-position-- Throws:
CacheFileManagerException- write failed and buffer *not* taken - i.e. caller must de-allocate
-
writeAndHandoverBuffers
public void writeAndHandoverBuffers(DirectByteBuffer[] buffers, long position) throws CacheFileManagerException - Specified by:
writeAndHandoverBuffersin interfaceCacheFile- Throws:
CacheFileManagerException
-
flushCache
Description copied from interface:CacheFileflushes the cache to disk but retains entries- Specified by:
flushCachein interfaceCacheFile- Throws:
CacheFileManagerException
-
flushCache
- Specified by:
flushCachein interfaceCacheFile- Throws:
CacheFileManagerException
-
clearCache
Description copied from interface:CacheFileflushes the cache and discards entries- Specified by:
clearCachein interfaceCacheFile- Throws:
CacheFileManagerException
-
close
- Specified by:
closein interfaceCacheFile- Throws:
CacheFileManagerException
-
isOpen
-
getSessionBytesRead
public long getSessionBytesRead()- Specified by:
getSessionBytesReadin interfaceCacheFile
-
getSessionBytesWritten
public long getSessionBytesWritten()- Specified by:
getSessionBytesWrittenin interfaceCacheFile
-
getLastModified
public long getLastModified()- Specified by:
getLastModifiedin interfaceCacheFile
-
delete
- Specified by:
deletein interfaceCacheFile- Throws:
CacheFileManagerException
-