stagingData | R Documentation |
Low level functions for handling registry staging data at Rapporteket. As such, these functions does not provide staging data management per se. Proper management, e.g. staging data updates and fallback logic must therefore be established within each registry that take staging data into use.
listStagingData(registryName)
mtimeStagingData(registryName)
saveStagingData(registryName, dataName, data)
loadStagingData(registryName, dataName)
deleteStagingData(registryName, dataName)
cleanStagingData(eolAge, dryRun = TRUE)
registryName |
Character string providing the registry name. |
dataName |
Character string providing the data set name. |
data |
A data object such as a data.frame to be stored as
|
eolAge |
Numeric providing the staging data end-of-life age in seconds.
Based on the current time and the time of storage staging files
older than |
dryRun |
Logical defining if function is to be run in dry (none destructive) mode. |
Staging data is stored as binary large objects in a database. A per registry symmetric encryption of storage content is enforced. Keys used for encryption are generated from existing database credentials. Therefore, please note that removing or changing such credentials will render any historic staging data inaccessible.
cleanStagingData()
globally removes all staging data with store date
prior to the end-of-life age provided. This is a vastly destructive function
that should be used with great care.
listStagingData()
returns a character vector of staging data
sets for the given registry (registryName
).
mtimeStagingData()
returns a staging data set named POSIXct
vector of modification times for the given registry
(registryName
).
saveStagingData()
when successful returns the data object
(data
), invisibly. If saving fails a warning is issued and the
function returns FALSE.
loadStagingData()
returns the data object corresponding to
the name given upon saving (dataName
). If the requested data set
for loading does not exist the function returns FALSE.
deleteStagingData()
returns TRUE if the data set was deleted
and FALSE if not.
cleanStagingData()
returns a list of data sets (to be)
removed.
## Prep test data
registryName <- "rapbase"
dataName <- "testData"
data <- mtcars
## Save data for staging
try(saveStagingData(registryName, dataName, data))
## List data currently in staging
try(listStagingData(registryName))
## Retrieve data set from staging and compare to outset
try(stagedData <- loadStagingData(registryName, dataName))
try(identical(data, stagedData))
## Get modification time for staging file(s)
try(mtimeStagingData(registryName))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.