Class StorageProviderRegistry

java.lang.Object
org.elasticsearch.xpack.esql.datasources.StorageProviderRegistry
All Implemented Interfaces:
Closeable, AutoCloseable

public class StorageProviderRegistry extends Object implements Closeable
Registry for StorageProvider implementations, keyed by URI scheme. Allows pluggable discovery of storage providers based on the scheme portion of a StoragePath (e.g., "http", "https", "s3", "file").

Providers are created lazily on first access rather than eagerly at startup, so heavy dependencies (S3 client, HTTP client, etc.) are only loaded when an EXTERNAL query actually targets that backend.

All providers are automatically wrapped with concurrency limiting and retry logic for transient storage failures (503, 429, connection resets, timeouts) unless the scheme is "file" (local filesystem). Wrap order: caller → Retryable(with adaptive backoff) → ConcurrencyLimited → raw provider

Concurrency limiters and adaptive backoff state are shared per-scheme across all providers (including per-query config providers), because cloud API rate limits are per account/IP, not per client instance.

Registration methods are intended for single-threaded initialization only (called from the DataSourceModule constructor).

This registry implements Closeable to properly close all created providers when the registry is no longer needed.