Class StorageProviderRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable
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 non-file providers are automatically wrapped with per-scheme concurrency limiting and retry logic for
transient storage failures (503, 429, connection resets, timeouts). Wrap order:
caller → Retryable(with adaptive backoff) → ConcurrencyLimited → raw provider
Concurrency limiters are shared per-scheme and adaptive backoff state is shared per-throttle-scope 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.
-
Constructor Summary
ConstructorsConstructorDescriptionStorageProviderRegistry(Settings settings) StorageProviderRegistry(Settings settings, DataSourceCredentials credentials) Test-only convenience constructor.StorageProviderRegistry(Settings settings, DataSourceCredentials credentials, BooleanSupplier managedIdentityEnabled, org.elasticsearch.xpack.esql.datasources.RetryScheduler retryScheduler) StorageProviderRegistry(Settings settings, DataSourceCredentials credentials, BooleanSupplier managedIdentityEnabled, org.elasticsearch.xpack.esql.datasources.RetryScheduler retryScheduler, LocalFileAccess localFileAccess) -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.xpack.esql.datasources.ConcurrencyBudgetAllocatorallocatorForScheme(String scheme) Per-query concurrency budget allocator for the given scheme, ornullwhen per-query budgeting does not apply (file scheme, or permit limiting disabled viamax_concurrent_requests=0).voidclose()Convenience: returns the StorageProvider only.booleanhasProvider(String scheme) provider(StoragePath path) voidregisterFactory(String scheme, StorageProviderFactory factory)
-
Constructor Details
-
StorageProviderRegistry
-
StorageProviderRegistry
Test-only convenience constructor. The defaultmanagedIdentityEnabledsupplier reads the cluster setting directly and does not apply the stateless gate that production wiring enforces inEsqlPlugin(where the boolean is forced tofalsewhenDiscoveryNode.isStateless). Similarly,localFileAccessdefaults toLocalFileAccess.UNRESTRICTEDand does not apply the stateless gate or the allowlist fromExternalSourceSettings#LOCAL_ALLOWED_PATHS. Production always goes through the five-argument constructor viaDataSourceModule. -
StorageProviderRegistry
public StorageProviderRegistry(Settings settings, @Nullable DataSourceCredentials credentials, BooleanSupplier managedIdentityEnabled, org.elasticsearch.xpack.esql.datasources.RetryScheduler retryScheduler) -
StorageProviderRegistry
public StorageProviderRegistry(Settings settings, @Nullable DataSourceCredentials credentials, BooleanSupplier managedIdentityEnabled, org.elasticsearch.xpack.esql.datasources.RetryScheduler retryScheduler, LocalFileAccess localFileAccess)
-
-
Method Details
-
registerFactory
-
provider
-
hasProvider
-
createProvider
Convenience: returns the StorageProvider only. UsecreateProviderTrackingConsumedKeys(String, Settings, Map)when the consumed-keys set is needed. -
createProviderTrackingConsumedKeys
public Configured<StorageProvider> createProviderTrackingConsumedKeys(String scheme, Settings settings, Map<String, Object> config) -
allocatorForScheme
public org.elasticsearch.xpack.esql.datasources.ConcurrencyBudgetAllocator allocatorForScheme(String scheme) Per-query concurrency budget allocator for the given scheme, ornullwhen per-query budgeting does not apply (file scheme, or permit limiting disabled viamax_concurrent_requests=0). Shared per-scheme so a single query cannot starve others on the same backend. -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-