View source: R/retrieveMetadata.R
| retrieveMetadata | R Documentation |
Given a namespace identifier (identifies the shared memory space to register to), this function retrieves the metadata of the stored variable.
NOTE: If no view of the variable was previously retrieved this implicitly retrieves a view and thus has to free'd afterwards!
retrieveMetadata(namespace, variableName)
namespace |
string of the identifier of the shared memory context. |
variableName |
[1:m] character vector, names of one ore more than one variable to retrieve the metadata from the shared memory space. |
In some contexts, querying metadata may create an implicit view. If so, you must call
releaseViews for that variable afterwards. See examples.
A [1:m] named list mapping the variable names to their retrieved metadata. Each list element contains a list of two elements called "type" and length "n"
Julian Maerte
releaseVariables, releaseViews, registerVariables
## Not run:
# MASTER SESSION:
# allocate data
## End(Not run)
n = 1000
m = 100
mat = matrix(rnorm(n * m), n, m) # target matrix
namespace = "ns_meta"
memshare::registerVariables(namespace, list(mat=mat))
## Not run:
# WORKER SESSION:
# retrieve metadata of the variable
## End(Not run)
res = memshare::retrieveMetadata(namespace, "mat")
## Not run:
# res$type = "matrix"
# res$nrow = 1000
# res$ncol = 100
## End(Not run)
releaseViews(namespace, c("mat"))
## Not run:
# MASTER SESSION:
# free memory
## End(Not run)
memshare::releaseVariables(namespace, c("mat"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.