Class CoordinatorSegmentMetadataCache

java.lang.Object
org.apache.druid.segment.metadata.AbstractSegmentMetadataCache<DataSourceInformation>
org.apache.druid.segment.metadata.CoordinatorSegmentMetadataCache

public class CoordinatorSegmentMetadataCache extends AbstractSegmentMetadataCache<DataSourceInformation>
Coordinator-side cache of segment metadata that combines segments to build datasources. The cache provides metadata about a datasource, see DataSourceInformation.

Major differences from the other implementation BrokerSegmentMetadataCache are,

  • The refresh is executed only on the leader Coordinator node.
  • Realtime segment schema refresh. Schema update for realtime segment is pushed periodically. The schema is merged with any existing schema for the segment and the cache is updated. Corresponding datasource is marked for refresh.
  • The refresh mechanism is significantly different from the other implementation,
    • Metadata query is executed only for those non-realtime segments for which the schema is not cached.
    • Datasources marked for refresh are then rebuilt.
  • It is important to note that the datasource schema returned in getDatasource(java.lang.String) & getDataSourceInformationMap() also includes columns from cold segments. Cold segments are processed in a separate thread and datasource schema from cold segments is separately stored.