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. UseNodeLifecycleProvider
to get current node life cycle.- Since:
- 9.5
-
-
Method Summary
-
-
-
Method Detail
-
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
@NotNull @NotNull NodeLifecycleState prepareNodeForRestart()
Puts the current node into theNodeLifecycleState.PREPARING_FOR_RESTART
state- Returns:
NodeLifecycleState
of the current node
-
resumeCluster
@NotNull @NotNull NodeLifecycleState resumeCluster()
Puts the cluster into theNodeLifecycleState.RUNNING
state- Returns:
NodeLifecycleState
of the current node
-
getNodeLifecycleState
@NotNull @NotNull NodeLifecycleState getNodeLifecycleState()
- Returns:
- gets the
NodeLifecycleState
of the current node
-
getBufferedNodeLifecycleState
@NotNull @NotNull NodeLifecycleState 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
@NotNull @NotNull ClusterLifecycleState getClusterLifecycleState()
- Returns:
- gets the
ClusterLifecycleState
of the cluster
-
-