~hrbrmstr/sergeant

ff6c1f6edf1af173b76a329e0d30803e3abbac8e — hrbrmstr 2 years ago 40e2355
drill_up() for Docker crunchy goodness; cleaned up some storage REST API functions
M NAMESPACE => NAMESPACE +2 -0
@@ 5,6 5,7 @@ S3method(db_data_type,DrillConnection)
S3method(db_desc,src_drill)
S3method(db_explain,DrillConnection)
S3method(db_query_fields,DrillConnection)
S3method(print,drill_conn)
S3method(sql_escape_ident,DrillConnection)
S3method(sql_translate_env,DrillConnection)
S3method(src_tbls,src_drill)


@@ 33,6 34,7 @@ export(drill_status)
export(drill_storage)
export(drill_system_reset)
export(drill_threads)
export(drill_up)
export(drill_uplift)
export(drill_use)
export(drill_version)

A R/drill-docker.R => R/drill-docker.R +84 -0
@@ 0,0 1,84 @@
#' Start a Dockerized Drill Instance
#'
#' This is a "get you up and running quickly" helper function as it only
#' runs a standalone mode Drill instance and is optionally removed after the container
#' is stopped. You should customize your own Drill containers based on the
#' one at [Drill's Docker Hub](https://hub.docker.com/u/drill).
#'
#' The path specified in `data_dir` will be mapped inside the container as
#' `/data` and a new `dfs` storage workspace will created (`dfs.d`) that
#' maps to `/data` and is writable.
#'
#' @md
#' @note this requires a working Docker setup on your system and it is *highly suggested*
#'       you `docker pull` it yourself before running this function.
#' @param image Drill image to use. Must be a valid image from
#'        [Drill's Docker Hub](https://hub.docker.com/u/drill). Defaults
#'        to most recent Drill docker image.
#' @param container_name naem for the container. Defaults to "`drill`".
#' @param data_dir valid path to a place where your data is stored; defaults to the
#'        value of [getwd()]. This will be [path.expand()]ed and mapped to `/data`
#'        in the container. This will be mapped to the `dfs` storage plugin as the
#'        `dfs.d` workspace.
#' @param remove remove the Drill container instance after it's stopped?
#'        Defaults to `TRUE` since you shouldn't be relying on this in production.
#' @return a `stevedore` docker object (invisibly) which *you* are responsible
#'         for killing with the `$stop()`  function or from the Docker command
#'         line (in interactive mode the docker container ID is printed as well).
#' @export
#' @examples \dontrun{
#' drill_up(data_dir = "~/Data")
#' }
drill_up <- function(image = "drill/apache-drill:1.15.0",
                     container_name = "drill",
                     data_dir = getwd(), remove = TRUE) {

  data_dir <- path.expand(data_dir)

  stopifnot(dir.exists(data_dir))

  docker <- stevedore::docker_client()

  docker$container$run(
    image = image,
    name = container_name,
    ports = "8047:8047",
    detach = TRUE,
    rm = remove,
    tty = TRUE,
    cmd = "/bin/bash",
    volumes = sprintf("%s:/data", data_dir)
  ) -> drill

  if (interactive()) {
    message(
      "Drill container started. Waiting for the service to become active (this may take up to 30s)."
    )
  }

  drill_con <- drill_connection("localhost")

  for (i in 1:30) {
    if (drill_active(drill_con)) break
    Sys.sleep(1L)
  }

  if (!drill_active(drill_con)) {
    stop("Could not connect to Drill container.")
  }

  r <- drill_storage(drill_con, "dfs", "raw")

  gsub(
    '"workspaces" : \\{',
    '"workspaces" : \\{\n  "d" : { "location" : "/data", "writable" : true, "defaultInputFormat" : null, "allowAccessOutsideWorkspace" : false },',
    r
  ) -> r

  drill_mod_storage(drill_con, "dfs", r)

  if (interactive()) message("Drill container ID: ", drill$id())

  invisible(drill)

}

M R/query.r => R/query.r +1 -1
@@ 15,7 15,7 @@
#' @param .progress if \code{TRUE} (default if in an interactive session) then ask
#'                  \code{httr::POST} to display a progress bar
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
#' @examples
#' try({

