Package org.rrd4j.core
Class RrdMemoryBackend
java.lang.Object
org.rrd4j.core.RrdBackend
org.rrd4j.core.ByteBufferBackend
org.rrd4j.core.RrdMemoryBackend
public class RrdMemoryBackend extends ByteBufferBackend
Backend to be used to store all RRD bytes in memory.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedRrdMemoryBackend(String path, AtomicReference<ByteBuffer> refbb)Constructor for RrdMemoryBackend. -
Method Summary
Modifier and Type Method Description protected voidclose()This method is required by the base class definition, but it does not releases any memory resources at all.longgetLength()Returns the number of RRD bytes in the underlying storage.protected voidsetLength(long length)Sets the number of bytes in the underlying RRD storage.Methods inherited from class org.rrd4j.core.ByteBufferBackend
getCharBuffer, isDirty, read, readDouble, readDouble, readInt, readLong, readShort, rrdClose, setByteBuffer, write, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeShort, writeStringMethods inherited from class org.rrd4j.core.RrdBackend
done, getFactory, getPath, getUri, isCachingAllowed, isInstanceCreated, readAll, readString, writeString
-
Constructor Details
-
RrdMemoryBackend
Constructor for RrdMemoryBackend.
- Parameters:
path- aStringobject.refbb-
-
-
Method Details
-
setLength
Description copied from class:RrdBackendSets the number of bytes in the underlying RRD storage. This method is called only once, immediately after a new RRD storage gets created.- Specified by:
setLengthin classRrdBackend- Parameters:
length- Length of the underlying RRD storage in bytes.- Throws:
IOException- Thrown in case of I/O error.
-
getLength
Description copied from class:RrdBackendReturns the number of RRD bytes in the underlying storage.- Specified by:
getLengthin classRrdBackend- Returns:
- Number of RRD bytes in the storage.
- Throws:
IOException- Thrown in case of I/O error.
-
close
This method is required by the base class definition, but it does not releases any memory resources at all.- Overrides:
closein classByteBufferBackend- Throws:
IOException- if any.
-