Class CentralizedDatasourceSchemaConfig

java.lang.Object
org.apache.druid.segment.metadata.CentralizedDatasourceSchemaConfig

public class CentralizedDatasourceSchemaConfig extends Object
Config for caching and managing datasource schema on the Coordinator. This config is used by the following services:
  • Coordinator: to enable backfill of segment schema in the metadata store and caching of schema in memory.
  • Overlord: to enable publish of schema when segments are committed.
  • Peons: to enable inclusion of schema in segment publish requests.
  • Brokers: to enable polling of cached schema from the Coordinator.
The corresponding segment schemas table is created in the metadata store only when this config is enabled for the first time on a cluster. Subsequent disabling of this config does not drop the table but the services do not read or update it anymore.
  • Field Details

    • PROPERTY_PREFIX

      public static final String PROPERTY_PREFIX
      See Also:
    • SCHEMA_VERSION

      public static final int SCHEMA_VERSION
      Currently supported version of segment schema format. The schema cache can contain schemas for only this version.
      See Also:
  • Constructor Details

    • CentralizedDatasourceSchemaConfig

      public CentralizedDatasourceSchemaConfig(@Nullable Boolean enabled, @Nullable Boolean backFillEnabled, @Nullable Long backFillPeriod, @Nullable Boolean taskSchemaPublishDisabled)
  • Method Details

    • isEnabled

      public boolean isEnabled()
    • isBackFillEnabled

      public boolean isBackFillEnabled()
    • getBackFillPeriodInMillis

      public long getBackFillPeriodInMillis()
      Period in milliseconds dictating the frequency of the schema backfill job.
    • isTaskSchemaPublishDisabled

      public boolean isTaskSchemaPublishDisabled()
      Config used to disable publishing of schema when a task commits segments. This config is used only in integration tests to verify that schema is populated correctly even when tasks fail to publish the schema.
    • create

      public static CentralizedDatasourceSchemaConfig create()
      Returns:
      Default config with schema management and caching disabled.
    • enabled

      public static CentralizedDatasourceSchemaConfig enabled(boolean enabled)