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
Modifier and TypeFieldDescriptionprotected ByteBufferArray
private final FileChannel
(package private) static final org.slf4j.Logger
protected final String
private RandomAccessFile
protected long
Fields inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
filePaths
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
File IO engine is always able to support persistent storage for the cacheabstract Cacheable
read
(BucketEntry be) Transfers data from IOEngine to a Cacheable object.private long
roundUp
(long n, long to) void
shutdown()
Close the filevoid
sync()
Sync the data to file after writingtoString()
void
write
(ByteBuffer srcBuffer, long offset) Transfers data from the given byte buffer to filevoid
Transfers the data from the given MultiByteBuffer to IOEngineMethods inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
calculateChecksum, verifyFileIntegrity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:IOEngine
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 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:IOEngine
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 file after writing- Throws:
IOException
-
shutdown
Close the file
-