Package org.rrd4j.core
Class RrdMemoryBackendFactory
java.lang.Object
org.rrd4j.core.RrdBackendFactory
org.rrd4j.core.RrdMemoryBackendFactory
- All Implemented Interfaces:
Closeable,AutoCloseable
@RrdBackendAnnotation(name="MEMORY",
shouldValidateHeader=false)
public class RrdMemoryBackendFactory
extends RrdBackendFactory
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.
-
Field Summary
FieldsFields inherited from class org.rrd4j.core.RrdBackendFactory
cachingAllowed, DEFAULTFACTORY, name, scheme, validateHeader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanRemoves the storage with the given ID from the memory.protected booleanDetermines if a storage with the given path already exists.protected RrdBackendCreates RrdMemoryBackend object.Methods inherited from class org.rrd4j.core.RrdBackendFactory
addActiveFactories, addFactories, buildGenericUri, checkClosing, close, exists, findFactory, getActiveFactories, getBackend, getBackend, getCanonicalUri, getDefaultFactory, getFactory, getName, getPath, getRootUri, getScheme, getUri, registerAndSetAsDefaultFactory, registerFactory, resolve, setActiveFactories, setDefaultFactory, shouldValidateHeader, shouldValidateHeader
-
Field Details
-
backends
-
-
Constructor Details
-
RrdMemoryBackendFactory
public RrdMemoryBackendFactory()
-
-
Method Details
-
open
Creates RrdMemoryBackend object.- Specified by:
openin classRrdBackendFactory- Throws:
IOException
-
canStore
- Overrides:
canStorein classRrdBackendFactory
-
exists
Determines if a storage with the given path already exists. Method to determine if a memory storage with the given ID already exists.- Specified by:
existsin classRrdBackendFactory- Parameters:
id- Storage path- Returns:
- a boolean.
-
delete
Removes the storage with the given ID from the memory.- Parameters:
id- Storage ID- Returns:
- a boolean.
-