Class PerNodeLocalQueueManager

java.lang.Object
com.atlassian.bamboo.cluster.PerNodeLocalQueueManager

public class PerNodeLocalQueueManager extends Object
Stores all active queues 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
  • Constructor Details

  • 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

      @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. See onPluginFrameworkStartingEvent(PluginFrameworkStartingEvent)
    • createStubs

      @NotNull @VisibleForTesting protected @NotNull Map<Class<? extends io.grpc.stub.AbstractAsyncStub<?>>,? extends io.grpc.stub.AbstractAsyncStub<?>> createStubs(@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()