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
Constructors Constructor Description 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 Summary
-
-
-
Constructor Detail
-
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 Detail
-
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
public CompletableFuture<NodeLifecycleState> 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
@NotNull public @NotNull NodeLifecycleState prepareNodeForRestart()
Description copied from interface:ClusterAwareLifecycleManagerPuts the current node into theNodeLifecycleState.PREPARING_FOR_RESTARTstate- Specified by:
prepareNodeForRestartin interfaceClusterAwareLifecycleManager- Returns:
NodeLifecycleStateof the current node
-
resumeCluster
@NotNull public @NotNull NodeLifecycleState resumeCluster()
Description copied from interface:ClusterAwareLifecycleManagerPuts the cluster into theNodeLifecycleState.RUNNINGstate- Specified by:
resumeClusterin interfaceClusterAwareLifecycleManager- Returns:
NodeLifecycleStateof the current node
-
getNodeLifecycleState
@NotNull public @NotNull NodeLifecycleState getNodeLifecycleState()
- Specified by:
getNodeLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- gets the
NodeLifecycleStateof the current node
-
getBufferedNodeLifecycleState
@NotNull public @NotNull NodeLifecycleState 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
@NotNull public @NotNull ClusterLifecycleState getClusterLifecycleState()
- Specified by:
getClusterLifecycleStatein interfaceClusterAwareLifecycleManager- Returns:
- gets the
ClusterLifecycleStateof the cluster
-
-