Class PerNodeLocalQueueManager
- java.lang.Object
-
- com.atlassian.bamboo.cluster.PerNodeLocalQueueManager
-
public class PerNodeLocalQueueManager extends Object
Stores all active queuesPerNodeLocalQueue
and manages the queue dispatchersPerNodeLocalQueueDispatcherImpl
We 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 -NodeAliveWatchdogJob
makes 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 class
PerNodeLocalQueueManager.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 int
addToAllQueues(@NotNull CrossNodesEvent dataToAdd)
protected CrossNodesEventsServiceGrpc.CrossNodesEventsServiceStub
createStub(@NotNull io.grpc.ManagedChannel channel)
void
finalDestroy()
@NotNull PerNodeLocalQueueManager.Status
getManagerLifecycleStatusAndStartIfNeeded()
void
onNodeBecameLive(NodeBecameLiveEvent event)
void
onNodeBecameOffline(NodeBecameOfflineEvent event)
void
onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
void
onPluginFrameworkStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkStartingEvent event)
void
registerEventPublisher()
void
start()
This is invoked before plugin system has been started.void
stop()
-
-
-
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
CrossNodesEvent
was added
-
getManagerLifecycleStatusAndStartIfNeeded
@NotNull public @NotNull PerNodeLocalQueueManager.Status getManagerLifecycleStatusAndStartIfNeeded()
-
-