These are internal only.
A few helpers to get specific things from the cache repository
getFunctionName(FUN, originalDots, ..., overrideCall, isPipe).digestRasterLayer(object, length, algo, quick)
getUserTags(cacheRepo, shownCache, cacheId, concatenated = TRUE)
getCacheId(cacheRepo, shownCache, artifact)
getArtifact(cacheRepo, shownCache, cacheId)
A function
passing the ...
from outer function, which will include potential
arguments to the FUN
A character string indicating a different (not "Cache") function name to search for. Mostly so that this works with deprecated "cache".
Logical. If the call to getFunctionName
is coming from a pipe, there is more
information available. Specifically, ._lhs
which is already a call.
Numeric. If the element passed to Cache is a Path
class
object (from e.g., asPath(filename)
) or it is a Raster
with
file-backing, then this will be
passed to digest::digest
, essentially limiting the number of bytes
to digest (for speed). This will only be used if quick = FALSE
.
Default is getOption("reproducible.length")
, which is set to Inf
.
The algorithms to be used; currently available choices are
md5
, which is also the default, sha1
, crc32
,
sha256
, sha512
, xxhash32
, xxhash64
,
murmur32
, spookyhash
and blake3
.
Logical. If TRUE
,
little or no disk-based information will be assessed, i.e., mostly its
memory content. This is relevant for objects of class character
,
Path
and Raster
currently. For class character
, it is ambiguous
whether this represents a character string or a vector of file paths. The function
will assess if it is a path to a file or directory first. If not, it will treat
the object as a character string. If it is known that character strings should
not be treated as paths, then quick = TRUE
will be much faster, with no loss
of information. If it is file or directory, then it will digest the file content,
or basename(object)
. For class Path
objects, the file's metadata
(i.e., filename and file size) will be hashed instead of the file contents if
quick = TRUE
.
If set to FALSE
(default), the contents of the file(s) are hashed.
If quick = TRUE
, length
is ignored. Raster
objects are treated
as paths, if they are file-backed.
A repository used for storing cached objects.
This is optional if Cache
is used inside a SpaDES module.
Primary way of supplying cacheRepo
; the data.table obj
resulting from showCache
, i.e., it will override cacheRepo
.
If this and cacheRepo
are missing, then it will default to
getOption('reproducible.cachePath')
A character vector of cacheId values to use in the cache
Logical. If TRUE
, the returned userTags
will
be concatenated tagKey:tagValue
.
Character vector of artifact values in the
artifact
column of showCache
getCacheId
returns the cacheId
values for 1 or more artifacts in the cache.
getArtifact
returns the artifact
value for 1 or more
entries in the cache, by cacheId
.