public class

RrdMemoryBackendFactory

extends RrdBackendFactory
java.lang.Object
   ↳ org.rrd4j.core.RrdBackendFactory
     ↳ org.rrd4j.core.RrdMemoryBackendFactory

Class Overview

Factory class which creates actual RrdMemoryBackend objects. Rrd4j's support for in-memory RRDs is still experimental. You should know that all active RrdMemoryBackend objects are held in memory, each backend object stores RRD data in one big byte array. This implementation is therefore quite basic and memory hungry but runs very fast.

Calling close() on RrdDb objects does not release any memory at all (RRD data must be available for the next new RrdDb(path) call. To release allocated memory, you'll have to call delete(path) method of this class.

Summary

Public Constructors
RrdMemoryBackendFactory()
Public Methods
boolean delete(String id)
Removes the storage with the given ID from the memory.
String getName()
Returns the name of this factory.
Protected Methods
boolean exists(String id)
Method to determine if a memory storage with the given ID already exists.
RrdBackend open(String id, boolean readOnly)
Creates RrdMemoryBackend object.
boolean shouldValidateHeader(String path)
Determines if the header should be validated.
[Expand]
Inherited Methods
From class org.rrd4j.core.RrdBackendFactory
From class java.lang.Object

Public Constructors

public RrdMemoryBackendFactory ()

Public Methods

public boolean delete (String id)

Removes the storage with the given ID from the memory.

Parameters
id Storage ID
Returns
  • True, if the storage with the given ID is deleted, false otherwise.

public String getName ()

Returns the name of this factory.

Returns
  • Factory name (equals to "MEMORY").

Protected Methods

protected boolean exists (String id)

Method to determine if a memory storage with the given ID already exists.

Parameters
id Memory storage ID.
Returns
  • True, if such storage exists, false otherwise.

protected RrdBackend open (String id, boolean readOnly)

Creates RrdMemoryBackend object.

Parameters
id Since this backend holds all data in memory, this argument is interpreted as an ID for this memory-based storage.
readOnly This parameter is ignored
Returns
  • RrdMemoryBackend object which handles all I/O operations
Throws
IOException Thrown in case of I/O error.

protected boolean shouldValidateHeader (String path)

Determines if the header should be validated.

Returns
  • True, if the header should be validated for this factory
Throws
IOException