Class SharedMemoryMmapIOEngine

All Implemented Interfaces:
IOEngine

@Private public class SharedMemoryMmapIOEngine extends FileMmapIOEngine
IO engine that stores data in pmem devices such as DCPMM. This engine also mmaps the file from the given path. But note that this path has to be a path on the pmem device so that when mmapped the file's address is mapped to the Pmem's address space and not in the DRAM. Since this address space is exclusive for the Pmem device there is no swapping out of the mmapped contents that generally happens when DRAM's free space is not enough to hold the specified file's mmapped contents. This gives us the option of using the MemoryType#SHARED type when serving the data from this pmem address space. We need not copy the blocks to the onheap space as we need to do for the case of ExclusiveMemoryMmapIOEngine.
  • Constructor Details

  • Method Details

    • usesSharedMemory

      public boolean usesSharedMemory()
      Description copied from interface: IOEngine
      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.
      Returns:
      true when IOEngine using shared memory.
    • read

      public Cacheable read(BucketEntry be) throws IOException
      Description copied from interface: IOEngine
      Transfers data from IOEngine to a Cacheable object.
      Specified by:
      read in interface IOEngine
      Specified by:
      read in class FileMmapIOEngine
      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