Skip to contents

Marks an s3:// URL for the zarrs Rust backend. All I/O is delegated to object_store, so this class requires the s3 compiled feature (r-universe tier).

Format

R6::R6Class

Details

S3Store is a dispatch marker, not a full store: it carries a URL and implements no key-level I/O of its own. Reads go through zarrs_open_array_metadata() and zarrs_get_subset(), which take the s3:// URL directly. Calling get_item(), contains_item() or listdir() on this object raises an error pointing at those functions and at HttpStore.

The S3 client is configured with environment variables, read by object_store when the store is first opened. These mirror the storage_options that fsspec and xarray users pass in Python:

AWS_ENDPOINT

Alternate endpoint, e.g. MinIO, Ceph, or an Open Storage Network pod. Equivalent to fsspec client_kwargs = list(endpoint_url = ...).

AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN

Credentials. When none are set, requests are unsigned, so public buckets work with no configuration (fsspec anon = TRUE).

AWS_REGION

Region. Often unnecessary for non-AWS endpoints.

AWS_ALLOW_HTTP

Set to "true" to permit plain-HTTP endpoints.

AWS_VIRTUAL_HOSTED_STYLE_REQUEST

Set to "false" for path-style addressing.

AWS_SKIP_SIGNATURE

Force anonymous ("true") or signed ("false") requests regardless of the credentials present.

Store handles are cached by URL on the Rust side, so changing any of these variables has no effect on an already-open store until you call zarrs_close_store().

Writes to S3 are not supported.

See also

HttpStore for reading an S3-compatible endpoint over plain HTTPS, which works on both distribution tiers. vignette("remote-stores") for worked examples.

Other Store classes: DirectoryStore, GcsStore, HttpStore, MemoryStore, Store

Super class

pizzarr::Store -> S3Store

Methods

Inherited methods


Method new()

Create an S3Store.

Usage

S3Store$new(url)

Arguments

url

Character. S3 URL (e.g., "s3://bucket/prefix").


Method get_item()

Not implemented. Raises an error naming the supported read paths.

Usage

S3Store$get_item(key)

Arguments

key

The item key.

Returns

Never returns.


Method set_item()

Not implemented. Writes to S3 are not supported.

Usage

S3Store$set_item(key, value)

Arguments

key

The item key.

value

The item value as a vector of type raw.

Returns

Never returns.


Method contains_item()

Not implemented. Raises an error naming the supported read paths.

Usage

S3Store$contains_item(key)

Arguments

key

The item key.

Returns

Never returns.


Method listdir()

Not implemented. Raises an error naming the supported read paths.

Usage

S3Store$listdir(path = NA)

Arguments

path

character path.

Returns

Never returns.


Method get_store_identifier()

Return the S3 URL for zarrs dispatch.

Usage

S3Store$get_store_identifier()

Returns

A character string.


Method print()

Print a human-readable summary of the store.

Usage

S3Store$print(...)

Arguments

...

Ignored.

Returns

self (invisibly).


Method clone()

The objects of this class are cloneable with this method.

Usage

S3Store$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Public bucket on an Open Storage Network pod (USGS gridMET).
Sys.setenv(AWS_ENDPOINT = "https://usgs.osn.mghpcc.org")

url <- "s3://mdmf/gdp/gridMET.zarr"
zarrs_open_array_metadata(url, "lat")
zarrs_get_subset(url, "lat", list(c(0L, 5L)), NULL)
zarrs_close_store(url)
} # }