infer_save_locations: Generates plan of where and how save objects, which is used...

Description Usage Arguments Value

View source: R/runtime_objects.R

Description

Generates plan of where and how save objects, which is used by other low-level functions

Usage

1
2
3
4
infer_save_locations(storagepath, objectnames = NULL, obj.environment,
  flag_forced_save_filenames = FALSE, flag_use_tmp_storage = FALSE,
  forced_archive_paths = NA, compress = "gzip",
  large_archive_prefix = NULL)

Arguments

storagepath

Path with the storage.

objectnames

Character vector with the names of the objects to add. Defaults to all objects in the obj.environment.

obj.environment

Environment or named list with the objects. It is needed only for getting the object sizes in case user selects the default algorithm.

flag_forced_save_filenames

Controls, whether force a particular object in its own dedicated archive. Value can be either single boolean, or vector of booleans with the same size as objectnames, or named boolean vector with keys values of objectnames. In the latter case, non-mentioned objects will be assumed value FALSE (i.e. not forced filename).

flag_use_tmp_storage

Relevant only for xz compression with the external tool pxz. Normally the object will be quickly saved without compression, then compressed in the background and at the end the filenames will be swapped. Setting this flag will force saving in the quick \tmp directory, instead of the target path. It is usefull if the target path is very slow (perhaps a distant network share). Value can be either single boolean, or vector of booleans with the same size as objectnames, or named boolean vector with keys values of objectnames. In the latter case, non-mentioned objects will be assumed value FALSE (i.e. not forced filename).

forced_archive_paths

Overrides a specific path for the object. More than one object can be given the same path - in that case the archive will be of the "multiple objects" type. This override is a stronger version of parameter flag_forced_save_filenames - the difference is that it allows for manual naming and locating the archives. Value can be either single character, or vector of characters with the same size as objectnames, or named character vector with keys values of objectnames. In the latter case, non-mentioned objects will be assumed value NA (i.e. not having forced filename).

compress

Controls the compression of the archive. It is important to realize, that if the archive had already contained some objects prior to modifying it and the modification would not remove the objects, those objects will be re-compressed with the compress compression, since the archive will effectively be re-added. Supports 3 calues: none, gzip and xz. Value can be either single character, or vector of characters with the same size as objectnames, or named character vector with keys values of objectnames. In the latter case, non-mentioned objects will be assumed value gzip.

large_archive_prefix

If set, all new archives for large objects will be saved with this prefix, otherwise in the dirname(storagepath). storagepath. It is up to the user to make sure this directory is empty and no file name conflicts will arise.

default_save_directory_suffix

Default location for each saved archive, absolute or relative to the storagepath. Defaults to '', i.e. the objects will be saved in the same place as the storagepath.

Value

Returns list with one element for each archive to touch. Each element will be a list with the following properties

objectnames

Character vector with one or more object names that are going to be stored in this archive.

archive_filename

Character vector with the path to the archive, stored as relative path to the storagepath

compress

Compression method for all files

flag_use_tmp_storage

Whether or not use the temporary storage


adamryczkowski/objectstorage documentation built on May 24, 2019, 8:47 p.m.