Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions spec/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# get / `dvs get` / `dvs::dvs_get`

## CLI

The option to return `--json` must be present.

```shell
$ dvs get <PATHS> [OPTIONS] --help

Paths:
Optional list of files or directories to retrieve from storage. If missing, then all files
are retrieved, analogous to `dvs sync`

Options:
--json Outputs are emitted in a JSON format
--glob Specify a glob expression for which tracked datafiles and/or directories to retrieve
--help, -h
```

`dvs get` shall accept directories as arguments, unlike `dvs add`, the activity of syncing a complete directory is within expected user workflow, while adding directories can be done unintentionally, and have ramifications on the coherence of the dvs backend/storage.

## R

Signature:

```r
#' @param paths,glob provide a list of files to sync from backend, either explicitly `files` or via glob expression `glob`.
#' @param progress provide a progress bar
#' @param parallel control number of threads to use, `FALSE`/`0`, while `TRUE` implies at most 16 threads, or provide non-zero integer for more.
dvs_get <- function(
paths = character(),
glob = character(),
progress = FALSE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not part of the shell spec? will this not be a bit more complicated to implement if this is happening in rust land where its harder?? to tick a progress bar?

parallel = TRUE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like operator overloading in general - its confusing/ambiguous as to what to pass, i also think in general users shouldn't need to think about this that often. It is important that its tuneable, but its an edge case that a user should think about it. Similar to data table threads or vroom number of cpus.

eg

Controlling Threads: Set the environment variable VROOM_THREADS before calling vroom() to limit parallel usage (e.g.Sys.setenv(VROOM_THREADS = 2)).
Backend Usage: The readr 2.0+ package uses vroom as a backend, which respects the VROOM_THREADS setting.

)
```

## Initial release concerns

### Timeout / cancellation

In case of retrieving large amount of data (either a lot of files, or big files, or both) the user may cancel the operation via `Ctrl+C`, or a connection can timeout, or similar. The `get` command ought to be able to continue from elapsed progress, and it should tell the user, that indeed,
it is resuming a previous retrieval.