public class RrdNioBackend
extends org.jrobin.core.RrdFileBackend
| Modifier | Constructor and Description |
|---|---|
protected |
RrdNioBackend(String path,
boolean readOnly,
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.
|
static Timer |
getFileSyncTimer() |
protected void |
read(long offset,
byte[] b)
Reads a number of bytes from the RRD file on the disk
|
static void |
setFileSyncTimer(Timer timer)
Sets the timer.
|
protected void |
setLength(long newLength)
Sets length of the underlying RRD file.
|
protected void |
sync()
This method forces all data cached in memory but not yet stored in the file,
to be stored in it.
|
protected void |
write(long offset,
byte[] b)
Writes bytes to the underlying RRD file on the disk
|
protected RrdNioBackend(String path, boolean readOnly, 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 explanationIOException - Thrown in case of I/O errorpublic static Timer getFileSyncTimer()
public static void setFileSyncTimer(Timer timer)
timer - timer to synchronize files.protected void setLength(long newLength)
throws IOException
setLength in class org.jrobin.core.RrdFileBackendnewLength - Length of the RRD fileIOException - Thrown in case of I/O error.protected void write(long offset,
byte[] b)
throws IOException
write in class org.jrobin.core.RrdFileBackendoffset - Starting file offsetb - Bytes to be written.IOExceptionprotected void read(long offset,
byte[] b)
throws IOException
read in class org.jrobin.core.RrdFileBackendoffset - Starting file offsetb - Buffer which receives bytes read from the file.IOExceptionpublic void close()
throws IOException
close in class org.jrobin.core.RrdFileBackendIOException - Thrown in case of I/O errorprotected void sync()
Copyright © 2008–2020 Emeric Vernat. All rights reserved.