Skip to contents

An R6 class that represents a storr interface for TileDB driver.

TileDBStorr replicates the storr interface but also enhances it with additional new features:

  • notes and key expiration timestamps

  • asynchronous writes

Note that the following methods from storr are not supported by TileDBStorr: $archive_import, $archive_export, $check and $repair.

This class is not intended to be used directly and the preferred usage is through storr_tiledb().

Value

A TileDBStorr, R6 object.

Public fields

envir

The object hash table.

envir_metadata

The key metadata hash table.

default_namespace

The default namespace.

traits

Driver traits.

hash_raw

The hash function.

serialize_object

The serialisation function.

Active bindings

async_info

mirai information

size

Return Storr size

Methods

Public methods


TileDBStorr$new()

Initialise TileDBStorr.

Usage

TileDBStorr$new(driver, default_namespace, async = FALSE)

Arguments

driver

A TileDB driver, see driver_tiledb().

default_namespace

The default namespace.

async

Should the mirai daemons be enabled for async functions? Default is FALSE.


TileDBStorr$destroy()

Destroy (delete) 'storr'.

Usage

TileDBStorr$destroy()

Returns

NULL, invisibly.


TileDBStorr$flush_cache()

Flush the cache of R objects.

Usage

TileDBStorr$flush_cache()

Details

It removes all items from the hash tables (R objects and their metadata).

Returns

The object, invisibly.


TileDBStorr$set()

Set a key value pair.

Usage

