Class PerNodeLocalQueueManager
- java.lang.Object
-
- com.atlassian.bamboo.cluster.PerNodeLocalQueueManager
-
public class PerNodeLocalQueueManager extends Object
Stores all active queuesPerNodeLocalQueueand manages the queue dispatchersPerNodeLocalQueueDispatcherImplWe are storing events only for the live nodes (the nodes which last successful heartbeat was within
BambooClusterSettings.CLUSTER_HEARTBEAT_ALIVE_TIMEOUT_IN_SECONDS). If any of the live nodes disappears, we are removing its queue, dispatcher and events, as a result these events won't be ever sent to the node. To make it work, we need to force the node that became NOT live to not ever become operational once again without explicit restart -NodeAliveWatchdogJobmakes sure this requirement is met. If the node was unresponsive but never became officially not alive (it came back withinBambooClusterSettings.CLUSTER_HEARTBEAT_ALIVE_TIMEOUT_IN_SECONDS), we send all the buffered events once it comes back.The events are sent in the asynchronous way, and no response is expected from the node. This manager should be used for events propagation only.
- Since:
- 9.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPerNodeLocalQueueManager.Status
-
Constructor Summary
Constructors Constructor Description PerNodeLocalQueueManager(BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, PerNodeLocalQueueFactory perNodeLocalQueueFactory, com.atlassian.event.api.EventPublisher eventPublisher, TapePerNodeLocalQueueCriticalHandlerFactory tapePerNodeLocalQueueCriticalHandlerFactory, GrpcChannelService grpcChannelService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddToAllQueues(@NotNull CrossNodesEvent dataToAdd)protected CrossNodesEventsServiceGrpc.CrossNodesEventsServiceStubcreateStub(@NotNull io.grpc.ManagedChannel channel)voidfinalDestroy()@NotNull PerNodeLocalQueueManager.StatusgetManagerLifecycleStatusAndStartIfNeeded()voidonNodeBecameLive(NodeBecameLiveEvent event)voidonNodeBecameOffline(NodeBecameOfflineEvent event)voidonPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)voidonPluginFrameworkStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkStartingEvent event)voidregisterEventPublisher()voidstart()This is invoked before plugin system has been started.voidstop()
-
-
-
Constructor Detail
-
PerNodeLocalQueueManager
@Inject public PerNodeLocalQueueManager(BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, PerNodeLocalQueueFactory perNodeLocalQueueFactory, com.atlassian.event.api.EventPublisher eventPublisher, TapePerNodeLocalQueueCriticalHandlerFactory tapePerNodeLocalQueueCriticalHandlerFactory, GrpcChannelService grpcChannelService)
-
-
Method Detail
-
registerEventPublisher
@PostConstruct public void registerEventPublisher()
-
finalDestroy
@PreDestroy public void finalDestroy()
-
onPluginFrameworkStartingEvent
@EventListener public void onPluginFrameworkStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkStartingEvent event)
-
onPluginFrameworkShutdownEvent
@EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
-
onNodeBecameLive
@EventListener public void onNodeBecameLive(NodeBecameLiveEvent event)
-
onNodeBecameOffline
@EventListener public void onNodeBecameOffline(NodeBecameOfflineEvent event)
-
stop
public void stop()
-
start
public void start()
This is invoked before plugin system has been started. SeeonPluginFrameworkStartingEvent(PluginFrameworkStartingEvent)
-
createStub
@NotNull @VisibleForTesting protected CrossNodesEventsServiceGrpc.CrossNodesEventsServiceStub createStub(@NotNull @NotNull io.grpc.ManagedChannel channel)
-
addToAllQueues
public int addToAllQueues(@NotNull @NotNull CrossNodesEvent dataToAdd)- Returns:
- number of queues where
CrossNodesEventwas added
-
getManagerLifecycleStatusAndStartIfNeeded
@NotNull public @NotNull PerNodeLocalQueueManager.Status getManagerLifecycleStatusAndStartIfNeeded()
-
-