Class FileBackedClusterInfoManager
java.lang.Object
com.atlassian.bamboo.cluster.state.FileBackedClusterInfoManager
- All Implemented Interfaces:
ClusterInfoManager
-
Constructor Summary
ConstructorDescriptionFileBackedClusterInfoManager
(BambooClusterLockService bambooClusterLockService, XStreamManager xStreamManage, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster) FileBackedClusterInfoManager
(BambooClusterLockService bambooClusterLockService, XStreamManager xStreamManager, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, File clusterInfoDirectory, boolean initialStartedValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
BE CAREFUL when calling outside the BambooContainer context.@NotNull Optional<ClusterInfoData>
@NotNull Optional<ClusterInfoData>
void
Refreshes the cluster info caches.boolean
setLifecycle
(@NotNull NodeLifecycleState nodeLifecycleState) Sets theNodeLifecycleState
coming from the current node.
-
Constructor Details
-
FileBackedClusterInfoManager
public FileBackedClusterInfoManager(BambooClusterLockService bambooClusterLockService, XStreamManager xStreamManage, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster) -
FileBackedClusterInfoManager
@VisibleForTesting public FileBackedClusterInfoManager(BambooClusterLockService bambooClusterLockService, XStreamManager xStreamManager, BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, File clusterInfoDirectory, boolean initialStartedValue)
-
-
Method Details
-
refreshBufferedClusterInfoData
public void refreshBufferedClusterInfoData()Description copied from interface:ClusterInfoManager
Refreshes the cluster info caches.- Specified by:
refreshBufferedClusterInfoData
in interfaceClusterInfoManager
-
createInitialStateIfMissing
public void createInitialStateIfMissing()BE CAREFUL when calling outside the BambooContainer context. This method for a primary node will always recreate the file with its initial state. This may lead to the cluster corruption.- Specified by:
createInitialStateIfMissing
in interfaceClusterInfoManager
-
getClusterInfoData
- Specified by:
getClusterInfoData
in interfaceClusterInfoManager
- Returns:
- gets the current
ClusterInfoData
if present, empty otherwise
-
getBufferedClusterInfoData
- Specified by:
getBufferedClusterInfoData
in interfaceClusterInfoManager
- Returns:
- gets the eventually consistent
ClusterInfoData
if present, empty otherwise
-
setLifecycle
Description copied from interface:ClusterInfoManager
Sets theNodeLifecycleState
coming from the current node. Based on implementation, the node lifecycle states might be internally mapped to different cluster states or not affect the cluster state at all.- Specified by:
setLifecycle
in interfaceClusterInfoManager
- Parameters:
nodeLifecycleState
- new lifecycle state originating from node- Returns:
- true if the state was changed, false otherwise
-