public class StateLockManager extends Object
lockShared()
will be used by user RPCs and may throw InterruptedException
based on options passed to lockExclusive(StateLockOptions)
.
lockExclusive(StateLockOptions)
will be used by metadata backups in order to
guarantee paused state during critical tasks.Constructor and Description |
---|
StateLockManager()
Creates a new state-lock manager.
|
Modifier and Type | Method and Description |
---|---|
boolean |
interruptCycleTicking() |
LockResource |
lockExclusive(StateLockOptions lockOptions)
Locks the state exclusively.
|
LockResource |
lockShared()
Locks the state shared.
|
void |
mastersStartedCallback()
This is called by owning process in order to signal that
the state is read completely and masters are started.
|
public void mastersStartedCallback()
public LockResource lockShared() throws InterruptedException
InterruptedException
public LockResource lockExclusive(StateLockOptions lockOptions) throws TimeoutException, InterruptedException
lockOptions
- exclusive lock optionsTimeoutException
- if locking times outInterruptedException
- if interrupting during lockingpublic boolean interruptCycleTicking()
true
if the interrupt-cycle has been ticked and tickingCopyright © 2023. All Rights Reserved.