Class SqlSegmentMetadataTransactionFactory

java.lang.Object
org.apache.druid.metadata.segment.SqlSegmentMetadataReadOnlyTransactionFactory
org.apache.druid.metadata.segment.SqlSegmentMetadataTransactionFactory
All Implemented Interfaces:
SegmentMetadataTransactionFactory

public class SqlSegmentMetadataTransactionFactory extends SqlSegmentMetadataReadOnlyTransactionFactory
Factory for SegmentMetadataTransactions. If the SegmentMetadataCache is enabled and ready, the transaction may read/write from the cache as applicable.

This class serves as a wrapper over the SQLMetadataConnector to perform transactions specific to segment metadata.

Only the Overlord can perform write operations on the metadata store or the cache via this transaction factory. The Coordinator performs read operations directly on the metadata store and uses the cache only to build the timeline in SqlSegmentsMetadataManagerV2. There is currently only one method called by the Coordinator that could benefit from reading from the cache, MetadataResource.getUsedSegmentsInDataSourceForIntervals(), but for now, it continues to read directly from the metadata store for consistency with older Druid versions.