Generate an instance of StorrTimeTravel, a variant of TileDBStorr designed to query key-value data at specific points in time and in read-only mode with no write capabilities.
Arguments
- uri
The URI path of storr.
- default_namespace
The default namespace:
"objects".- context
Optional tiledb_ctx object.
- timestamp
Set a
TileDBtimestamp range that the resource will be opened at. Effective only for"READ"mode. Valid options:A
NULLvalue (default)An
Robject coercible toPOSIXctwith length 1 which used for end timestamp, or length 2 with start, end timestampsAn object of class
tiledb_timestamp. Seeset_tiledb_timestamp()
Set a new timestamp with active field
$timestamp, see examples.
Value
An object of class StorrTimeTravel, R6.
Class Methods Summary
For complete definitions, see Methods section in StorrTimeTravel.
Active Fields
timestamp- Get or set a TileDB timestamp range that the 'storr' will be opened at.
Single Key-Value Operations
get()- Retrieve an object by key-namespace pairget_value()- Retrieve an object given its hash
Multiple Key-Value Operations
mget()- Get multiple objects by keysmget_value()- Get multiple objects by their hashes
Metadata Operations
get_keymeta()- Retrieve metadata for a keymget_keymeta()- Retrieve metadata for multiple keys
Object Hash Management
get_hash()- Get hash value for a key-namespace pairmget_hash()- Get hash values for multiple keys
Key Management
exists()- Check if key-namespace pair(s) existexists_object()- Check if object(s) with given hash(es) exist
Expiration Management
keys_with_expiration()- List keys that have expiration timestampsexpired_keys()- Get keys that have already expiredhas_expired_keys()- Check if any keys are expired
Listing
list()- List all keys in a namespacelist_hashes()- List all stored object hasheslist_unused_hashes()- List all stored object unused hasheslist_namespaces()- List all namespaces
Storage Management
index_export()- Export object index as data.tableexport()- Export objects to another storr/list/environmentexport_tdb()- Export objects to another TileDB storr
Examples
if (FALSE) { # \dontrun{
# URI path
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 t0
stor <- storr_timetravel(uri, timestamp = t0)
# Read at t0
stor$list_hashes() # character(0), no hashes at t0
stor$get("a") # key 'a' ('objects') not found
# Read at t1
stor$timestamp <- t1
stor$get("a") # 1
stor$get("b") # key 'b' ('objects') not found
# Read at t2
stor$timestamp <- t2
sto$get("b") # 2
} # }