Class BufferAllocatorMapped

java.lang.Object
org.apache.jena.tdb1.base.file.BufferAllocatorMapped
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, BufferAllocator

public final class BufferAllocatorMapped extends Object implements BufferAllocator
ByteBuffer access to a temporary file, using memory mapped I/O. The file will grow in chunks as necessary by the SystemTDB.SegmentSize.

This class is not thread-safe.

  • Constructor Details

    • BufferAllocatorMapped

      public BufferAllocatorMapped(int blockSize)
  • Method Details

    • allocate

      public ByteBuffer allocate(int blkSize)
      Description copied from interface: BufferAllocator
      Allocate and return a ByteBuffer of the given size
      Specified by:
      allocate in interface BufferAllocator
      Parameters:
      blkSize - the desired size of the ByteBuffer
      Returns:
      a ByteBuffer with the capacity set to the desired size
    • clear

      public void clear()
      Description copied from interface: BufferAllocator
      Call this method when you are finished with all of the ByteBuffers retrieved from allocate. The BufferAllocator is then free to reuse memory that was previously handed out.
      Specified by:
      clear in interface BufferAllocator
    • close

      public void close()
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable