Package com.atlassian.bamboo
Class ClusterAwareLifecycleManagerImpl
java.lang.Object
com.atlassian.bamboo.ClusterAwareLifecycleManagerImpl
- All Implemented Interfaces:
ClusterAwareLifecycleManager
public class ClusterAwareLifecycleManagerImpl
extends Object
implements ClusterAwareLifecycleManager
-
Constructor Summary
ConstructorsConstructorDescriptionClusterAwareLifecycleManagerImpl(PlanExecutionLockService planExecutionLockService, BambooAuthenticationContext bambooAuthenticationContext, AuditLogService auditLogService, MessageListenerContainerController messageListenerContainerController, ChangeDetectionController changeDetectionController, IndexerManager indexerManager, org.quartz.Scheduler scheduler, ElasticInstanceManager elasticInstanceManager, AwsAccountBean awsAccountBean, BambooPluginManager bambooPluginManager, com.atlassian.plugin.metadata.PluginMetadataManager pluginMetadataManager, ElasticAccountBean elasticAccountBean, FlushableBuildLoggerManager buildLoggerManager, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, ClusterInfoManager clusterInfoManager, PluginClusterAwareService pluginClusterAwareService) -
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
-
Constructor Details
-
ClusterAwareLifecycleManagerImpl
public ClusterAwareLifecycleManagerImpl(PlanExecutionLockService planExecutionLockService, BambooAuthenticationContext bambooAuthenticationContext, AuditLogService auditLogService, MessageListenerContainerController messageListenerContainerController, ChangeDetectionController changeDetectionController, IndexerManager indexerManager, org.quartz.Scheduler scheduler, ElasticInstanceManager elasticInstanceManager, AwsAccountBean awsAccountBean, BambooPluginManager bambooPluginManager, com.atlassian.plugin.metadata.PluginMetadataManager pluginMetadataManager, ElasticAccountBean elasticAccountBean, FlushableBuildLoggerManager buildLoggerManager, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, ClusterInfoManager clusterInfoManager, PluginClusterAwareService pluginClusterAwareService)
-
-
Method Details
-
nodeStarting
public void nodeStarting()Description copied from interface:ClusterAwareLifecycleManagerPuts the current node into theNodeLifecycleState.STARTINGstate- Specified by:
nodeStartingin interfaceClusterAwareLifecycleManager
-
nodeRunning
public void nodeRunning()Description copied from interface:ClusterAwareLifecycleManagerPuts the current node into theNodeLifecycleState.RUNNINGstate- Specified by:
nodeRunningin interfaceClusterAwareLifecycleManager
-
nodeRunningAsSecondary
public void nodeRunningAsSecondary()Description copied from interface:ClusterAwareLifecycleManagerPuts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARYstate- Specified by:
nodeRunningAsSecondaryin interfaceClusterAwareLifecycleManager
-
pauseCluster
Description copied from interface:ClusterAwareLifecycleManagerSubmits pause cluster request.- Specified by:
pauseClusterin interfaceClusterAwareLifecycleManager- Returns:
- Future for pause cluster operation
-
pauseCluster
public CompletableFuture<NodeLifecycleState> pauseCluster(@NotNull @NotNull NodeLifecycleState fakeNodeLifecycleState) Description copied from interface:ClusterAwareLifecycleManagerSubmits 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.- Specified by:
pauseClusterin interfaceClusterAwareLifecycleManager- Parameters:
fakeNodeLifecycleState- Node state in which context the pause cluster request is executed- Returns:
- Future for force pause cluster operation
-
prepareNodeForRestart
Description copied from interface:ClusterAwareLifecycleManagerPuts the current node into theNodeLifecycleState.PREPARING_FOR_RESTARTstate- Specified by:
prepareNodeForRestartin interfaceClusterAwareLifecycleManager- Returns:
NodeLifecycleStateof the current node
-
resumeCluster
Description copied from interface:ClusterAwareLifecycleManagerPuts the cluster into theNodeLifecycleState.RUNNINGstate- Specified by:
resumeClusterin interfaceClusterAwareLifecycleManager- Returns:
NodeLifecycleStateof the current node
-
getNodeLifecycleState
- Specified by:
getNodeLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- gets the
NodeLifecycleStateof the current node
-
getBufferedNodeLifecycleState
- Specified by:
getBufferedNodeLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- gets the cached
NodeLifecycleStateof the current node, the result is eventually consistent
-
refreshNodeLifecycleState
public boolean refreshNodeLifecycleState()Description copied from interface:ClusterAwareLifecycleManagerRefreshes the cachedNodeLifecycleState- Specified by:
refreshNodeLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- whether the refresh was successfully performed
-
getClusterLifecycleState
- Specified by:
getClusterLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- gets the
ClusterLifecycleStateof the cluster
-