public class RrdNioBackend extends ByteBufferBackend implements RrdFileBackend
BYTEORDER
Modifier | Constructor and Description |
---|---|
protected |
RrdNioBackend(String path,
boolean readOnly,
RrdSyncThreadPool threadPool,
int syncPeriod)
Creates RrdFileBackend object for the given file path, backed by java.nio.* classes.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying RRD file.
|
String |
getCanonicalPath()
Returns canonical path to the file on the disk.
|
long |
getLength()
Returns the number of RRD bytes in the underlying storage.
|
protected void |
setLength(long newLength)
Sets the number of bytes in the underlying RRD storage.
|
protected void |
sync()
This method forces all data cached in memory but not yet stored in the file,
to be stored in it.
|
getCharBuffer, isDirty, read, readDouble, readDouble, readInt, readLong, readShort, rrdClose, setByteBuffer, write, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeShort, writeString
done, getFactory, getPath, getUri, isCachingAllowed, isInstanceCreated, readAll, readString, writeString
protected RrdNioBackend(String path, boolean readOnly, RrdSyncThreadPool threadPool, int syncPeriod) throws IOException
path
- Path to a filereadOnly
- True, if file should be open in a read-only mode. False otherwisesyncPeriod
- See RrdNioBackendFactory.setSyncPeriod(int)
for explanationthreadPool
- a RrdSyncThreadPool
object, it can be null.IOException
- Thrown in case of I/O errorprotected void setLength(long newLength) throws IOException
setLength
in class RrdBackend
newLength
- Length of the underlying RRD storage in bytes.IllegalArgumentException
- if the length is bigger that the possible mapping position (2GiB).IOException
- Thrown in case of I/O error.public void close() throws IOException
close
in class ByteBufferBackend
IOException
- Thrown in case of I/O error.protected void sync()
public long getLength() throws IOException
RrdBackend
getLength
in class RrdBackend
IOException
- Thrown in case of I/O error.public String getCanonicalPath() throws IOException
RrdFileBackend
getCanonicalPath
in interface RrdFileBackend
IOException
- Thrown in case of I/O error