A variant of TileDBStorr designed to query data at specific
points in time and in read-only mode with no write capabilities.
This class is not intended to be used directly and the preferred
usage is through storr_timetravel().
Active bindings
timestampSet or retrieve a
TileDBtimestamp range that the resource will be opened at. Effective in"READ"mode only.
Methods
StorrTimeTravel$new()
Initialise StorrTimeTravel.
Usage
StorrTimeTravel$new(driver, default_namespace)Arguments
driverA TimeTravelDriver object.
default_namespaceThe default namespace.
StorrTimeTravel$mget()
Get multiple objects.
Arguments
keyA character vector of key names.
namespaceA character vector of namespaces.
missingValue to use for missing elements.
StorrTimeTravel$mget_all()
Get multiple objects and their metadata.
Arguments
keyA character vector of key names.
namespaceA character vector of namespaces.
missingValue to use for missing elements.
StorrTimeTravel$mget_hash()
Get hash values.
StorrTimeTravel$get_keymeta()
Get key's metadata.
StorrTimeTravel$mget_keymeta()
Get multiple key metadata.
Arguments
keyA character vector with keys to get metadata values from.
namespaceA character vector of namespaces to look the keys within.
missingFill value for missing keys. Default is
NULL.
StorrTimeTravel$get_keymeta_expires_at()
Get key's expiration metadata.
Arguments
keyThe key name to get metadata values from.
namespaceThe namespace to look the key within.
StorrTimeTravel$get_keymeta_notes()
Get key's notes metadata.
Arguments
keyThe key name to get metadata values from.
namespaceThe namespace to look the key within.
StorrTimeTravel$mget_keymeta_expires_at()
Get expiration metadata for multiple keys.
Usage
StorrTimeTravel$mget_keymeta_expires_at(key,
namespace = self$default_namespace, missing = NULL)Arguments
keyA character vector with keys to get metadata values from.
namespaceA character vector of namespaces to look the keys within.
missingFill value for missing keys. Default is
NULL.
Details
An efficient method compared to $mget_keymeta() for fetching expiration
values only.
The arguments key and namespace can be recycled if any of them is a
scalar character and the other is a vector. No other recycling rule is permitted.
Note that use_cache will only fetch the metadata but not cache it if
retrieved from database.
StorrTimeTravel$mget_keymeta_notes()
Get notes metadata for multiple keys.
Arguments
keyA character vector with keys to get metadata values from.
namespaceA character vector of namespaces to look the keys within.
missingFill value for missing keys. Default is
NULL.
Details
An efficient method compared to $mget_keymeta() for fetching notes
values only.
The arguments key and namespace can be recycled if any of them is a
scalar character and the other is a vector. No other recycling rule is permitted.
Note that use_cache will only fetch the metadata but not cache it if
retrieved from database.
StorrTimeTravel$exists()
Check a key-namespace pair exists.
StorrTimeTravel$keys_with_expiration()
Get the key-namespace pairs with expiration timestamps.
StorrTimeTravel$expired_keys()
Get the expired key-namespace pairs.
StorrTimeTravel$is_key_expired()
Check a key-namespace for expiration.
Arguments
keyA scalar character of key name.
namespaceA scalar character of namespace name.
checkCheck key-namespace pair exists before query about expiration (default). Set
FALSEto skip check; on this occasion when a key-namespace not found, it returnsFALSE- useful whenTRUEvalue only matters to user.
StorrTimeTravel$keys_with_notes()
Get the key-namespace pairs with notes.
StorrTimeTravel$list_notes()
List notes given a namespace.
StorrTimeTravel$export()
Export objects from storr.
Use list() to export to a brand new list, or use as.list(object) for a shorthand.
Usage
StorrTimeTravel$export(dest, list = NULL,
namespace = self$default_namespace, skip_missing = FALSE)Arguments
destA destination to export objects to. It can be a storr, list, or environment. NOTE: for TileDB storrs use
storr(driver_tiledb())instead ofstrorr_tiledb().listNames of objects to import (or
NULLfor all objects) . If given it must be a character vector. If named, the names of the character vector will be the names of the objects as created in the storr.namespaceNamespace to get objects from, and to put objects into. If
NULL, then this will export namespaces from this (source) storr into the destination; if there is more than one namespace, this is only possible ifdestis a storr (otherwise there will be an error).skip_missingLogical, indicating if missing keys (specified in
list) should be skipped over, rather than being treated as an error (the default).
StorrTimeTravel$export_tdb()
Export objects from storr to another TileDB storr.
Usage
StorrTimeTravel$export_tdb(key = character(0),
namespace = self$default_namespace, uri_dest, context_dest = NULL)Arguments
keyA character vector of source keys.
namespaceA character vector of namespaces or
NULLfor all namespaces.uri_destThe URI path of destination storr.
context_destOptional tiledb_ctx object for destination storr.
Examples
if (FALSE) { # \dontrun{
uri <- tempfile()
sto <- storr_tiledb(uri, init = TRUE)
# set key-values
t0 <- Sys.time()
sto$set("a", 1)
t1 <- Sys.time()
sto$set("b", 2)
t2 <- Sys.time()
# Open storr with time-travel support at t1
dr <- TimeTravelDriver$new(uri, timestamp = t1)
stor <- StorrTimeTravel$new(dr, "objects")
stor$get("a")
stor$get("b") # key 'b' ('objects') not found
} # }