Class FileBackedClusterInfoManager
java.lang.Object
com.atlassian.bamboo.cluster.state.FileBackedClusterInfoManager
- All Implemented Interfaces:
ClusterInfoManager
-
Constructor Summary
ConstructorsConstructorDescriptionFileBackedClusterInfoManager(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 TypeMethodDescriptionvoidBE CAREFUL when calling outside the BambooContainer context.@NotNull Optional<ClusterInfoData>@NotNull Optional<ClusterInfoData>voidRefreshes the cluster info caches.booleansetLifecycle(@NotNull NodeLifecycleState nodeLifecycleState) Sets theNodeLifecycleStatecoming 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:ClusterInfoManagerRefreshes the cluster info caches.- Specified by:
refreshBufferedClusterInfoDatain 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:
createInitialStateIfMissingin interfaceClusterInfoManager
-
getClusterInfoData
- Specified by:
getClusterInfoDatain interfaceClusterInfoManager- Returns:
- gets the current
ClusterInfoDataif present, empty otherwise
-
getBufferedClusterInfoData
- Specified by:
getBufferedClusterInfoDatain interfaceClusterInfoManager- Returns:
- gets the eventually consistent
ClusterInfoDataif present, empty otherwise
-
setLifecycle
Description copied from interface:ClusterInfoManagerSets theNodeLifecycleStatecoming 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:
setLifecyclein interfaceClusterInfoManager- Parameters:
nodeLifecycleState- new lifecycle state originating from node- Returns:
- true if the state was changed, false otherwise
-