Create a new S3 connector.
The underlying S3Client is not created until the first read
operation, so construction is synchronous.
S3 client configuration. See S3ConnectorOptions.
Optional ReadonlycacheOptional: identifies the storage this connector reads, so cached headers and index pages are shared only between connectors that resolve a path to the same file.
Connectors with equal namespaces must map equal paths to the same
resource. Without a namespace, cache entries are private to the
connector instance (and a persistent cache cannot be reused by
another process). The built-in connectors set local, http and
s3:<endpoint>.
ReadonlyhintsOptional tuning hints for the pipeline.
Destroy the underlying S3Client and release its HTTP connection pool.
After calling this method, the connector must not be used for further
reads. Calling close() on an already-closed connector is a safe no-op.
Resolves when the client has been destroyed.
Read a contiguous byte range from an S3 object using a GetObject
request with a Range: bytes=offset-(offset+length-1) header.
The S3 client is lazily initialized on the first call.
S3 path in s3://bucket/key or bucket/key format.
Zero-based byte offset to begin reading from.
Number of bytes to read.
Optionaloptions: ReadOptions
Optional version check (IfMatch) and abort signal.
The requested byte range.
Read the first length bytes of an object together with its size
(from ContentRange) and ETag.
S3 path in s3://bucket/key or bucket/key format.
Number of leading bytes to read.
Optionaloptions: ReadOptions
Optional abort signal.
The leading bytes plus size and version tag.
Read multiple byte ranges from the same S3 object.
Each range is fetched as a separate GetObject call with a Range
header, subject to the connector-wide
S3ConnectorOptions.maxConcurrency limit. When one range fails,
the others are cancelled.
Results are returned in the same order as the input ranges.
S3 path in s3://bucket/key or bucket/key format.
Array of { offset, length } byte-range descriptors.
Optionaloptions: ReadOptions
Optional version check and abort signal, applied to every range.
Array of Uint8Array chunks in the same order as the input ranges.
Returns an empty array when ranges is empty.
S3 connector using AWS SDK v3 (
@aws-sdk/client-s3).The SDK is a peer dependency -- it is only required at runtime if this connector is instantiated. Byte-range reads use
GetObjectwith an HTTPRangeheader, identical to how the AWS CLI performs partial downloads.The S3 client is created lazily on the first read and reused for all subsequent requests. Call S3Connector.close to destroy the client and release its underlying HTTP connection pool.
Example
Example: Reusing an application's client and bundled SDK
Example: Using with an S3-compatible store (MinIO)