public class RrdMemoryBackendFactory extends RrdBackendFactory
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.
Modifier and Type | Field and Description |
---|---|
protected Map<String,RrdMemoryBackend> |
backends |
Constructor and Description |
---|
RrdMemoryBackendFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(String id)
Removes the storage with the given ID from the memory.
|
protected boolean |
exists(String id)
Determines if a storage with the given path already exists.
|
String |
getName()
Returns the name of this factory.
|
protected RrdBackend |
open(String id,
boolean readOnly)
Creates RrdBackend object for the given storage path.
|
protected boolean |
shouldValidateHeader(String path)
Determines if the header should be validated.
|
getDefaultFactory, getFactory, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory
protected final Map<String,RrdMemoryBackend> backends
protected RrdBackend open(String id, boolean readOnly) throws IOException
open
in class RrdBackendFactory
id
- Storage pathreadOnly
- True, if the storage should be accessed in read/only mode.
False otherwise.IOException
- Thrown in case of I/O error.protected boolean exists(String id)
exists
in class RrdBackendFactory
id
- Storage pathprotected boolean shouldValidateHeader(String path) throws IOException
shouldValidateHeader
in class RrdBackendFactory
path
- Storage pathIOException
- if header validation failspublic boolean delete(String id)
id
- Storage IDpublic String getName()
getName
in class RrdBackendFactory
Copyright © 2015. All rights reserved.