Package com.atlassian.bamboo
Interface ClusterAwareLifecycleManager
- All Known Implementing Classes:
ClusterAwareLifecycleManagerImpl
@Internal
public interface ClusterAwareLifecycleManager
Manages the cluster life cycle.
Responsible for setting different states for both the whole cluster and the current node.
Use
NodeLifecycleProvider
to get current node life cycle.- Since:
- 9.5
-
Method Summary
Modifier and TypeMethodDescription@NotNull NodeLifecycleState
@NotNull ClusterLifecycleState
@NotNull NodeLifecycleState
void
Puts the current node into theNodeLifecycleState.RUNNING
statevoid
Puts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARY
statevoid
Puts the current node into theNodeLifecycleState.STARTING
stateSubmits pause cluster request.pauseCluster
(@NotNull NodeLifecycleState fakeNodeLifecycleState) Submits pause cluster request with the context of the current node state being fakeNodeLifecycleState.@NotNull NodeLifecycleState
Puts the current node into theNodeLifecycleState.PREPARING_FOR_RESTART
stateboolean
Refreshes the cachedNodeLifecycleState
@NotNull NodeLifecycleState
Puts the cluster into theNodeLifecycleState.RUNNING
state
-
Method Details
-
nodeStarting
void nodeStarting()Puts the current node into theNodeLifecycleState.STARTING
state -
nodeRunning
void nodeRunning()Puts the current node into theNodeLifecycleState.RUNNING
state -
nodeRunningAsSecondary
void nodeRunningAsSecondary()Puts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARY
state -
pauseCluster
CompletableFuture<NodeLifecycleState> pauseCluster()Submits pause cluster request.- Returns:
- Future for pause cluster operation
-
pauseCluster
CompletableFuture<NodeLifecycleState> pauseCluster(@NotNull @NotNull NodeLifecycleState fakeNodeLifecycleState) Submits pause cluster request with the context of the current node state being fakeNodeLifecycleState. This method is considered extremely unsafe because calling it might end up with an undermined node state.- Parameters:
fakeNodeLifecycleState
- Node state in which context the pause cluster request is executed- Returns:
- Future for force pause cluster operation
-
prepareNodeForRestart
Puts the current node into theNodeLifecycleState.PREPARING_FOR_RESTART
state- Returns:
NodeLifecycleState
of the current node
-
resumeCluster
Puts the cluster into theNodeLifecycleState.RUNNING
state- Returns:
NodeLifecycleState
of the current node
-
getNodeLifecycleState
- Returns:
- gets the
NodeLifecycleState
of the current node
-
getBufferedNodeLifecycleState
- Returns:
- gets the cached
NodeLifecycleState
of the current node, the result is eventually consistent
-
refreshNodeLifecycleState
boolean refreshNodeLifecycleState()Refreshes the cachedNodeLifecycleState
- Returns:
- whether the refresh was successfully performed
-
getClusterLifecycleState
- Returns:
- gets the
ClusterLifecycleState
of the cluster
-