Interface IOEngine
- All Known Implementing Classes:
ByteBufferIOEngine
,ExclusiveMemoryMmapIOEngine
,FileIOEngine
,FileMmapIOEngine
,PersistentIOEngine
,SharedMemoryMmapIOEngine
A class implementing IOEngine interface supports data services for
BucketCache
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if persistent storage is supported for the cache when shutdownread
(BucketEntry be) Transfers data from IOEngine to a Cacheable object.void
shutdown()
Shutdown the IOEnginevoid
sync()
Sync the data to IOEngine after writingdefault boolean
IOEngine uses shared memory means, when reading Cacheable from it, those refers to the same memory area as used by the Engine for caching it.void
write
(ByteBuffer srcBuffer, long offset) Transfers data from the given byte buffer to IOEnginevoid
Transfers the data from the given MultiByteBuffer to IOEngine
-
Method Details
-
isPersistent
boolean isPersistent()Returns true if persistent storage is supported for the cache when shutdown -
read
Transfers data from IOEngine to a Cacheable object.- Parameters:
be
- maintains an (offset,len,refCnt) inside.- Returns:
- Cacheable which will wrap the NIO ByteBuffers from IOEngine.
- Throws:
IOException
- when any IO error happenIllegalArgumentException
- when the length of the ByteBuff read is less than 'len'
-
write
Transfers data from the given byte buffer to IOEngine- Parameters:
srcBuffer
- the given byte buffer from which bytes are to be readoffset
- The offset in the IO engine where the first byte to be written- Throws:
IOException
-
write
Transfers the data from the given MultiByteBuffer to IOEngine- Parameters:
srcBuffer
- the given MultiBytebufffers from which bytes are to be readoffset
- the offset in the IO engine where the first byte to be written- Throws:
IOException
-
sync
Sync the data to IOEngine after writing- Throws:
IOException
-
shutdown
void shutdown()Shutdown the IOEngine
-