Class StorageManager

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

public class StorageManager extends Object implements Closeable
Format-agnostic manager for creating StorageObject instances from paths.

This class provides a high-level API for accessing storage objects without knowledge of specific file formats (Parquet, CSV, etc.). It routes requests to appropriate StorageProvider implementations based on the URI scheme:

  • s3://, s3a://, s3n:// → S3StorageProvider
  • gs:// → GcsStorageProvider
  • http://, https:// → HttpStorageProvider
  • file:// → LocalStorageProvider

The manager uses a StorageProviderRegistry for scheme-based provider lookup, allowing pluggable provider discovery. When configuration is provided via newStorageObject(String, Object), providers are created directly with the specified configuration, bypassing the registry.

This design ensures format-agnostic storage access - the manager has no knowledge of Parquet, CSV, or any other file format. Format-specific logic is handled by FormatReader implementations that consume StorageObject instances.

Note: This class is not part of the SPI as it depends on specific provider implementations. It lives in the datasources package alongside the provider registry.