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
ConstructorDescriptionClusterAwareLifecycleManagerImpl
(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 NodeLifecycleState
void
Puts the current node into theNodeLifecycleState.RUNNING
statevoid
Puts the current node into theNodeLifecycleState.RUNNING_AS_SECONDARY
statevoid
Puts the current node into theNodeLifecycleState.STARTING
stateSubmits pause cluster request.pauseCluster
(@NotNull NodeLifecycleState fakeNodeLifecycleState) Submits pause cluster request with the context of the current node state being fakeNodeLifecycleState.@NotNull NodeLifecycleState
Puts the current node into theNodeLifecycleState.PREPARING_FOR_RESTART
stateboolean
Refreshes the cachedNodeLifecycleState
@NotNull NodeLifecycleState
Puts the cluster into theNodeLifecycleState.RUNNING
state
-
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: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
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
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
Description copied from interface:ClusterAwareLifecycleManager
Puts the cluster into theNodeLifecycleState.RUNNING
state- Specified by:
resumeCluster
in interfaceClusterAwareLifecycleManager
- Returns:
NodeLifecycleState
of the current node
-
getNodeLifecycleState
- Specified by:
getNodeLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- gets the
NodeLifecycleState
of the current node
-
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
- Specified by:
getClusterLifecycleState
in interfaceClusterAwareLifecycleManager
- Returns:
- gets the
ClusterLifecycleState
of the cluster
-