Package org.rrd4j.core
Class RrdSafeFileBackend
java.lang.Object
org.rrd4j.core.RrdBackend
org.rrd4j.core.RrdRandomAccessFileBackend
org.rrd4j.core.RrdSafeFileBackend
- All Implemented Interfaces:
RrdFileBackend
public class RrdSafeFileBackend extends RrdRandomAccessFileBackend
Backend which is used to store RRD data to ordinary files on the disk, using locking. This backend
is SAFE: it locks the underlying RRD file during update/fetch operations, and caches only static
parts of a RRD file in memory. Therefore, this backend is safe to be used when RRD files should
be shared between several JVMs at the same time. However, this backend is a little bit slow
since it does not use fast java.nio.* package (it's still based on the RandomAccessFile class).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
RrdSafeFileBackend.Counters
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RrdSafeFileBackend(String path, long lockWaitTime, long lockRetryPeriod)
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object. -
Method Summary
Modifier and Type Method Description void
close()
close.static String
getLockInfo()
getLockInfo.Methods inherited from class org.rrd4j.core.RrdRandomAccessFileBackend
getCanonicalPath, getLength, read, setLength, write
Methods inherited from class org.rrd4j.core.RrdBackend
done, getCharBuffer, getFactory, getPath, getUri, isCachingAllowed, isInstanceCreated, readAll, readDouble, readDouble, readInt, readLong, readShort, readString, rrdClose, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeShort, writeString, writeString
-
Constructor Details
-
RrdSafeFileBackend
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object.- Parameters:
path
- Path to a filelockWaitTime
- lock waiting time in milliseconds.lockRetryPeriod
- lock retry period in milliseconds.- Throws:
IOException
- Thrown in case of I/O error.
-
-
Method Details
-
close
close.
- Overrides:
close
in classRrdRandomAccessFileBackend
- Throws:
IOException
- if any.
-
getLockInfo
getLockInfo.
- Returns:
- a
String
object.
-