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 NodeLifecycleStatevoidPuts the current node into theNodeLifecycleState.RUNNINGstatevoidPuts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARYstatevoidPuts the current node into theNodeLifecycleState.STARTINGstateSubmits pause cluster request.pauseCluster(@NotNull NodeLifecycleState fakeNodeLifecycleState) Submits pause cluster request with the context of the current node state being fakeNodeLifecycleState.@NotNull NodeLifecycleStatePuts the current node into theNodeLifecycleState.PREPARING_FOR_RESTARTstatebooleanRefreshes the cachedNodeLifecycleState@NotNull NodeLifecycleStatePuts the cluster into theNodeLifecycleState.RUNNINGstate
-
Method Details
-
nodeStarting
void nodeStarting()Puts the current node into theNodeLifecycleState.STARTINGstate -
nodeRunning
void nodeRunning()Puts the current node into theNodeLifecycleState.RUNNINGstate -
nodeRunningAsSecondary
void nodeRunningAsSecondary()Puts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARYstate -
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_RESTARTstate- Returns:
NodeLifecycleStateof the current node
-
resumeCluster
Puts the cluster into theNodeLifecycleState.RUNNINGstate- Returns:
NodeLifecycleStateof the current node
-
getNodeLifecycleState
- Returns:
- gets the
NodeLifecycleStateof the current node
-
getBufferedNodeLifecycleState
- Returns:
- gets the cached
NodeLifecycleStateof 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
ClusterLifecycleStateof the cluster
-