public class StateLockOptions extends Object
Lock.tryLock()
- Thread.sleep(long)
calls.
2- Call Lock.tryLock(long, TimeUnit)
for a long duration
a- Duration configured by PropertyKey.MASTER_BACKUP_STATE_LOCK_FORCED_DURATION
.
b- Shared lock holders/waiter will regularly be interrupted if
PropertyKey.MASTER_BACKUP_STATE_LOCK_INTERRUPT_CYCLE_ENABLED
is true.
- Interrupt interval defined by
PropertyKey.MASTER_BACKUP_STATE_LOCK_INTERRUPT_CYCLE_INTERVAL
.Constructor and Description |
---|
StateLockOptions(GraceMode graceMode,
long graceCycleTryMs,
long graceCycleSleepMs,
long graceCycleTimeoutMs)
Creates an option class that is consulted while taking a state-lock exclusively
from
StateLockManager . |
Modifier and Type | Method and Description |
---|---|
static StateLockOptions |
defaults()
This default instance is effectively the same as locking on write-lock.
|
static StateLockOptions |
defaultsForDailyBackup() |
static StateLockOptions |
defaultsForShellBackup() |
long |
getGraceCycleSleepMs() |
long |
getGraceCycleTimeoutMs() |
long |
getGraceCycleTryMs() |
GraceMode |
getGraceMode() |
public StateLockOptions(GraceMode graceMode, long graceCycleTryMs, long graceCycleSleepMs, long graceCycleTimeoutMs)
StateLockManager
.graceMode
- the mode for grace-cyclegraceCycleTryMs
- grace-cycle try durationgraceCycleSleepMs
- grace-cycle sleep durationgraceCycleTimeoutMs
- total grace-cycle durationpublic long getGraceCycleTryMs()
public long getGraceCycleSleepMs()
public long getGraceCycleTimeoutMs()
public static StateLockOptions defaultsForShellBackup()
StateLockOptions
default instance for shell backupspublic static StateLockOptions defaultsForDailyBackup()
StateLockOptions
default instance for daily backupspublic static StateLockOptions defaults()
StateLockOptions
defaultCopyright © 2023. All Rights Reserved.