M R/schemas.R => R/schemas.R +3 -3
@@ 2,7 2,7 @@
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
drill_show_schemas <- function(drill_con) {
  drill_query(drill_con, "SHOW SCHEMAS", .progress=FALSE)


@@ 14,7 14,7 @@ drill_show_schemas <- function(drill_con) {
#' @param schema_name A unique name for a Drill schema. A schema in Drill is a configured
#'                   storage plugin, such as hive, or a storage plugin and workspace.
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
drill_use <- function(drill_con, schema_name) {
  query <- sprintf("USE `%s`", schema_name)


@@ 29,7 29,7 @@ drill_use <- function(drill_con, schema_name) {
#' @param schema_spec properly quoted "filesystem.directory_name" reference path
#' @export
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples
#' try({
#' drill_connection() %>% drill_show_files("dfs.tmp")

M R/sergeant.r => R/sergeant.r +53 -27
@@ 10,7 10,7 @@ s_head <- purrr::safely(httr::HEAD)
#' @note If `user`/`password` are set this function will make a `POST` to the REST
#'       interface immediately to prime the cookie-jar with the session id.
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples
#' dc <- drill_connection()
drill_connection <- function(host=Sys.getenv("DRILL_HOST", "localhost"),


@@ 34,13 34,13 @@ drill_connection <- function(host=Sys.getenv("DRILL_HOST", "localhost"),

}

#' Test whether Drill HTTP Dill direct REST API Interface server is up
#' Test whether Drill HTTP Drill direct REST API Interface server is up
#'
#' This is a very simple test (performs \code{HEAD /} request on the Drill server/cluster)
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples
#' try({
#' drill_connection() %>% drill_active()


@@ 55,7 55,7 @@ drill_active <- function(drill_con) {
#' @note The output of this is in a "viewer" window
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>% drill_status()
#' }


@@ 72,7 72,7 @@ drill_status <- function(drill_con) {
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>% drill_metrics()
#' }


@@ 89,7 89,7 @@ drill_metrics <- function(drill_con) {
#' @note The output of this is in a "viewer" window
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>% drill_threads()
#' }


@@ 107,7 107,7 @@ drill_threads <- function(drill_con) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>% drill_profiles()
#' }


@@ 124,7 124,7 @@ drill_profiles <- function(drill_con) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param query_id UUID of the query in standard UUID format that Drill assigns to each query
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
drill_profile <- function(drill_con, query_id) {
  drill_server <- make_server(drill_con)


@@ 139,7 139,7 @@ drill_profile <- function(drill_con, query_id) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param query_id the UUID of the query in standard UUID format that Drill assigns to each query.
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
drill_cancel <- function(drill_con, query_id) {
  drill_server <- make_server(drill_con)


@@ 149,13 149,20 @@ drill_cancel <- function(drill_con, query_id) {
  invisible(TRUE)
}

#' Get the list of storage plugin names and configurations
#' Retrieve, modify or update storage plugin names and configurations
#'
#' Retrieve, modify or remove storage plugins from a Drill instance. If you intend
#' to modify an existing configuration it is suggested that you use the "`list`" or
#' "`raw`" values to the `as` parameter to make it easier to modify them.
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param plugin the assigned name in the storage plugin definition.
#' @param as one of "`tbl`" or "`list`" or "`raw`". The latter two are useful if you want
#'        modify an existing storage plugin (e.g. add a workspace) via
#'        [drill_mod_storage()].
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>% drill_storage()
#'


@@ 181,7 188,9 @@ drill_cancel <- function(drill_con, query_id) {
#' }
#' ')
#' }
drill_storage <- function(drill_con, plugin=NULL) {
drill_storage <- function(drill_con, plugin=NULL, as=c("tbl", "list", "raw")) {

  as <- match.arg(as[1], c("tbl", "list", "raw"))

  drill_server <- make_server(drill_con)



@@ 193,18 202,24 @@ drill_storage <- function(drill_con, plugin=NULL) {

  httr::stop_for_status(res)

  cnt <- httr::content(res, as="text", encoding="UTF-8")
  jsonlite::fromJSON(cnt, flatten=TRUE) %>%
    dplyr::tbl_df()
  out <- httr::content(res, as="text", encoding="UTF-8")

  switch(
    as,
    tbl = jsonlite::fromJSON(out, flatten=TRUE) %>% dplyr::tbl_df(),
    list = jsonlite::fromJSON(
      out, simplifyVector = TRUE, simplifyDataFrame = FALSE, flatten = FALSE
    ),
    raw = out
  )

}

#' @md
#' @rdname drill_storage
#' @param name name of the storage plugin configuration to create/update/remove
#' @param config a `list` or raw character, valid JSON of a complete storage
#'        spec
#' @family Dill direct REST API Interface
#' @param config a raw 1-element character vector containing valid JSON of a
#'        complete storage spec
#' @export
drill_mod_storage <- function(drill_con, name, config) {



@@ 213,19 228,20 @@ drill_mod_storage <- function(drill_con, name, config) {
  httr::POST(
    url = sprintf("%s/storage/%s.json", drill_server, name),
    httr::content_type_json(),
    body = config
    body = config,
    encode = "raw"
  ) -> res

  httr::stop_for_status(res)

  cnt <- httr::content(res, as="text", encoding="UTF-8")
  jsonlite::fromJSON(cnt, flatten=TRUE)
  out <- httr::content(res, as="text", encoding="UTF-8")

  invisible(jsonlite::fromJSON(out, flatten=TRUE)$result == "success")

}

#' @md
#' @rdname drill_storage
#' @family Dill direct REST API Interface
#' @export
drill_rm_storage <- function(drill_con, name) {



@@ 248,7 264,7 @@ drill_rm_storage <- function(drill_con, name) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param pattern pattern to filter results by
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @examples \dontrun{
#' drill_connection() %>% drill_options()


@@ 268,7 284,7 @@ drill_options <- function(drill_con, pattern=NULL) {
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @examples \dontrun{
#' drill_connection() %>% drill_stats()


@@ 285,7 301,7 @@ drill_stats <- function(drill_con) {
#'
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @examples \dontrun{
#' drill_connection() %>% drill_version()


@@ 309,7 325,7 @@ drill_version <- function(drill_con) {
#' @note You _must_ be using Drill 1.15.0+ to use this function
#' @export
#' @return data frame
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @examples \dontrun{
#' drill_connection() %>% drill_functions()


@@ 352,7 368,7 @@ drill_functions <- function(drill_con, browse=FALSE) {
#' @note You _must_ be using Drill 1.15.0+ to use this function
#' @export
#' @return data frame
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/querying-system-tables/#querying-the-options-table}{Drill documentation}
#' @examples \dontrun{
#' drill_connection() %>% drill_opts()


@@ 385,3 401,13 @@ drill_opts <- function(drill_con, browse=FALSE) {
  out

}

#' Print function for `drill_conn` objects
#'
#' @md
#' @param x a `drill_conn` object made with [drill_connection()]
#' @param ... unused
#' @export
print.drill_conn <- function(x, ...) {
  cat(sprintf("<Drill REST API Direct Connection to %s:%s>\n", x$host, x$port))
}

M R/set.R => R/set.R +3 -3
@@ 12,7 12,7 @@
#' @return a \code{tbl} (invisibly) with the \code{ALTER} queries sent and results, including errors.
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @export
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @examples \dontrun{
#' drill_connection() %>%
#'   drill_set(exec.errors.verbose=TRUE, store.format="parquet", web.logs.max_lines=20000)


@@ 55,7 55,7 @@ drill_set <- function(drill_con, ..., type=c("session", "system")) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param ... bare name of system options to reset
#' @param all if \code{TRUE}, all parameters are reset (\code{...} is ignored)
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @export
#' @examples \dontrun{


@@ 98,7 98,7 @@ drill_system_reset <- function(drill_con, ..., all=FALSE) {
#' @param drill_con drill server connection object setup by \code{drill_connection()}
#' @param ... bare name of system options to reset
#' @references \href{https://drill.apache.org/docs/}{Drill documentation}
#' @family Dill direct REST API Interface
#' @family Drill direct REST API Interface
#' @export
#' @examples \dontrun{
#' drill_connection() %>% drill_settings_reset(exec.errors.verbose)

M README.Rmd => README.Rmd +2 -1
@@ 85,7 85,8 @@ Note that a number of Drill SQL functions have been mapped to R functions (e.g. 
**Helpers**

- `ctas_profile`: Generate a Drill CTAS Statement from a Query

- `drill_up`: 
Start a Dockerized Drill Instance
## Installation

```{r eval=FALSE}

M README.md => README.md +1 -0
@@ 112,6 112,7 @@ function mappings.

  - `ctas_profile`: Generate a Drill CTAS Statement from a Query

  - `drill_up`: Start a Dockerized Drill Instance
## Installation

``` r

M man/drill_active.Rd => man/drill_active.Rd +3 -3
@@ 2,7 2,7 @@
% Please edit documentation in R/sergeant.r
\name{drill_active}
\alias{drill_active}
\title{Test whether Drill HTTP Dill direct REST API Interface server is up}
\title{Test whether Drill HTTP Drill direct REST API Interface server is up}
\usage{
drill_active(drill_con)
}


@@ 18,7 18,7 @@ drill_connection() \%>\% drill_active()
}, silent=TRUE)
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_cancel}},
Other Drill direct REST API Interface: \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},


@@ 33,4 33,4 @@ Other Dill direct REST API Interface: \code{\link{drill_cancel}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_cancel.Rd => man/drill_cancel.Rd +2 -2
@@ 18,7 18,7 @@ Cancel the query that has the given queryid
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},


@@ 33,4 33,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_connection.Rd => man/drill_connection.Rd +2 -2
@@ 29,7 29,7 @@ interface immediately to prime the cookie-jar with the session id.
dc <- drill_connection()
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},


@@ 44,4 44,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_functions.Rd => man/drill_functions.Rd +2 -2
@@ 30,7 30,7 @@ drill_connection() \%>\% drill_functions()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},


@@ 45,4 45,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_metrics.Rd => man/drill_metrics.Rd +2 -2
@@ 18,7 18,7 @@ drill_connection() \%>\% drill_metrics()
}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 34,4 34,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_options.Rd => man/drill_options.Rd +2 -2
@@ 23,7 23,7 @@ drill_connection() \%>\% drill_options()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 39,4 39,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_opts.Rd => man/drill_opts.Rd +2 -2
@@ 30,7 30,7 @@ drill_connection() \%>\% drill_opts()
\href{https://drill.apache.org/docs/querying-system-tables/#querying-the-options-table}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 46,4 46,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_profile.Rd => man/drill_profile.Rd +2 -2
@@ 18,7 18,7 @@ Get the profile of the query that has the given queryid
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 34,4 34,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_profiles.Rd => man/drill_profiles.Rd +2 -2
@@ 21,7 21,7 @@ drill_connection() \%>\% drill_profiles()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 37,4 37,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_query.Rd => man/drill_query.Rd +2 -2
@@ 36,7 36,7 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 52,4 52,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_set.Rd => man/drill_set.Rd +2 -2
@@ 34,7 34,7 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 50,4 50,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_settings_reset.Rd => man/drill_settings_reset.Rd +2 -2
@@ 23,7 23,7 @@ drill_connection() \%>\% drill_settings_reset(exec.errors.verbose)
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 38,4 38,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_show_files.Rd => man/drill_show_files.Rd +2 -2
@@ 23,7 23,7 @@ drill_connection() \%>\% drill_show_files("dfs.tmp")
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 39,4 39,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_show_schemas.Rd => man/drill_show_schemas.Rd +2 -2
@@ 16,7 16,7 @@ Returns a list of available schemas.
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 31,4 31,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_stats.Rd => man/drill_stats.Rd +2 -2
@@ 21,7 21,7 @@ drill_connection() \%>\% drill_stats()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 36,4 36,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_status.Rd => man/drill_status.Rd +2 -2
@@ 21,7 21,7 @@ drill_connection() \%>\% drill_status()
}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 36,4 36,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_storage.Rd => man/drill_storage.Rd +13 -37
@@ 4,9 4,9 @@
\alias{drill_storage}
\alias{drill_mod_storage}
\alias{drill_rm_storage}
\title{Get the list of storage plugin names and configurations}
\title{Retrieve, modify or update storage plugin names and configurations}
\usage{
drill_storage(drill_con, plugin = NULL)
drill_storage(drill_con, plugin = NULL, as = c("tbl", "list", "raw"))

drill_mod_storage(drill_con, name, config)



@@ 17,13 17,19 @@ drill_rm_storage(drill_con, name)

\item{plugin}{the assigned name in the storage plugin definition.}

\item{as}{one of "`tbl`" or "`list`" or "`raw`". The latter two are useful if you want
modify an existing storage plugin (e.g. add a workspace) via
[drill_mod_storage()].}

\item{name}{name of the storage plugin configuration to create/update/remove}

\item{config}{a \code{list} or raw character, valid JSON of a complete storage
spec}
\item{config}{a raw 1-element character vector containing valid JSON of a
complete storage spec}
}
\description{
Get the list of storage plugin names and configurations
Retrieve, modify or remove storage plugins from a Drill instance. If you intend
to modify an existing configuration it is suggested that you use the "`list`" or
"`raw`" values to the `as` parameter to make it easier to modify them.
}
\examples{
\dontrun{


@@ 56,37 62,7 @@ drill_connection() \%>\%
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_show_files}},
  \code{\link{drill_show_schemas}},
  \code{\link{drill_stats}}, \code{\link{drill_status}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}

Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},
  \code{\link{drill_metrics}}, \code{\link{drill_options}},
  \code{\link{drill_opts}}, \code{\link{drill_profiles}},
  \code{\link{drill_profile}}, \code{\link{drill_query}},
  \code{\link{drill_settings_reset}},
  \code{\link{drill_set}}, \code{\link{drill_show_files}},
  \code{\link{drill_show_schemas}},
  \code{\link{drill_stats}}, \code{\link{drill_status}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}

Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 101,4 77,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_threads}}, \code{\link{drill_use}},
  \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_system_reset.Rd => man/drill_system_reset.Rd +2 -2
@@ 25,7 25,7 @@ drill_connection() \%>\% drill_system_reset(all=TRUE)
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 39,4 39,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_storage}}, \code{\link{drill_threads}},
  \code{\link{drill_use}}, \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_threads.Rd => man/drill_threads.Rd +2 -2
@@ 21,7 21,7 @@ drill_connection() \%>\% drill_threads()
}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 36,4 36,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_use}}, \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

A man/drill_up.Rd => man/drill_up.Rd +49 -0
@@ 0,0 1,49 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/drill-docker.R
\name{drill_up}
\alias{drill_up}
\title{Start a Dockerized Drill Instance}
\usage{
drill_up(image = "drill/apache-drill:1.15.0", container_name = "drill",
  data_dir = getwd(), remove = TRUE)
}
\arguments{
\item{image}{Drill image to use. Must be a valid image from
\href{https://hub.docker.com/u/drill}{Drill's Docker Hub}. Defaults
to most recent Drill docker image.}

\item{container_name}{naem for the container. Defaults to "\code{drill}".}

\item{data_dir}{valid path to a place where your data is stored; defaults to the
value of \code{\link[=getwd]{getwd()}}. This will be \code{\link[=path.expand]{path.expand()}}ed and mapped to \code{/data}
in the container. This will be mapped to the \code{dfs} storage plugin as the
\code{dfs.d} workspace.}

\item{remove}{remove the Drill container instance after it's stopped?
Defaults to \code{TRUE} since you shouldn't be relying on this in production.}
}
\value{
a \code{stevedore} docker object (invisibly) which \emph{you} are responsible
for killing with the \code{$stop()}  function or from the Docker command
line (in interactive mode the docker container ID is printed as well).
}
\description{
This is a "get you up and running quickly" helper function as it only
runs a standalone mode Drill instance and is optionally removed after the container
is stopped. You should customize your own Drill containers based on the
one at \href{https://hub.docker.com/u/drill}{Drill's Docker Hub}.
}
\details{
The path specified in \code{data_dir} will be mapped inside the container as
\code{/data} and a new \code{dfs} storage workspace will created (\code{dfs.d}) that
maps to \code{/data} and is writable.
}
\note{
this requires a working Docker setup on your system and it is \emph{highly suggested}
you \code{docker pull} it yourself before running this function.
}
\examples{
\dontrun{
drill_up(data_dir = "~/Data")
}
}

M man/drill_use.Rd => man/drill_use.Rd +2 -2
@@ 19,7 19,7 @@ Change to a particular schema.
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 34,4 34,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_version}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

M man/drill_version.Rd => man/drill_version.Rd +2 -2
@@ 21,7 21,7 @@ drill_connection() \%>\% drill_version()
\href{https://drill.apache.org/docs/}{Drill documentation}
}
\seealso{
Other Dill direct REST API Interface: \code{\link{drill_active}},
Other Drill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_cancel}},
  \code{\link{drill_connection}},
  \code{\link{drill_functions}},


@@ 36,4 36,4 @@ Other Dill direct REST API Interface: \code{\link{drill_active}},
  \code{\link{drill_system_reset}},
  \code{\link{drill_threads}}, \code{\link{drill_use}}
}
\concept{Dill direct REST API Interface}
\concept{Drill direct REST API Interface}

A man/print.drill_conn.Rd => man/print.drill_conn.Rd +16 -0
@@ 0,0 1,16 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sergeant.r
\name{print.drill_conn}
\alias{print.drill_conn}
\title{Print function for \code{drill_conn} objects}
\usage{
\method{print}{drill_conn}(x, ...)
}
\arguments{
\item{x}{a \code{drill_conn} object made with \code{\link[=drill_connection]{drill_connection()}}}

\item{...}{unused}
}
\description{
Print function for \code{drill_conn} objects
}