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
.Modifier and Type | Class and Description |
---|---|
static class |
StateLockOptions.GraceMode
Defines the grace mode of exclusive locking of the state-lock.
|
Constructor and Description |
---|
StateLockOptions(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() |
StateLockOptions.GraceMode |
getGraceMode() |
public StateLockOptions(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 StateLockOptions.GraceMode getGraceMode()
StateLockOptions.GraceMode
of this optionspublic 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.