Class GcsStorageProvider
java.lang.Object
org.elasticsearch.xpack.esql.datasource.gcs.GcsStorageProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,StorageProvider
StorageProvider implementation for Google Cloud Storage.
Supports the gs:// URI scheme. Authentication can be provided via:
- Explicit service account JSON credentials
- Application Default Credentials (ADC) — environment variable, metadata server, etc.
GcsStorageObject provides optimized I/O via GCS ReadChannel:
readBytesreads directly intoByteBufferwithout intermediate copiesreadBytesAsyncuses executor-based async with efficient ReadChannel reads
-
Constructor Summary
ConstructorsConstructorDescriptionGcsStorageProvider(com.google.cloud.storage.Storage storage) Constructor for testing with a pre-built Storage client.GcsStorageProvider(GcsConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanexists(StoragePath path) listObjects(StoragePath prefix, boolean recursive) newObject(StoragePath path) newObject(StoragePath path, long length) newObject(StoragePath path, long length, Instant lastModified) toString()
-
Constructor Details
-
GcsStorageProvider
-
GcsStorageProvider
public GcsStorageProvider(com.google.cloud.storage.Storage storage) Constructor for testing with a pre-built Storage client. Allows tests to inject a client configured with custom endpoints (e.g., fixture token URI).
-
-
Method Details
-
newObject
- Specified by:
newObjectin interfaceStorageProvider
-
newObject
- Specified by:
newObjectin interfaceStorageProvider
-
newObject
- Specified by:
newObjectin interfaceStorageProvider
-
listObjects
- Specified by:
listObjectsin interfaceStorageProvider- Throws:
IOException
-
exists
- Specified by:
existsin interfaceStorageProvider- Throws:
IOException
-
supportedSchemes
- Specified by:
supportedSchemesin interfaceStorageProvider
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-