public class RrdMemoryBackend extends RrdBackend
Modifier | Constructor and Description |
---|---|
protected |
RrdMemoryBackend(String path) |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method is required by the base class definition, but it does not
releases any memory resources at all.
|
long |
getLength()
Returns the number of RRD bytes held in memory.
|
protected boolean |
isCachingAllowed()
This method is overridden to disable high-level caching in frontend JRobin classes.
|
protected void |
read(long offset,
byte[] b)
Reads an array of bytes from the underlying storage starting from the given
storage offset.
|
protected void |
setLength(long newLength)
Reserves a memory section as a RRD storage.
|
protected void |
write(long offset,
byte[] b)
Writes an array of bytes to the underlying storage starting from the given
storage offset.
|
getPath, isInstanceCreated, isReadOnly, readAll, readDouble, readDouble, readInt, readLong, readString, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeString
protected RrdMemoryBackend(String path)
protected void write(long offset, byte[] b)
RrdBackend
write
in class RrdBackend
offset
- Storage offset.b
- Array of bytes that should be copied to the underlying storageprotected void read(long offset, byte[] b) throws IOException
RrdBackend
read
in class RrdBackend
offset
- Storage offset.b
- Array which receives bytes from the underlying storageIOException
- Thrown in case of I/O errorpublic long getLength()
getLength
in class RrdBackend
protected void setLength(long newLength) throws IOException
setLength
in class RrdBackend
newLength
- Number of bytes held in memory.IOException
- Thrown in case of I/O error.public void close()
close
in class RrdBackend
protected boolean isCachingAllowed()
isCachingAllowed
in class RrdBackend
false
. There is no need to cache anything in high-level classes
since all RRD bytes are already in memory.