Skip to contents

Store class that uses HTTP requests. Read-only. Depends on the crul package.

Format

R6::R6Class inheriting from Store.

Details

This is also the way to read an S3-compatible bucket over plain HTTPS. Most public object stores — MinIO, Ceph, Open Storage Network pods, Cloudflare R2, and Google Cloud Storage — expose their objects at a URL, so an s3://bucket/key address with endpoint https://host becomes:

https://host/bucket/key

Unlike S3Store and GcsStore, HttpStore works on both distribution tiers: it falls back to the R-native crul code path when the zarrs backend is not compiled in, and uses parallel chunk decode when it is. It needs no credentials and no environment configuration.

When the store publishes consolidated metadata (a .zmetadata key), listdir() reports its members; without it, HTTP stores cannot be listed and you must address arrays by name.

See also

S3Store for s3:// URLs via the zarrs backend. vignette("remote-stores") for worked examples.

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

Super class

pizzarr::Store -> HttpStore

Methods

Inherited methods


Method new()

Create a HttpStore object

Usage

HttpStore$new(url, options = NA, headers = NA)

Arguments

url

(character(1))
URL of the store.

options

(list() or NA)
Options passed to crul.

headers

(list() or NA)
Headers passed to crul.

Returns

A new HttpStore object.


Method get_item()

Get an item from the store.

Usage

HttpStore$get_item(item)

Arguments

item

The item key.

Returns

The item data in a vector of type raw.


Method contains_item()

Determine whether the store contains an item.

Usage

HttpStore$contains_item(item)

Arguments

item

The item key.

Returns

A boolean value.


Method listdir()

Fetches .zmetadata from the store evaluates its names

Usage

HttpStore$listdir(path = NA)

Arguments

path

character path to list within, or NA for the store root.

Returns

Character vector of unique keys that do not start with a ..


Method get_cache_time_seconds()

Get cache time of http requests.

Usage

HttpStore$get_cache_time_seconds()

Returns

numeric(1).


Method set_cache_time_seconds()

Set cache time of http requests.

Usage

HttpStore$set_cache_time_seconds(seconds)

Arguments

seconds

Number of seconds until cache is invalid – 0 for no cache.

Returns

NULL (called for side effects).


Method get_store_identifier()

Print a human-readable summary of the store.

Return the store URL for zarrs dispatch.

Usage

HttpStore$get_store_identifier()

Returns

A character string.


Method print()

Usage

HttpStore$print(...)

Arguments

...

Ignored.

Returns

self (invisibly).


Method clone()

The objects of this class are cloneable with this method.

Usage

HttpStore$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# USGS gridMET on an Open Storage Network pod, addressed over HTTPS.
store <- HttpStore$new("https://usgs.osn.mghpcc.org/mdmf/gdp/gridMET.zarr")
g <- zarr_open(store)
store$listdir()
} # }