h2o (version 3.2.0.3)

h2o.init: Initialize and Connect to H2O

Description

Attempts to start and/or connect to and H2O instance.

Usage

h2o.init(ip = "127.0.0.1", port = 54321, startH2O = TRUE,
  forceDL = FALSE, Xmx, beta = FALSE, assertion = TRUE, license = NULL,
  nthreads = -2, max_mem_size = NULL, min_mem_size = NULL,
  ice_root = tempdir(), strict_version_check = TRUE, https = FALSE,
  insecure = FALSE, username = NA_character_, password = NA_character_)

Arguments

ip
Object of class character representing the hostname or IP address of the server where H2O is running.
port
Object of class numeric representing the port number of the H2O server.
startH2O
(Optional) A logical value indicating whether to try to start H2O from R if no connection with H2O is detected. This is only possible if ip = "localhost" or ip = "127.0.0.1". If an existing connection is detected, R
forceDL
(Optional) A logical value indicating whether to force download of the H2O executable. Defaults to FALSE, so the executable will only be downloaded if it does not already exist in the h2o R library resources directory h2o/java/h2o.jar
Xmx
(Optional) (DEPRECATED) A character string specifying the maximum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate
beta
(Optional) A logical value indicating whether H2O should launch in beta mode. This value is only used when R starts H2O.
assertion
(Optional) A logical value indicating whether H2O should be launched with assertions enabled. Used mainly for error checking and debugging purposes. This value is only used when R starts H2O.
license
(Optional) A character string value specifying the full path of the license file. This value is only used when R starts H2O.
nthreads
(Optional) Number of threads in the thread pool. This relates very closely to the number of CPUs used. -2 means use the CRAN default of 2 CPUs. -1 means use all CPUs on the host. A positive integer specifies the number of CPUs directly. This value is
max_mem_size
(Optional) A character string specifying the maximum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate gigabytes.
min_mem_size
(Optional) A character string specifying the minimum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate gigabytes.
ice_root
(Optional) A directory to handle object spillage. The defaul varies by OS.
strict_version_check
(Optional) Setting this to FALSE is unsupported and should only be done when advised by technical support.
https
(Optional) Set this to TRUE to use https instead of http.
insecure
(Optional) Set this to TRUE to disable SSL certificate checking.
username
(Optional) Username to login with.
password
(Optional) Password to login with.

Value

  • this method will load it and return a H2OConnection object containing the IP address and port number of the H2O server.

Details

By defualt, this method first checks if an H2O instance is connectible. If it cannot connect and start = TRUE with ip = "localhost", it will attempt to start and instance of H2O at localhost:54321. Otherwise it stops with an error.

When initializing H2O locally, this method searches for h2o.jar in the R library resources (system.file("java", "h2o.jar", package = "h2o")), and if the file does not exist, it will automatically attempt to download the correct version from Amazon S3. The user must have Internet access for this process to be successful.

Once connected, the method checks to see if the local H2O R package version matches the version of H2O running on the server. If there is a mismatch and the user indicates she wishes to upgrade, it will remove the local H2O R package and download/install the H2O R package from the server.

See Also

http://h2o-release.s3.amazonaws.com/h2o-dev/rel-shannon/2/docs-website/h2o-r/h2o_package.pdf{H2O R package documentation} for more details. h2o.shutdown for shutting down from R.

Examples

Run this code
# Try to connect to a local H2O instance that is already running.
# If not found, start a local H2O instance from R with the default settings.
localH2O = h2o.init()

# Try to connect to a local H2O instance.
# If not found, raise an error.
localH2O = h2o.init(startH2O = FALSE)

# Try to connect to a local H2O instance that is already running.
# If not found, start a local H2O instance from R with 5 gigabytes of memory.
localH2O = h2o.init(max_mem_size = "5g")

Run the code above in your browser using DataLab