H2O Architecture

H2O Software Stack

the diagram below shows most of the different components that work together to form the h2o software stack. the diagram is split into a top and bottom section, with the network cloud dividing the two sections.

宁夏微乐滑水麻将下载the top section shows some of the different rest api clients that exist for h2o.

the bottom section shows different components that run within an h2o jvm process.

宁夏微乐滑水麻将下载the color scheme in the diagram shows each layer in a consistent color but always shows user-added customer algorithm code as gray.

H2O stack

REST API Clients

宁夏微乐滑水麻将下载all rest api clients communicate with h2o over a socket connection.

JavaScript
The embedded H2O Web UI is written in JavaScript, and uses the standard REST API.
R
R scripts can use the H2O R package [‘library(h2o)’]. Users can write their own R functions that run on H2O with ‘apply’ or ‘ddply’.
Python
Python scripts currently must use the REST API directly. An H2O client API for python is planned.
Excel
An H2O worksheet for Microsoft Excel is available. It allows you to import big datasets into H2O and run algorithms like GLM directly from Excel.
Tableau
Users can pull results from H2O for visualization in Tableau.
Flow
H2O Flow is the notebook style Web UI for H2O.

JVM Components

宁夏微乐滑水麻将下载an h2o cluster consists of one or more nodes. each node is a single jvm process. each jvm process is split into three layers: language, algorithms, and core infrastructure.

宁夏微乐滑水麻将下载the language layer consists of an expression evaluation engine for r and the shalala scala layer. the r evaluation layer is a slave to the r rest client front-end. the scala layer, however, is a first-class citizen in which you can write native programs and algorithms that use h2o.

宁夏微乐滑水麻将下载the algorithms layer contains those algorithms automatically provided with h2o. these are the parse algorithm used for importing datasets, the math and machine learning algorithms like glm, and the prediction and scoring engine for model evaluation.

the bottom (core) layer handles resource management. memory and cpu are managed at this level.

Memory Management

Fluid Vector Frame
A Frame is an H2O Data Frame, the basic unit of data storage exposed to users. “Fluid Vector” is an internal engineering term that caught on. It refers to the ability to add and update and remove columns in a frame “fluidly” (as opposed to the frame being rigid and immutable). The Frame->Vector->Chunk->Element taxonomy that stores data in memory is described in Javadoc. The Fluid Vector (or fvec) code is the column-compressed store implementation.
Distributed K/V store
Atomic and distributed in-memory storage spread across the cluster.
Non-blocking Hash Map
Used in the K/V store implementation.

CPU Management

Job
Jobs are large pieces of work that have progress bars and can be monitored in the Web UI. Model creation is an example of a job.
MRTask
MRTask stands for MapReduce Task. This is an H2O in-memory MapReduce Task, not to be confused with a Hadoop MapReduce task.
Fork/Join
A modified JSR166y lightweight task execution framework.

How R (and Python) Interacts with H2O

the h2o package for r allows r users to control an h2o cluster from an r script. the r script is a rest api client of the h2o cluster. the data never flows through r.

宁夏微乐滑水麻将下载note that although these examples are for r, python and the h2o package for python behave exactly the same way.

How R Scripts Tell H2O to Ingest Data

the following sequence of three steps shows how an r program tells an h2o cluster to read data from hdfs into a distributed h2o frame.

Step 1: The R user calls the importFile function

r_hdfs_read_step1

Step 2: The R client tells the cluster to read the data

宁夏微乐滑水麻将下载the thin arrows show control information.

r_hdfs_read_step2

Step 3: The data is returned from HDFS into a distributed H2O Frame

the thin arrows show control information. the thick arrows show data being returned from hdfs. the blocks of data live in the distributed h2o frame cluster memory.

r_hdfs_read_step3

How R Scripts Call H2O GLM

宁夏微乐滑水麻将下载the following diagram shows the different software layers involved when a user runs an r program that starts a glm on h2o.

the left side shows the steps that run the the r process and the right side shows the steps that run in the h2o cluster. the top layer is the tcp/ip network code that enables the two processes to communicate with each other.

宁夏微乐滑水麻将下载the solid line shows an r->h2o request and the dashed line shows the response for that request.

宁夏微乐滑水麻将下载in the r program, the different components are:

  • the R script itself
  • the H2O R package
  • dependent packages (RCurl, rjson, etc.)
  • the R core runtime
start_glm_from_r

the following diagram shows the r program retrieving the resulting glm model. (not shown: the glm model executing subtasks within h2o and depositing the result into the k/v store or r polling the /3/jobs url for the glm model to complete.)

retrieve_glm_result_from_r

宁夏微乐滑水麻将下载an end-to-end sequence diagram of the same transaction is below. this gives a different perspective of the r and h2o interactions for the same glm request and the resulting model.

run_glm_from_r

How R Expressions are Sent to H2O for Evaluation

An H2O data frame is represented in R by an S3 object of class H2OFrame. The S3 object has an id宁夏微乐滑水麻将下载 attribute which is a reference to the big data object inside H2O.

the h2o r package overloads generic operations like ‘summary’ and ‘+’ for this new h2oframe class. the r core parser makes callbacks into the h2o r package, and these operations get sent to the h2o cluster over an http connection.

宁夏微乐滑水麻将下载the h2o cluster performs the big data operation (for example, ‘+’ on two columns of a dataset imported into h2o) and returns a reference to the result. this reference is stored in a new h2oframe s3 object inside r.

complicated expressions are turned into expression trees and evaluated by the rapids expression engine in the h2o back-end.