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

@Private public abstract class FileMmapIOEngine extends PersistentIOEngine
IO engine that stores data to a file on the specified file system using memory mapping mechanism
  • Field Details

  • Constructor Details

  • Method Details

    • roundUp

      private long roundUp(long n, long to)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isPersistent

      public boolean isPersistent()
      File IO engine is always able to support persistent storage for the cache
    • read

      public abstract Cacheable read(BucketEntry be) throws IOException
      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

      public void write(ByteBuffer srcBuffer, long offset) throws IOException
      Transfers data from the given byte buffer to file
      Parameters:
      srcBuffer - the given byte buffer from which bytes are to be read
      offset - The offset in the file where the first byte to be written
      Throws:
      IOException
    • write

      public void write(ByteBuff srcBuffer, long offset) throws IOException
      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 read
      offset - the offset in the IO engine where the first byte to be written
      Throws:
      IOException
    • sync

      public void sync() throws IOException
      Sync the data to file after writing
      Throws:
      IOException
    • shutdown

      public void shutdown()
      Close the file