Class RamJournalRM.DefaultDependencies

    • Field Detail

      • MIN_FILE_SIZE

        public static final long MIN_FILE_SIZE
        Minimum maximum size of a "file" i.e. a buffer (1MB).
        See Also:
        Constant Field Values
      • MAX_FILE_SIZE

        public static final long MAX_FILE_SIZE
        Maximum size of a "file" i.e. a buffer (2GB).
        See Also:
        Constant Field Values
      • MIN_TOTAL_SIZE

        public static final long MIN_TOTAL_SIZE
        Minimum maximum total size of RAM used (16MB).
        See Also:
        Constant Field Values
      • MAX_TOTAL_SIZE

        public static final long MAX_TOTAL_SIZE
        Maximum total size of RAM used (64GB).
        See Also:
        Constant Field Values
      • DFT_TOTAL_SIZE

        public static final long DFT_TOTAL_SIZE
        Default total size of RAM used (1GB).
        See Also:
        Constant Field Values
      • MAX_VALUE_SIZE

        public static final int MAX_VALUE_SIZE
        Maximum value size (4MB).
        See Also:
        Constant Field Values
      • DFT_VALUE_SIZE

        public static final int DFT_VALUE_SIZE
        Default maximum value size (16KB).
        See Also:
        Constant Field Values
      • DFT_COLLECT_PCT

        public static final double DFT_COLLECT_PCT
        Default collection factor (collect files that are 84% or less utilized).
        See Also:
        Constant Field Values
      • MAX_POOL_SIZE

        public static final long MAX_POOL_SIZE
        Maximum pool size (64GB).
        See Also:
        Constant Field Values
      • DFT_POOL_SIZE

        public static final long DFT_POOL_SIZE
        Default pool size (16MB).
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultDependencies

        public DefaultDependencies()
        Construct a DefaultDependencies object.
      • DefaultDependencies

        public DefaultDependencies​(RamJournalRM.Dependencies deps)
        Construct a DefaultDependencies object. Copy the values from the specified Dependencies object.
        Parameters:
        deps - the dependencies to copy, or null
    • Method Detail

      • isNioRam

        public boolean isNioRam()
        Return if the journal will use off-heap buffers (NIO RAM) instead of on-heap buffers (byte arrays).
        Specified by:
        isNioRam in interface RamJournalRM.Dependencies
        Returns:
        true if the journal is configured to use NIO "direct buffer" RAM
      • setNioRam

        public RamJournalRM.DefaultDependencies setNioRam​(boolean fUseNioRam)
        Set the journal to use direct buffers (NIO RAM) versus on-heap buffers (byte arrays) to store the journal data. The default is that the journal data is kept on heap in byte arrays.
        Parameters:
        fUseNioRam - pass true to use NIO direct buffers off the heap, or false to use byte arrays on the heap
        Returns:
        this object
      • getMaxPoolSize

        public long getMaxPoolSize()
        Return the maximum size (in bytes) of the buffers that can be held by the pool. This is not a limit of how many buffers can be allocated, since some may be in use at any time, but rather how many will be held by the pool (i.e. recycled) as they are released.
        Specified by:
        getMaxPoolSize in interface RamJournalRM.Dependencies
        Returns:
        the maximum size in bytes of all of the buffers that the buffer pool can hold onto
      • setMaxPoolSize

        public RamJournalRM.DefaultDependencies setMaxPoolSize​(long maxPool)
        Set the size of the buffers pool. The default is defined by DFT_POOL_SIZE, with a maximum defined by MAX_POOL_SIZE and a minimum of zero.
        Parameters:
        maxPool - the size, in bytes, for the buffer pool
        Returns:
        this object
      • getPermittedMaxValueSize

        protected int getPermittedMaxValueSize()
        Return the highest memory size permitted for each value stored in the journal.
        Specified by:
        getPermittedMaxValueSize in class AbstractJournalRM.DefaultDependencies
        Returns:
        the highest memory size permitted for each value stored in the journal