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().
Methods
StorrTimeTravel$new()
Initialise StorrTimeTravel.
StorrTimeTravel$get()
Get an object given a key-namespace pair.
Usage
StorrTimeTravel$get(key, namespace = self$default_namespace)
Arguments
key
A scalar character of key name.
namespace
A scalar character of namespace name.
Returns
The R object if available.
StorrTimeTravel$mget()
Get multiple objects.
Usage
StorrTimeTravel$mget(key, namespace = self$default_namespace,
missing = NULL)
Arguments
key
A character vector of key names.
namespace
A character vector of namespaces.
missing
Value to use for missing elements.
Details
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.
Returns
A list of R objects.
StorrTimeTravel$get_all()
Get an object and its metadata given a key-namespace pair.
Usage
StorrTimeTravel$get_all(key, namespace = self$default_namespace)
Arguments
key
A scalar character of key name.
namespace
A scalar character of namespace name.
Returns
The R object and its key-metadata, if available.
StorrTimeTravel$mget_all()
Get multiple objects and their metadata.
Usage
StorrTimeTravel$mget_all(key, namespace = self$default_namespace,
missing = NULL)
Arguments
key
A character vector of key names.
namespace
A character vector of namespaces.
missing
Value to use for missing elements.
Details
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.
Returns
A list of R objects with their metadata for each key-namespace
pair. For not found pairs will return the missing value.
StorrTimeTravel$get_hash()
Get hash value.
Usage
StorrTimeTravel$get_hash(key, namespace = self$default_namespace)
Arguments
key
A scalar character of key name.
namespace
A scalar character of namespace name.
StorrTimeTravel$mget_hash()
Get hash values.
Usage
StorrTimeTravel$mget_hash(key, namespace = self$default_namespace)
Arguments
key
A character vector of key names.
namespace
A character vector of namespaces.
Details
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.
Returns
A vector of hashes.
StorrTimeTravel$get_value()
Get an object given its hash.
Usage
StorrTimeTravel$get_value(hash)
Arguments
hash
The hash value of the object.
Returns
The R object if available.
StorrTimeTravel$mget_value()
Get multiple objects given their hashes.
Usage
StorrTimeTravel$mget_value(hash, missing = NULL)
Arguments
hash
A vector of hash values."
missing
Value to use for missing elements.
Returns
A list of R objects.
Get key's metadata.
Usage
StorrTimeTravel$get_keymeta(key, namespace = self$default_namespace)
Arguments
key
The key name to get metadata values from.
namespace
The namespace to look the key within.
Returns
A named list with the key-metadata: "expires_at"
and "notes".
Get multiple key metadata.
Usage
StorrTimeTravel$mget_keymeta(key, namespace = self$default_namespace,
missing = NULL)
Arguments
key
A character vector with keys to get metadata values from.
namespace
A character vector of namespaces to look the keys within.
missing
Fill value for missing keys. Default is NULL.
Details
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.
Returns
A list with key metadata for each key-namespace
pair. For not found pairs will return the missing value.
Get key's expiration metadata.
Usage
StorrTimeTravel$get_keymeta_expires_at(key,
namespace = self$default_namespace)
Arguments
key
The key name to get metadata values from.
namespace
The namespace to look the key within.
Details
An efficient method compared to $get_keymeta() for fetching expiration
values only.
Note that use_cache will only fetch the metadata but not cache it if
retrieved from database.
Returns
A scalar key-metadata value.
Get key's notes metadata.
Usage
StorrTimeTravel$get_keymeta_notes(key, namespace = self$default_namespace)
Arguments
key
The key name to get metadata values from.
namespace
The namespace to look the key within.
Details
An efficient method compared to $get_keymeta() for fetching notes
values only.
Note that use_cache will only fetch the metadata but not cache it if
retrieved from database.
Returns
A scalar key-metadata value.
Get expiration metadata for multiple keys.
Usage
StorrTimeTravel$mget_keymeta_expires_at(key,
namespace = self$default_namespace, missing = NULL)
Arguments
key
A character vector with keys to get metadata values from.
namespace
A character vector of namespaces to look the keys within.
missing
Fill 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.
Returns
A list with expiration metadata for each key-namespace
pair. For not found pairs will return the missing value.
Get notes metadata for multiple keys.
Usage
StorrTimeTravel$mget_keymeta_notes(key, namespace = self$default_namespace,
missing = NULL)
Arguments
key
A character vector with keys to get metadata values from.
namespace
A character vector of namespaces to look the keys within.
missing
Fill 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.
Returns
A list with notes metadata for each key-namespace
pair. For not found pairs will return the missing value.
StorrTimeTravel$exists()
Check a key-namespace pair exists.
Usage
StorrTimeTravel$exists(key, namespace = self$default_namespace)
Arguments
key
A character vector of key names.
namespace
A character vector of namespaces.
Details
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.
Returns
A logical vector indicating which key-namespace pair exists.
StorrTimeTravel$exists_object()
Check a serialised object exists given a hash.
Usage
StorrTimeTravel$exists_object(hash)
Arguments
hash
A vector of hash values.
Returns
A logical vector indicating which object exists.
StorrTimeTravel$keys_with_expiration()
Get the key-namespace pairs with expiration timestamps.
Usage
StorrTimeTravel$keys_with_expiration(namespace = self$default_namespace,
datetimes = TRUE)
Arguments
namespace
A character vector of namespaces or NULL for all namespaces.
datetimes
Should the expires_at column be returned?
Default is TRUE.
Returns
An object of class data.table.
StorrTimeTravel$expired_keys()
Get the expired key-namespace pairs.
Usage
StorrTimeTravel$expired_keys(namespace = self$default_namespace,
datetimes = TRUE)
Arguments
namespace
A character vector of namespaces or NULL for all namespaces.
datetimes
Should the expires_at column be returned?
Default is TRUE.
Returns
An object of class data.table.
StorrTimeTravel$has_expired_keys()
Check for expired key-namespace pairs.
Usage
StorrTimeTravel$has_expired_keys(namespace = self$default_namespace)
Arguments
namespace
A character vector of namespaces or NULL for all namespaces.
Returns
TRUE for expired keys, FALSE otherwise.
StorrTimeTravel$is_key_expired()
Check a key-namespace for expiration.
Usage
StorrTimeTravel$is_key_expired(key, namespace = self$default_namespace,
check = TRUE)
Arguments
key
A scalar character of key name.
namespace
A scalar character of namespace name.
check
Check key-namespace pair exists before query about
expiration (default). Set FALSE to skip check; on this occasion when
a key-namespace not found, it returns FALSE - useful when TRUEvalue
only matters to user.
Returns
TRUE - key-namespace pair has expired
FALSE - (a) key has not expired, (b) has not expiration time-stamp
or (c) check = FALSE and no key is found
StorrTimeTravel$keys_with_notes()
Get the key-namespace pairs with notes.
Usage
StorrTimeTravel$keys_with_notes(namespace = self$default_namespace,
notes = TRUE)
Arguments
namespace
A character vector of namespaces or NULL for all namespaces.
notes
Should the notes column be returned?
Default is TRUE.
Returns
An object of class data.table.
StorrTimeTravel$list()
List all keys stored in a namespace.
Usage
StorrTimeTravel$list(namespace = self$default_namespace)
Arguments
namespace
A scalar character of namespace name.
Returns
A sorted character vector with keys.
StorrTimeTravel$list_notes()
List notes given a namespace.
Usage
StorrTimeTravel$list_notes(namespace, named = FALSE)
Arguments
namespace
A single character namespace.
named
Should the output be named with keys?
Default is FALSE.
Returns
A vector with notes metadata values.
StorrTimeTravel$list_hashes()
List all hashes stored in the storr.
Usage
StorrTimeTravel$list_hashes()
Returns
A sorted character vector with hashes.
StorrTimeTravel$list_unused_hashes()
List unused hashes stored in the storr.
Usage
StorrTimeTravel$list_unused_hashes()
Returns
A sorted character vector with unused hashes.
StorrTimeTravel$list_namespaces()
List all namespaces in the storr.
Usage
StorrTimeTravel$list_namespaces()
Returns
A sorted character vector with namespaces.
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
dest
A destination to export objects to. It can be a storr, list, or environment.
list
Names of objects to import (or NULL for 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.
namespace
Namespace 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 if dest
is a storr (otherwise there will be an error).
skip_missing
Logical, indicating if missing keys (specified in list)
should be skipped over, rather than being treated as an error (the default).
Returns
dest object, invisibly.
StorrTimeTravel$index_export()
Generate a data.table with an index of objects
present in a storr.
Usage
StorrTimeTravel$index_export(namespace = NULL)
Arguments
namespace
A character vector of namespaces or NULL for all namespaces.
Returns
An object of class data.table.
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
key
A character vector of source keys.
namespace
A character vector of namespaces or NULL for all namespaces.
uri_dest
The URI path of destination storr.
context_dest
Optional tiledb_ctx object
for destination storr.
Returns
A logical TRUE indicating successful export, invisibly.