@RrdBackendAnnotation(name="SAFE", shouldValidateHeader=true, cachingAllowed=false) public class RrdSafeFileBackendFactory extends RrdRandomAccessFileBackendFactory
RrdSafeFileBackend objects.
Because of locking, each RrdDb can be open only once even from within the JVM. So usage of the
RrdDbPool is mandatory with this backend.
| Modifier and Type | Field and Description |
|---|---|
static long |
LOCK_RETRY_PERIOD
Default time between two consecutive file locking attempts.
|
static long |
LOCK_WAIT_TIME
Default time (in milliseconds) this backend will wait for a file lock.
|
cachingAllowed, DEFAULTFACTORY, name, scheme, validateHeader| Constructor and Description |
|---|
RrdSafeFileBackendFactory()
Generate a factory using the default system wide lock settings
|
RrdSafeFileBackendFactory(long lockWaitTime,
long lockRetryPeriod)
Generate a factory with custom lock settings
|
| Modifier and Type | Method and Description |
|---|---|
static long |
getLockRetryPeriod()
Returns time between two consecutive file locking attempts.
|
static long |
getLockWaitTime()
Returns time this backend will wait for a file lock.
|
protected RrdBackend |
open(String path,
boolean readOnly) |
static void |
setLockRetryPeriod(long lockRetryPeriod)
Sets time between two consecutive file locking attempts.
|
static void |
setLockWaitTime(long lockWaitTime)
Sets time this backend will wait for a file lock.
|
canStore, exists, getCanonicalUri, getPath, getUriaddActiveFactories, buildGenericUri, checkClosing, close, exists, findFactory, getActiveFactories, getBackend, getBackend, getDefaultFactory, getName, getRootUri, getScheme, resolve, setActiveFactories, shouldValidateHeader, shouldValidateHeaderpublic static final long LOCK_RETRY_PERIOD
public static final long LOCK_WAIT_TIME
public RrdSafeFileBackendFactory()
public RrdSafeFileBackendFactory(long lockWaitTime,
long lockRetryPeriod)
lockWaitTime - wait time in mslockRetryPeriod - retry period in mspublic static long getLockRetryPeriod()
public static long getLockWaitTime()
protected RrdBackend open(String path, boolean readOnly) throws IOException
Creates RrdFileBackend object for the given file path.
Creates RrdSafeFileBackend object for the given file path.
open in class RrdRandomAccessFileBackendFactoryIOExceptionpublic static void setLockRetryPeriod(long lockRetryPeriod)
lockRetryPeriod - time (in milliseconds) between two consecutive file locking attempts.public static void setLockWaitTime(long lockWaitTime)
lockWaitTime - Maximum lock wait time (in milliseconds)