Class PerNodeLocalQueueManager
PerNodeLocalQueue
and manages the queue dispatchers PerNodeLocalQueueDispatcherImpl
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 within BambooClusterSettings.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
-
Constructor Summary
ConstructorDescriptionPerNodeLocalQueueManager
(BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, PerNodeLocalQueueFactory perNodeLocalQueueFactory, com.atlassian.event.api.EventPublisher eventPublisher, TapePerNodeLocalQueueCriticalHandlerFactory tapePerNodeLocalQueueCriticalHandlerFactory, GrpcChannelService grpcChannelService) -
Method Summary
Modifier and TypeMethodDescriptionint
addToAllQueues
(@NotNull CrossNodesEvent dataToAdd) protected @NotNull Map<Class<? extends io.grpc.stub.AbstractAsyncStub<?>>,
? extends io.grpc.stub.AbstractAsyncStub<?>> createStubs
(@NotNull io.grpc.ManagedChannel channel) void
@NotNull PerNodeLocalQueueManager.Status
void
void
void
onPluginFrameworkShutdownEvent
(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) void
onPluginFrameworkStartingEvent
(com.atlassian.plugin.event.events.PluginFrameworkStartingEvent event) void
void
start()
This is invoked before plugin system has been started.void
stop()
-
Constructor Details
-
PerNodeLocalQueueManager
@Inject public PerNodeLocalQueueManager(BambooClusterNodeHeartbeatService bambooClusterNodeHeartbeatService, PerNodeLocalQueueFactory perNodeLocalQueueFactory, com.atlassian.event.api.EventPublisher eventPublisher, TapePerNodeLocalQueueCriticalHandlerFactory tapePerNodeLocalQueueCriticalHandlerFactory, GrpcChannelService grpcChannelService)
-
-
Method Details
-
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
-
onNodeBecameOffline
-
stop
public void stop() -
start
public void start()This is invoked before plugin system has been started. SeeonPluginFrameworkStartingEvent(PluginFrameworkStartingEvent)
-
createStubs
-
addToAllQueues
- Returns:
- number of queues where
CrossNodesEvent
was added
-
getManagerLifecycleStatusAndStartIfNeeded
@NotNull public @NotNull PerNodeLocalQueueManager.Status getManagerLifecycleStatusAndStartIfNeeded()
-