Package org.jrobin.core
Class RrdMemoryBackendFactory
- java.lang.Object
-
- org.jrobin.core.RrdBackendFactory
-
- org.jrobin.core.RrdMemoryBackendFactory
-
public class RrdMemoryBackendFactory extends RrdBackendFactory
Factory class which creates actualRrdMemoryBackend
objects. JRobin'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 nextnew RrdDb(path)
call. To release allocated memory, you'll have to calldelete(path)
method of this class.
-
-
Constructor Summary
Constructors Constructor Description RrdMemoryBackendFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(String id)
Removes the storage with the given ID from the memory.protected boolean
exists(String id)
Method to determine if a memory storage with the given ID already exists.String
getFactoryName()
Returns the name of this factory.protected RrdBackend
open(String id, boolean readOnly)
Creates RrdMemoryBackend object.-
Methods inherited from class org.jrobin.core.RrdBackendFactory
getDefaultFactory, getFactory, isInstanceCreated, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory, toString
-
-
-
-
Field Detail
-
NAME
public static final String NAME
factory name, "MEMORY"- See Also:
- Constant Field Values
-
-
Method Detail
-
open
protected RrdBackend open(String id, boolean readOnly)
Creates RrdMemoryBackend object.- Specified by:
open
in classRrdBackendFactory
- 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
-
exists
protected boolean exists(String id)
Method to determine if a memory storage with the given ID already exists.- Specified by:
exists
in classRrdBackendFactory
- Parameters:
id
- Memory storage ID.- Returns:
- True, if such storage exists, false otherwise.
-
delete
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.
-
getFactoryName
public String getFactoryName()
Returns the name of this factory.- Specified by:
getFactoryName
in classRrdBackendFactory
- Returns:
- Factory name (equals to "MEMORY").
-
-