TileDBStorr$set(key, value, namespace = self$default_namespace, expires_at,
  notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

Returns

The hash value, invisibly.


TileDBStorr$mset()

Set multiple key value pairs.

Usage

TileDBStorr$mset(key, value, namespace = self$default_namespace, expires_at,
  notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A character vector of key names.

value

A vector of values to store.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

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 hash values, invisibly.


TileDBStorr$set_async()

Set a key value pair asynchronously.

Usage

TileDBStorr$set_async(key, value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Returns

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: the hash value


TileDBStorr$mset_async()

Set multiple key value pairs asynchronously.

Usage

TileDBStorr$mset_async(key, value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

key

A character vector of key names.

value

A vector of values to store.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

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

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: a vector with hash values


TileDBStorr$set_by_value()

Set a key value pair using its hash as key.

Usage

TileDBStorr$set_by_value(value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

value

An R object to store.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

Returns

The hash value, invisibly.


TileDBStorr$mset_by_value()

Set multiple key value pairs using their hashes as keys.

Usage

TileDBStorr$mset_by_value(value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

value

A vector of values to store.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

Returns

A vector of hash values, invisibly.


TileDBStorr$set_by_value_async()

Set a key value pair using its hash as key, asynchronously.

Usage

TileDBStorr$set_by_value_async(value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

value

An R object to store.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Returns

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: the hash value


TileDBStorr$mset_by_value_async()

Set multiple key value pairs using their hashes as keys, asynchronously.

Usage

TileDBStorr$mset_by_value_async(value, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

value

A vector of values to store.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

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

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: a vector with hash values


TileDBStorr$set_value()

Add an R object without key.

This is used internally.

Usage

TileDBStorr$set_value(value, use_cache = getOption("storr.tiledb.cache",
  TRUE))

Arguments

value

An R object to store.

use_cache

Should the cache be used? Default is TRUE.

Returns

The hash value, invisibly.


TileDBStorr$mset_value()

Add a vector of R objects.

This is used internally.

Usage

TileDBStorr$mset_value(values, use_cache = getOption("storr.tiledb.cache",
  TRUE))

Arguments

values

A vector of values to store.

use_cache

Should the cache be used? Default is TRUE.

Returns

A vector of hash values, invisibly.


TileDBStorr$get()

Get an object given a key-namespace pair.

Usage

TileDBStorr$get(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

use_cache

Should the cache be used? Default is TRUE.

Returns

The R object if available.


TileDBStorr$mget()

Get multiple objects.

Usage

TileDBStorr$mget(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), missing = NULL)

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

use_cache

Should the cache be used? Default is TRUE.

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.


TileDBStorr$get_hash()

Get hash value.

Usage

TileDBStorr$get_hash(key, namespace = self$default_namespace)

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

Returns

The hash value.


TileDBStorr$mget_hash()

Get hash values.

Usage

TileDBStorr$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.


TileDBStorr$hash_object()

Create a hash digest for an R object.

Usage

TileDBStorr$hash_object(object)

Arguments

object

An R object.

Returns

A character string of a fixed length containing the requested digest (hash) of the supplied R object.


TileDBStorr$get_value()

Get an object given its hash.

Usage

TileDBStorr$get_value(hash, use_cache = getOption("storr.tiledb.cache",
  TRUE))

Arguments

hash

The hash value of the object.

use_cache

Should the cache be used? Default is TRUE.

Returns

The R object if available.


TileDBStorr$mget_value()

Get multiple objects given their hashes.

Usage

TileDBStorr$mget_value(hash, use_cache = getOption("storr.tiledb.cache",
  TRUE), missing = NULL)

Arguments

hash

A vector of hash values.

use_cache

Should the cache be used? Default is TRUE.

missing

Value to use for missing elements.

Returns

A list of R objects.


TileDBStorr$get_all()

Get an object and its metadata given a key-namespace pair.

Usage

TileDBStorr$get_all(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

use_cache

Should the cache be used? Default is TRUE.

Returns

The R object and its key-metadata, if available.


TileDBStorr$mget_all()

Get multiple objects and their metadata.

Usage

TileDBStorr$mget_all(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), missing = NULL)

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

use_cache

Should the cache be used? Default is TRUE.

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.


TileDBStorr$update()

Update a key value pair.

Usage

TileDBStorr$update(key, value, namespace = self$default_namespace,
  create = FALSE, expires_at, notes,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

create

Should the key be created, if not found. Default is FALSE raising an KeyError. Otherwise, create a new key.

expires_at, notes

A scalar string of notes and/or a date-time object of class POSIXct(optional). Applies only if create = TRUE.

use_cache

Should the cache be used? Default is TRUE.

Details

This method updates a key-namespace value while retaining its key-metadata. If a key is not found, it raises an error by default; otherwise, set create argument to TRUE to set a new key and optionally add key metadata with expires_at,notes arguments.

Returns

The hash value, invisibly.


TileDBStorr$mupdate()

Update multiple key value pairs.

Usage

TileDBStorr$mupdate(key, value, namespace = self$default_namespace,
  create = FALSE, fail_fast = TRUE, expires_at, notes,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

create

Should the key be created, if not found. Default is FALSE raising an KeyError. Otherwise, create a new key.

fail_fast

Should abort on missing keys, default is TRUE. Use FALSE for skipping keys and emit a warning for missing items. The argument has no effect when upsert is used via create = TRUE.

expires_at, notes

A scalar string of notes and/or a date-time object of class POSIXct(optional). Applies only if create = TRUE.

use_cache

Should the cache be used? Default is TRUE.

Details

This works similar to $update but for multiple key pairs and with more control about missing keys; use fail_fast to abort (default) or skip with warning.

Returns

A vector of hash values, invisibly.


TileDBStorr$update_async()

Update a key value pair asynchronously.

Usage

TileDBStorr$update_async(key, value, namespace = self$default_namespace,
  create = FALSE, expires_at, notes,
  use_cache = getOption("storr.tiledb.cache", TRUE), cfg = NULL)

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

create

Should the key be created, if not found. Default is FALSE raising an KeyError. Otherwise, create a new key.

expires_at, notes

A scalar string of notes and/or a date-time object of class POSIXct(optional). Applies only if create = TRUE.

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Details

This method updates a key-namespace value while retaining its key-metadata. If a key is not found, it raises an error by default; otherwise, set create argument to TRUE to set a new key and optionally add key metadata with expires_at,notes arguments.

Returns

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: the hash value


TileDBStorr$mupdate_async()

Update multiple key value pairs asynchronously.

Usage

TileDBStorr$mupdate_async(key, value, namespace = self$default_namespace,
  create = FALSE, fail_fast = TRUE, expires_at, notes,
  use_cache = getOption("storr.tiledb.cache", TRUE), cfg = NULL)

Arguments

key

A scalar character of key name.

value

An R object to store.

namespace

A scalar character of namespace name.

create

Should the key be created, if not found. Default is FALSE raising an KeyError. Otherwise, create a new key.

fail_fast

Should abort on missing keys, default is TRUE. Use FALSE for skipping keys and emit a warning for missing items. The argument has no effect when upsert is used via create = TRUE.

expires_at, notes

A scalar string of notes and/or a date-time object of class POSIXct(optional). Applies only if create = TRUE.

use_cache

Should the cache be used? Default is TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Details

This works similar to $update but for multiple key pairs and with more control about missing keys; use fail_fast to abort (default) or skip with warning.

Returns

Invisibly, a named list with two elements:

  • mirai: a named list of two mirai() objects, obj and key; obj refers to object table and key to key table. Both return logical TRUE if an evaluation is successful.

  • hash: a vector with hash values


TileDBStorr$set_keymeta()

Set key metadata.

Usage

TileDBStorr$set_keymeta(key, namespace = self$default_namespace, expires_at,
  notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

Details

Setting keymeta will update/replace only the chosen metadata and will not ovewrite the other.

Returns

The key:namespace string, invisibly. If both arguments "expires_at" and "notes" are missing, then nothing is set and a zero length character vector is returned.


TileDBStorr$mset_keymeta()

Set multiple key metadata.

Usage

TileDBStorr$mset_keymeta(key, namespace = self$default_namespace, expires_at,
  notes, use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

Details

Setting keymeta will update/replace only the chosen metadata and will not ovewrite the other.

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

The key:namespace character vector of the recycled length, invisibly. If both arguments "expires_at" and "notes" are missing, then nothing is set and a zero length character vector is returned.


TileDBStorr$set_keymeta_async()

Set key metadata asynchronously.

Usage

TileDBStorr$set_keymeta_async(key, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

expires_at

A date-time object of class POSIXct (optional).

notes

A scalar string of notes (optional).

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Details

Setting keymeta will update/replace only the chosen metadata and will not ovewrite the other.

Returns

A named list with two elements (invisibly):

  • mirai: a mirai object

  • keyns: The key:namespace string

If both arguments "expires_at" and "notes" are missing, then nothing is set and a zero length character vector is returned.


TileDBStorr$mset_keymeta_async()

Set multiple key metadata.

Usage

TileDBStorr$mset_keymeta_async(key, namespace = self$default_namespace,
  expires_at, notes, use_cache = getOption("storr.tiledb.cache", TRUE),
  cfg = NULL)

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

expires_at

A vector of date-times of class POSIXct (optional).

notes

A character vector of notes (optional).

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Details

Setting keymeta will update/replace only the chosen metadata and will not ovewrite the other.

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 named list with two elements (invisibly):

  • mirai: a mirai object

  • keyns: The key:namespace character vector of the recycled length

If both arguments "expires_at" and "notes" are missing, then nothing is set and a zero length character vector is returned.


TileDBStorr$get_keymeta()

Get key's metadata.

Usage

TileDBStorr$get_keymeta(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

The key name to get metadata values from.

namespace

The namespace to look the key within.

use_cache

Should it be retrieved from cache? Default is TRUE.

Returns

A named list with the key-metadata: "expires_at" and "notes".


TileDBStorr$mget_keymeta()

Get multiple key metadata.

Usage

TileDBStorr$mget_keymeta(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), 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.

use_cache

Should the cache be used? Default is TRUE.

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.


TileDBStorr$get_keymeta_expires_at()

Get key's expiration metadata.

Usage

TileDBStorr$get_keymeta_expires_at(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

The key name to get metadata values from.

namespace

The namespace to look the key within.

use_cache

Should it be retrieved from cache? Default is TRUE.

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.


TileDBStorr$get_keymeta_notes()

Get key's notes metadata.

Usage

TileDBStorr$get_keymeta_notes(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

The key name to get metadata values from.

namespace

The namespace to look the key within.

use_cache

Should it be retrieved from cache? Default is TRUE.

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.


TileDBStorr$mget_keymeta_expires_at()

Get expiration metadata for multiple keys.

Usage

TileDBStorr$mget_keymeta_expires_at(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), 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.

use_cache

Should the cache be used? Default is TRUE.

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.


TileDBStorr$mget_keymeta_notes()

Get notes metadata for multiple keys.

Usage

TileDBStorr$mget_keymeta_notes(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), 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.

use_cache

Should the cache be used? Default is TRUE.

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.


TileDBStorr$clear_keymeta()

Remove key metadata.

Usage

TileDBStorr$clear_keymeta(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

Details

This method is a convenient wrapper around set_keymeta() and mset_keymeta() and sets the key metadata fields to NA values, i.e., as.POSIXct(NA) and NA_character.

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

The key:namespace character vector of the recycled length, invisibly.


TileDBStorr$clear_keymeta_async()

Remove key metadata asynchronously.

Usage

TileDBStorr$clear_keymeta_async(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), cfg = NULL)

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

use_cache

Should the cache be used to retrieve the metadata? Default is TRUE. If a key:namespace not found in the cache, it will be fetched from database. Note that when setting FALSE, the cache will always be cleared for this key-namespace; this is to avoid mismatch between cache and database when reading back with use_cache = TRUE.

cfg

Pass a tiledb::config() object to override context's configuration.

Details

This method is a convenient wrapper around set_keymeta_async() and mset_keymeta_async() and sets the key metadata fields to NA values, i.e., as.POSIXct(NA) and NA_character.

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 named list with two elements (invisibly):

  • mirai: a mirai object

  • keyns: The key:namespace character vector of the recycled length


TileDBStorr$fill()

Set one or more keys to the same value.

Usage

TileDBStorr$fill(key, value, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE))

Arguments

key

A character vector of key names.

value

An R object to store.

namespace

A character vector of namespaces.

use_cache

Should the cache be used? Default is TRUE.

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 hash value, invisibly.


TileDBStorr$duplicate()

Duplicate a set of keys.

Usage

TileDBStorr$duplicate(key_src, key_dest, namespace = self$default_namespace,
  namespace_src = namespace, namespace_dest = namespace)

Arguments

key_src

A character vector of source keys.

key_dest

A character vector of destination keys.

namespace

The namespace to copy keys within (used only when namespace_src and namespace_dest are not provided).

namespace_src

The source namespace - use this where keys are duplicated across namespaces.

namespace_dest

The destination namespace - use this where keys are duplicated across namespaces.

Returns

NULL, invisibly.


TileDBStorr$clear()

Clear a storr.

Usage

TileDBStorr$clear(namespace = self$default_namespace)

Arguments

namespace

A scalar character of namespace name or NULL to clear all namespaces.

Returns

The number of deleted namespaces.


TileDBStorr$exists()

Check a key-namespace pair exists.

Usage

TileDBStorr$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.


TileDBStorr$exists_object()

Check a serialised object exists given a hash.

Usage

TileDBStorr$exists_object(hash)

Arguments

hash

A vector of hash values.

Returns

A logical vector indicating which object exists.


TileDBStorr$del()

Delete an object from the storr.

Usage

TileDBStorr$del(key, namespace = self$default_namespace)

Arguments

key

A character vector of key names.

namespace

A character vector of namespaces.

Details

This will delete only the key-namespace pointers(s) and not the underlying data. Explicit use of $gc() is required to remove the actual object when its hash is not associated with any key-namespace pair.

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 was deleted, invisibly.


TileDBStorr$keys_with_expiration()

Get the key-namespace pairs with expiration timestamps.

Usage

TileDBStorr$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.


TileDBStorr$expired_keys()

Get the expired key-namespace pairs.

Usage

TileDBStorr$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.


TileDBStorr$has_expired_keys()

Check for expired key-namespace pairs.

Usage

TileDBStorr$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.


TileDBStorr$is_key_expired()

Check a key-namespace for expiration.

Usage

TileDBStorr$is_key_expired(key, namespace = self$default_namespace,
  use_cache = getOption("storr.tiledb.cache", TRUE), check = TRUE)

Arguments

key

A scalar character of key name.

namespace

A scalar character of namespace name.

use_cache

Should the cache be used? Default is TRUE.

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


TileDBStorr$clear_expired_keys()

Remove the expired key-namespace pairs.

Usage

TileDBStorr$clear_expired_keys(namespace = self$default_namespace)

Arguments

namespace

A character vector of namespaces or NULL for all namespaces.

Returns

A boolean value TRUE indicating success, invisibly.


TileDBStorr$keys_with_notes()

Get the key-namespace pairs with notes.

Usage

TileDBStorr$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.


TileDBStorr$list()

List all keys stored in a namespace.

Usage

TileDBStorr$list(namespace = self$default_namespace)

Arguments

namespace

A scalar character of namespace name.

Returns

A sorted character vector with keys.


TileDBStorr$list_notes()

List notes given a namespace.

Usage

TileDBStorr$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.


TileDBStorr$list_hashes()

List all hashes stored in the storr.

Usage

TileDBStorr$list_hashes()

Returns

A sorted character vector with hashes.


TileDBStorr$list_unused_hashes()

List unused hashes stored in the storr.

Usage

TileDBStorr$list_unused_hashes()

Returns

A sorted character vector with unused hashes.


TileDBStorr$list_namespaces()

List all namespaces in the storr.

Usage

TileDBStorr$list_namespaces()

Returns

A sorted character vector with namespaces.


TileDBStorr$gc()

Garbage collect the storr.

Usage

TileDBStorr$gc(clear_expired = FALSE)

Arguments

clear_expired

Should the expired keys be deleted? Default is FALSE.

Details

This will delete the actual objects from store with unused hashes (i.e., not associated with any key-namespace pair).

Returns

A vector of unused hashes, invisibly.


TileDBStorr$import()

Import objects to storr.

Usage

TileDBStorr$import(src, list = NULL, namespace = self$default_namespace,
  skip_missing = FALSE)

Arguments

src

A source to import objects from. 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, all namespaces from src will be imported. If named, then the same rule is followed as list; namespace = c(a = b) will import the contents of namespace b as namespace a.

skip_missing

Logical, indicating if missing keys (specified in list) should be skipped over, rather than being treated as an error (the default).

Returns

A vector with destination namespaces, invisibly.


TileDBStorr$export()

Export objects from storr.

Use list() to export to a brand new list, or use as.list(object) for a shorthand.

Usage

TileDBStorr$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 export (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.


TileDBStorr$index_export()

Generate a data.table with an index of objects present in a storr.

Usage

TileDBStorr$index_export(namespace = NULL)

Arguments

namespace

A character vector of namespaces or NULL for all namespaces.

Returns

An object of class data.table.


TileDBStorr$index_import()

Import an index of objects from a storr.

Usage

TileDBStorr$index_import(index)

Arguments

index

A data.frame with minimum required columns 'namespace', 'key' 'hash' and optionally 'expires_at' and 'notes'. It is an error if not all hashes are present in the storr.

Returns

TRUE, invisibly.


TileDBStorr$export_tdb()

Export objects from storr to another TileDB storr.

Usage

TileDBStorr$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.