An enhanced version of TileDBArray with additional methods to operate on the array.
Initialization
A new TileDBArrayExp instance is initialised using the new() method.
Alternatively use tdb_array() to create a new instance and open the array
at READ mode.
# uri path
uri <- tempdir()
# new instance
obj <- TileDBArrayExp$new(uri = uri)
# does array exist at this uri
obj$exists() # FALSE
unlink(uri)Super classes
R6.tiledb::TileDBObject -> R6.tiledb::TileDBArray -> TileDBArrayExp
Active bindings
fragments_objectAccess the TileDBFragments instance for this array.
schema_versionRetrieve the schema version for this array.
is_sparseCheck array schema for sparsity.
sizeDirectory size.
Methods
Inherited methods
R6.tiledb::TileDBObject$class()R6.tiledb::TileDBObject$exists()R6.tiledb::TileDBObject$get_metadata()R6.tiledb::TileDBObject$initialize()R6.tiledb::TileDBObject$is_open()R6.tiledb::TileDBObject$set_metadata()R6.tiledb::TileDBArray$attributes()R6.tiledb::TileDBArray$attrnames()R6.tiledb::TileDBArray$close()R6.tiledb::TileDBArray$colnames()R6.tiledb::TileDBArray$dimensions()R6.tiledb::TileDBArray$dimnames()R6.tiledb::TileDBArray$open()R6.tiledb::TileDBArray$print()R6.tiledb::TileDBArray$schema()R6.tiledb::TileDBArray$schema_info()R6.tiledb::TileDBArray$tiledb_array()
Method create()
Create an empty Array with user defined schema.
The array will be opened at the given mode and kept opened; it can
be accessed via active field $object.
Arguments
schA TileDB schema. See constructor
tiledb::tiledb_array_schema().modeMode to open: either
"READ"or"WRITE"(default).
Method reopen()
Close and reopen the TileDB object in a new mode.
Usage
TileDBArrayExp$reopen(mode = c("READ", "WRITE"))Method consolidate()
Consolidates the fragments of the array into a single fragment.
Usage
TileDBArrayExp$consolidate(mode = c("fragments", "commits", "fragment_meta",
"array_meta"), cfg = NULL, start_time = NULL, end_time = NULL)Arguments
modeThe consolidate mode, one of the following:
"fragments": - consolidate all fragments (default)"commits": - consolidate all commit files"fragment_meta": - consolidate only fragment metadata footers to a single file"array_meta": - consolidate array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the consolidation. WhenNULL(default) the configuration parameters will be retrieved from object's context.start_time, end_timeOptional time stamp values. A date time objects of class
POSIXt. If not provided, the default values from configuration object will be used.
Method consolidate_async()
Consolidate fragments of the array into a single fragment asynchronously.
The consolidation will run in a separate R process in a clean environment.
Note this function requires the mirai package.
Usage
TileDBArrayExp$consolidate_async(mode = c("fragments", "commits",
"fragment_meta", "array_meta"), cfg = NULL, start_time = NULL,
end_time = NULL)Arguments
modeThe consolidate mode, one of the following:
"fragments": - consolidate all fragments (default)"commits": - consolidate all commit files"fragment_meta": - consolidate only fragment metadata footers to a single file"array_meta": - consolidate array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the consolidation. WhenNULL(default) the configuration parameters will be retrieved from object's context.start_time, end_timeOptional time stamp values. A date time objects of class
POSIXt. If not provided, the default values from configuration object will be used.
Returns
This function will return a mirai::mirai() object immediately. When it is
resolved, it returns TRUE indicating consolidation success.
Method vacuum()
Clean up consolidated fragments and array metadata.
Usage
TileDBArrayExp$vacuum(mode = c("fragments", "commits", "fragment_meta",
"array_meta"), cfg = NULL)Arguments
modeThe vacuum mode, one of the following:
"fragments": - vacuum all fragments (default)"commits": - vacuum all commit files"fragment_meta": - vacuum only fragment metadata footers to a single file"array_meta": - vacuum array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the vacuum. WhenNULL(default) the configuration parameters will be retrieved from object's context.
Method vacuum_async()
Asynchronously clean up consolidated fragments and array metadata.
The clean up will run in a separate R process in a clean environment.
Note this function requires the mirai package.
Usage
TileDBArrayExp$vacuum_async(mode = c("fragments", "commits", "fragment_meta",
"array_meta"), cfg = NULL)Arguments
modeThe vacuum mode, one of the following:
"fragments": - vacuum all fragments (default)"commits": - vacuum all commit files"fragment_meta": - vacuum only fragment metadata footers to a single file"array_meta": - vacuum array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the vacuum process. WhenNULL(default) the configuration parameters will be retrieved from object's context.
Returns
This function will return a mirai::mirai() object immediately. When it is
resolved, it returns TRUE indicating vacuum success.
Method consolidate_and_vacuum()
Consolidates and vacuums the fragments.
Usage
TileDBArrayExp$consolidate_and_vacuum(mode = c("fragments", "commits",
"fragment_meta", "array_meta"), cfg = NULL, start_time = NULL,
end_time = NULL)Arguments
modeThe consolidate and vacuum mode, one of the following:
"fragments": - consolidate all fragments (default)"commits": - consolidate all commit files"fragment_meta": - consolidate only fragment metadata footers to a single file"array_meta": - consolidate array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the consolidation and vacuum. WhenNULL(default) the configuration parameters will be retrieved from object's context.start_time, end_timeOptional time stamp values. A date time objects of class
POSIXt. If not provided, the default values from configuration object will be used.
Method consolidate_and_vacuum_async()
Consolidate and vacuum fragments asynchronously.
The consolidation and vacuum will run in a separate R process in a clean environment.
Note this function requires the mirai package.
Usage
TileDBArrayExp$consolidate_and_vacuum_async(mode = c("fragments", "commits",
"fragment_meta", "array_meta"), cfg = NULL, start_time = NULL,
end_time = NULL)Arguments
modeThe consolidate and vacuum mode, one of the following:
"fragments": - consolidate all fragments (default)"commits": - consolidate all commit files"fragment_meta": - consolidate only fragment metadata footers to a single file"array_meta": - consolidate array metadata only
cfgA configuration object
tiledb::tiledb_config()to set parameters for the consolidation and vacuum. WhenNULL(default) the configuration parameters will be retrieved from object's context.start_time, end_timeOptional time stamp values. A date time objects of class
POSIXt. If not provided, the default values from configuration object will be used.
Returns
This function will return a mirai::mirai() object immediately. When it is
resolved, it returns TRUE indicating consolidation success.
Method frag_to_vacuum()
Consolidated fragments to be removed.
Returns
An object of class data.frame with four columns:
Fragment: the fragment index (starts at 1)start_timestamp: fragment's start time stampend_timestamp: fragment's end time stampURI: fragment's truncated uri path (fragment name) whentrunc_uri = TRUE(default), otherwise the full uri path
Note that the return object will be of class data.table if the
package is found in your system.
Method frag_uris()
Return a data.frame with time stamps and
fragments uris.
Returns
An object of class data.frame with four columns:
Fragment: the fragment index (start at 1)start_timestamp: start time-stamp of when fragment was writtenend_timestamp: end time-stamp of when fragment was writtenURI: fragment's truncated uri path (fragment name) whentrunc_uri = TRUE(default), otherwise the full uri path
Note that the return object will be of class data.table if the
package is found in your system.
Method schema_upgrade()
Upgrade the array to the latest format version.
Arguments
cfgA configuration object
tiledb::tiledb_config().ctxOptional
tiledb::tiledb_ctx()object. By default, object's context is used.