Class HeapMemorySegmentMetadataCache

java.lang.Object
org.apache.druid.metadata.segment.cache.HeapMemorySegmentMetadataCache
All Implemented Interfaces:
SegmentMetadataCache

@ThreadSafe public class HeapMemorySegmentMetadataCache extends Object implements SegmentMetadataCache
In-memory implementation of SegmentMetadataCache.

Only used segments (excluding num_rows and schema_fingerprint) and pending segments are cached. Unused segments are not cached.

Non-leader Overlords also keep polling the metadata store to keep the cache up-to-date in case leadership changes.

For cache usage modes, see SegmentMetadataCache.UsageMode.

The map datasourceToSegmentCache contains the cache for each datasource. If the cache for a datasource is empty, the sync thread removes it from the map.