Class FileMmapIOEngine
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
org.apache.hadoop.hbase.io.hfile.bucket.FileMmapIOEngine
- All Implemented Interfaces:
IOEngine
- Direct Known Subclasses:
ExclusiveMemoryMmapIOEngine,SharedMemoryMmapIOEngine
IO engine that stores data to a file on the specified file system using memory mapping mechanism
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteBufferArrayprivate final FileChannel(package private) static final org.slf4j.Loggerprotected final Stringprivate RandomAccessFileprotected longFields inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
filePaths -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFile IO engine is always able to support persistent storage for the cacheabstract Cacheableread(BucketEntry be) Transfers data from IOEngine to a Cacheable object.private longroundUp(long n, long to) voidshutdown()Close the filevoidsync()Sync the data to file after writingtoString()voidwrite(ByteBuffer srcBuffer, long offset) Transfers data from the given byte buffer to filevoidTransfers the data from the given MultiByteBuffer to IOEngineMethods inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
calculateChecksum, verifyFileIntegrityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.io.hfile.bucket.IOEngine
usesSharedMemory
-
Field Details
-
LOG
-
path
-
size
-
bufferArray
-
fileChannel
-
raf
-
-
Constructor Details
-
FileMmapIOEngine
- Throws:
IOException
-
-
Method Details
-
roundUp
-
toString
-
isPersistent
File IO engine is always able to support persistent storage for the cache -
read
Description copied from interface:IOEngineTransfers 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 happen
-
write
Transfers data from the given byte buffer to file- Parameters:
srcBuffer- the given byte buffer from which bytes are to be readoffset- The offset in the file where the first byte to be written- Throws:
IOException
-
write
Description copied from interface:IOEngineTransfers 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 file after writing- Throws:
IOException
-
shutdown
Close the file
-