Skip to content

Commit

Permalink
add many_cols and chunk_bytes to h2o.init
Browse files Browse the repository at this point in the history
  • Loading branch information
spennihana committed Jan 13, 2015
1 parent 72e3c29 commit 5edb09f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions R/h2o-package/R/Wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 3) If user does want to start H2O, but running non-locally, print an error
h2o.init <- function(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 = NULL, strict_version_check = TRUE, data_max_factor_levels = 65000) {
ice_root = NULL, strict_version_check = TRUE, data_max_factor_levels = 65000, many_cols = FALSE, chunk_bytes = 22) {
if(!is.character(ip)) stop("ip must be of class character")
if(!is.numeric(port)) stop("port must be of class numeric")
if(!is.logical(startH2O)) stop("startH2O must be of class logical")
Expand All @@ -22,6 +22,8 @@ h2o.init <- function(ip = "127.0.0.1", port = 54321, startH2O = TRUE, forceDL =
if(!is.null(ice_root) && !is.character(ice_root)) stop("ice_root must be of class character")
if(!is.logical(strict_version_check)) stop("strict_version_check must be of class logical")
if(!is.numeric(data_max_factor_levels)) stop("`data_max_factor_levels` must be numeric.")
if(!is.logical(many_cols)) stop("`many_cols` must be logical")
if(!is.numeric(chunk_bytes)) stop("`chunk_bytes` must be numeric")

if ((R.Version()$major == "3") && (R.Version()$minor == "1.0")) {
warning("H2O is specifically not compatible with this exact")
Expand Down Expand Up @@ -63,7 +65,8 @@ h2o.init <- function(ip = "127.0.0.1", port = 54321, startH2O = TRUE, forceDL =
min_memory = min_mem_size, beta = beta,
assertion = assertion, forceDL = forceDL,
license = license, ice_root = ice_root,
max_factor_levels = data_max_factor_levels)
max_factor_levels = data_max_factor_levels,
many_cols = many_cols, chunk_bytes = chunk_bytes)

count = 0;
while(!url.exists(myURL) && (count < 60)) {
Expand Down Expand Up @@ -259,7 +262,8 @@ h2o.clusterStatus <- function(client) {
.h2o.startJar <- function(nthreads = -1, max_memory = NULL,
min_memory = NULL, beta = FALSE,
assertion = TRUE, forceDL = FALSE,
license = NULL, ice_root, max_factor_levels = 65000) {
license = NULL, ice_root, max_factor_levels = 65000,
many_cols = FALSE, chunk_bytes = 22) {
command <- .h2o.checkJava()

if (! is.null(license)) {
Expand Down Expand Up @@ -322,6 +326,8 @@ http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.h
if(beta) args <- c(args, "-beta")
if(!is.null(license)) args <- c(args, "-license", license)
args <- c(args, "-data_max_factor_levels", max_factor_levels)
if(many_cols) args <- c(args, "-many_cols")
args <- c(args, "-chunk_bytes", chunk_bytes)

cat("\n")
cat( "Note: In case of errors look at the following log files:\n")
Expand Down
5 changes: 4 additions & 1 deletion R/h2o-package/man/h2o.init.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Connects to a running H2O instance and checks the local H2O R package is the cor
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, min_mem_size,
ice_root = NULL, strict_version_check = TRUE, data_max_factor_levels = 65000)}
ice_root = NULL, strict_version_check = TRUE, data_max_factor_levels = 65000,
many_cols = FALSE, chunk_bytes = 22)}

\arguments{
\item{ip}{Object of class \code{"character"} representing the IP address of the server where H2O is running.}
Expand All @@ -24,6 +25,8 @@ h2o.init(ip = "127.0.0.1", port = 54321, startH2O = TRUE, forceDL = FALSE, Xmx,
\item{ice_root}{(Optional) A directory specifying where H2O should write log files and spill to disk (if needed). Default is tempdir(). This value is only used when R starts H2O.}
\item{strict_version_check}{(Optional) Setting this to FALSE is unsupported and should only be done when advised by technical support.}
\item{data_max_factor_levels}{(Optional) The limit for the number of factor levels that may appear in a single column. Default is 65,000.}
\item{many_cols}{(Optional) Enables improved handling of high-dimensional datasets. Same as -chunk_bytes 24.}
\item{chunk_bytes}{(Optional) Not in combination with -many_cols. The log (base 2) of chunk size in bytes. (The default is 22, which leads to a chunk size of 4.0 MB.).}
}
\details{
This method first checks if H2O is connectible. If it cannot connect and \code{startH2O = TRUE} with IP of localhost, it will attempt to start an instance of H2O with IP = localhost, port = 54321. Otherwise, it stops immediately with an error.
Expand Down

0 comments on commit 5edb09f

Please sign in to comment.