Class BrokerSegmentMetadataCacheConfig

java.lang.Object
org.apache.druid.segment.metadata.SegmentMetadataCacheConfig
org.apache.druid.sql.calcite.schema.BrokerSegmentMetadataCacheConfig

public class BrokerSegmentMetadataCacheConfig extends SegmentMetadataCacheConfig
Broker-side configuration class for managing segment polling from the Coordinator and customizing properties related to the SegmentMetadata cache which is used to infer datasources for SQL.

See BrokerSegmentMetadataCache, MetadataSegmentView.

This class shares the same config root as PlannerConfig to maintain backward compatibility for when the properties here resided in PlannerConfig.

The property awaitInitializationOnStart is overridden in this class with a default value of true, which differs from the parent class. This ensures that the SegmentMetadata cache is fully initialized before other startup processes proceed.

  • Constructor Details

    • BrokerSegmentMetadataCacheConfig

      public BrokerSegmentMetadataCacheConfig()
  • Method Details

    • create

      public static BrokerSegmentMetadataCacheConfig create()
    • create

      public static BrokerSegmentMetadataCacheConfig create(String metadataRefreshPeriod)
    • isMetadataSegmentCacheEnable

      public boolean isMetadataSegmentCacheEnable()
      Flag to indicate if Broker should cache segment metadata polled from the Coordinator to serve sys.segments queries. True by default. If disabled, segment metadata is freshly fetched from the Coordinator for each query.
    • getMetadataSegmentPollPeriod

      public long getMetadataSegmentPollPeriod()
    • setAwaitInitializationOnStart

      public BrokerSegmentMetadataCacheConfig setAwaitInitializationOnStart(boolean awaitInitializationOnStart)
    • isAwaitInitializationOnStart

      public boolean isAwaitInitializationOnStart()
      This property is overriden on the broker, so that the cache initialization blocks startup.
      Overrides:
      isAwaitInitializationOnStart in class SegmentMetadataCacheConfig
    • toString

      public String toString()
      Overrides:
      toString in class SegmentMetadataCacheConfig