Class BaseDynamicConfigSyncer<DynamicConfig>

java.lang.Object
org.apache.druid.server.http.BaseDynamicConfigSyncer<DynamicConfig>
Type Parameters:
DynamicConfig - the type of dynamic configuration (e.g., CoordinatorDynamicConfig, BrokerDynamicConfig)
Direct Known Subclasses:
BrokerDynamicConfigSyncer, CoordinatorDynamicConfigSyncer

public abstract class BaseDynamicConfigSyncer<DynamicConfig> extends Object
Base class for syncing dynamic configuration to all brokers. Subclasses must implement: - getCurrentConfig() to provide the latest config - pushConfigToBroker(BrokerClient, Object) to push config via the appropriate BrokerClient method - getConfigTypeName() for logging
  • Constructor Details

  • Method Details

    • getCurrentConfig

      protected abstract DynamicConfig getCurrentConfig()
      Get the current configuration to broadcast to brokers.
    • pushConfigToBroker

      protected abstract boolean pushConfigToBroker(BrokerClient brokerClient, DynamicConfig config) throws Exception
      Push the config to a broker using the appropriate BrokerClient method.
      Returns:
      true if the push was successful
      Throws:
      Exception
    • getConfigTypeName

      protected abstract String getConfigTypeName()
      Get the name of this config type for logging (e.g., "coordinator dynamic configuration", "broker dynamic configuration").
    • queueBroadcastConfigToBrokers

      public void queueBroadcastConfigToBrokers()
      Queues the configuration sync to the brokers without blocking the calling thread.
    • broadcastConfigToBrokers

      public void broadcastConfigToBrokers()
      Push the latest dynamic config to all currently known Brokers. Also invalidates the set of inSyncBrokers if the config has changed.
    • getInSyncBrokers

      public Set<BrokerSyncStatus> getInSyncBrokers()
      Returns the set of Brokers which have been updated with the latest config.
    • onLeaderStart

      public void onLeaderStart()
      Schedules a periodic sync with brokers when the coordinator becomes the leader.
    • onLeaderStop

      public void onLeaderStop()
      Stops the sync when coordinator stops being the leader.
    • stop

      public void stop()