Class RrdMemoryBackend


  • public class RrdMemoryBackend
    extends RrdBackend
    Backend to be used to store all RRD bytes in memory.

    • Constructor Detail

      • RrdMemoryBackend

        protected RrdMemoryBackend​(String path)
    • Method Detail

      • write

        protected void write​(long offset,
                             byte[] b)
        Description copied from class: RrdBackend
        Writes an array of bytes to the underlying storage starting from the given storage offset.
        Specified by:
        write in class RrdBackend
        Parameters:
        offset - Storage offset.
        b - Array of bytes that should be copied to the underlying storage
      • read

        protected void read​(long offset,
                            byte[] b)
                     throws IOException
        Description copied from class: RrdBackend
        Reads an array of bytes from the underlying storage starting from the given storage offset.
        Specified by:
        read in class RrdBackend
        Parameters:
        offset - Storage offset.
        b - Array which receives bytes from the underlying storage
        Throws:
        IOException - Thrown in case of I/O error
      • getLength

        public long getLength()
        Returns the number of RRD bytes held in memory.
        Specified by:
        getLength in class RrdBackend
        Returns:
        Number of all RRD bytes.
      • setLength

        protected void setLength​(long newLength)
                          throws IOException
        Reserves a memory section as a RRD storage.
        Specified by:
        setLength in class RrdBackend
        Parameters:
        newLength - Number of bytes held in memory.
        Throws:
        IOException - Thrown in case of I/O error.
      • close

        public void close()
        This method is required by the base class definition, but it does not releases any memory resources at all.
        Overrides:
        close in class RrdBackend
      • isCachingAllowed

        protected boolean isCachingAllowed()
        This method is overridden to disable high-level caching in frontend JRobin classes.
        Overrides:
        isCachingAllowed in class RrdBackend
        Returns:
        Always returns false. There is no need to cache anything in high-level classes since all RRD bytes are already in memory.