Class BaseBrokerViewOfConfig<DynamicConfig>

java.lang.Object
org.apache.druid.client.BaseBrokerViewOfConfig<DynamicConfig>
Type Parameters:
DynamicConfig - the type of dynamic configuration (e.g., CoordinatorDynamicConfig, BrokerDynamicConfig)
Direct Known Subclasses:
BrokerViewOfBrokerConfig, BrokerViewOfCoordinatorConfig

public abstract class BaseBrokerViewOfConfig<DynamicConfig> extends Object
Base class for broker's view of dynamic configuration fetched from the Coordinator. Subclasses must implement: fetchConfigFromClient() to fetch configuration from their specific client getConfigTypeName() for logging purposes
  • Constructor Details

    • BaseBrokerViewOfConfig

      public BaseBrokerViewOfConfig()
  • Method Details

    • fetchConfigFromClient

      protected abstract DynamicConfig fetchConfigFromClient() throws Exception
      Fetch the configuration from the Coordinator via the HTTP client. This is called once during broker startup.
      Returns:
      the configuration fetched from the Coordinator
      Throws:
      Exception - if the fetch fails
    • getConfigTypeName

      protected abstract String getConfigTypeName()
      E.g., "coordinator dynamic configuration", "broker dynamic configuration"
    • getDynamicConfig

      public DynamicConfig getDynamicConfig()
      Return the current dynamic configuration.
    • setDynamicConfig

      public void setDynamicConfig(@NotNull DynamicConfig updatedConfig)
      Update the config view with a new dynamic config snapshot. This is called when the Coordinator pushes a configuration update to this broker.
      Parameters:
      updatedConfig - the new configuration snapshot
    • start

      public void start()
      Fetch the initial configuration from the Coordinator on broker startup. If the fetch fails, the broker startup will fail with a RuntimeException, preventing the broker from serving queries with stale or missing configuration.