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:ClusterAwareLifecycleManager
Puts the current node into theNodeLifecycleState.STARTING
state- Specified by:
nodeStarting
in interfaceClusterAwareLifecycleManager
-
nodeRunning
public void nodeRunning()
Description copied from interface:ClusterAwareLifecycleManager
Puts the current node into theNodeLifecycleState.RUNNING
state- Specified by:
nodeRunning
in interfaceClusterAwareLifecycleManager
-
nodeRunningAsSecondary
public void nodeRunningAsSecondary()
Description copied from interface:ClusterAwareLifecycleManager
Puts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARY
state- Specified by:
nodeRunningAsSecondary
in interfaceClusterAwareLifecycleManager
-
pauseCluster
public CompletableFuture<NodeLifecycleState> pauseCluster()
Description copied from interface:ClusterAwareLifecycleManager
Submits pause cluster request.- Specified by:
pauseCluster
in interfaceClusterAwareLifecycleManager
- Returns:
- Future for pause cluster operation
-
pauseCluster
public CompletableFuture<NodeLifecycleState> pauseCluster(@NotNull @NotNull NodeLifecycleState fakeNodeLifecycleState)
Description copied from interface:ClusterAwareLifecycleManager
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.- Specified by:
pauseCluster
in 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:ClusterAwareLifecycleManager
Puts the current node into theNodeLifecycleState.PREPARING_FOR_RESTART
state- Specified by:
prepareNodeForRestart
in interfaceClusterAwareLifecycleManager
- Returns:
NodeLifecycleState
of the current node
-
resumeCluster
@NotNull public @NotNull NodeLifecycleState resumeCluster()
Description copied from interface:ClusterAwareLifecycleManager
Puts the cluster into theNodeLifecycleState.RUNNING
state- Specified by:
resumeCluster
in interfaceClusterAwareLifecycleManager
- Returns:
NodeLifecycleState
of the current node
-
getNodeLifecycleState
@NotNull public @NotNull NodeLifecycleState getNodeLifecycleState()
- Specified by:
getNodeLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- gets the
NodeLifecycleState
of the current node
-
getBufferedNodeLifecycleState
@NotNull public @NotNull NodeLifecycleState getBufferedNodeLifecycleState()
- Specified by:
getBufferedNodeLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- gets the cached
NodeLifecycleState
of the current node, the result is eventually consistent
-
refreshNodeLifecycleState
public boolean refreshNodeLifecycleState()
Description copied from interface:ClusterAwareLifecycleManager
Refreshes the cachedNodeLifecycleState
- Specified by:
refreshNodeLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- whether the refresh was successfully performed
-
getClusterLifecycleState
@NotNull public @NotNull ClusterLifecycleState getClusterLifecycleState()
- Specified by:
getClusterLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- gets the
ClusterLifecycleState
of the cluster
-
-