Class SqlSegmentsMetadataManagerV2

java.lang.Object
org.apache.druid.metadata.segment.SqlSegmentsMetadataManagerV2
All Implemented Interfaces:
SegmentsMetadataManager

public class SqlSegmentsMetadataManagerV2 extends Object implements SegmentsMetadataManager
Implementation V2 of SegmentsMetadataManager, that can use the segments cached in SegmentMetadataCache to build a DataSourcesSnapshot.

This class acts as a wrapper over SqlSegmentsMetadataManager and the SegmentMetadataCache. If the cache is enabled, an additional poll is not done and the segments already present in the cache are used to build the snapshot. If the SegmentMetadataCache is disabled, the polling is delegated to the legacy implementation in SqlSegmentsMetadataManager.

The Coordinator always uses the snapshot to perform various segment management duties such as loading, balancing, etc. The Overlord uses the snapshot only when compaction supervisors are enabled. Thus, when running the Overlord as a standalone service (i.e. not combined with the Coordinator), startPollingDatabasePeriodically() and stopPollingDatabasePeriodically() are called based on the current state of DruidCompactionConfig.isUseSupervisors().