Class RamJournalRM.BufferPool

  • Enclosing class:
    RamJournalRM

    protected class RamJournalRM.BufferPool
    extends Object
    A pooling implementation for WriteBuffer objects.
    • Constructor Detail

      • BufferPool

        public BufferPool()
        Instantiate a buffer pool to provide buffers to the journal appending process.
    • Method Detail

      • allocate

        public WriteBuffer allocate()
        Allocate a WriteBuffer from the buffer pool.
        Returns:
        a WriteBuffer instance
      • release

        public void release​(WriteBuffer buf)
        Return a buffer to the pool.
        Parameters:
        buf - the WriteBuffer to return to the pool
      • getSize

        public int getSize()
        Determine the current number of buffers in the pool.
        Returns:
        the number of buffers in the pool
      • getCapacity

        public int getCapacity()
        Determine the maximum number of buffers in the pool.
        Returns:
        the maximum supported number of buffers in the pool