water
Class H2O

java.lang.Object
  extended by water.H2O

public final class H2O
extends java.lang.Object

Start point for creating or joining an H2O Cloud.


Nested Class Summary
static class H2O.ApiIpPortWatchdogThread
           
static class H2O.Cleaner
           
static class H2O.FlatFileEntry
           
static class H2O.H2OCallback<T extends H2O.H2OCountedCompleter>
           
static class H2O.H2OCountedCompleter
           
static class H2O.H2OEmptyCompleter
           
static class H2O.OptArgs
           
 
Field Summary
static java.net.ServerSocket _apiSocket
           
 int _hash
           
 char _idx
           
 H2ONode[] _memary
           
static java.nio.channels.DatagramChannel _udpSocket
           
static byte ACK_ACK_PRIORITY
           
static byte ACK_PRIORITY
           
static int API_PORT
           
static H2O.ApiIpPortWatchdogThread apiIpPortWatchdog
           
static java.lang.String[] ARGS
           
static byte ARY_KEY_PRIORITY
           
static byte ATOMIC_PRIORITY
           
static H2O CLOUD
           
static boolean DEBUG
           
static java.lang.String DEFAULT_CREDENTIALS_LOCATION
           
static int DEFAULT_PORT
           
static byte DESERIAL_PRIORITY
           
static AbstractEmbeddedH2OConfig embeddedH2OConfig
           
static java.io.PrintStream ERR
           
static byte GET_KEY_PRIORITY
           
static byte GUI_PRIORITY
           
static java.net.URI ICE_ROOT
           
static byte INVALIDATE_PRIORITY
           
static boolean IS_SYSTEM_RUNNING
           
static byte MAX_PRIORITY
           
static byte MIN_HI_PRIORITY
           
static byte MIN_PRIORITY
           
static java.lang.String NAME
           
static int NUMCPUS
           
static H2O.OptArgs OPT_ARGS
           
static java.io.PrintStream OUT
           
static byte PUT_KEY_PRIORITY
           
static H2ONode SELF
           
static java.net.InetAddress SELF_ADDRESS
           
static int UDP_PORT
           
static java.lang.String VERSION
           
static int VOLATILE
           
 
Constructor Summary
H2O(H2ONode[] h2os, int hash, int idx)
           
 
Method Summary
 boolean contains(H2ONode h2o)
           
 int D(Key key, int repl)
           
static java.lang.String DEFAULT_ICE_ROOT()
           
static void exit(int status)
          Notify embedding software instance H2O wants to exit.
static java.lang.RuntimeException fail()
           
static java.net.InetAddress findInetAddressForSelf()
           
static Value get(Key key)
           
static com.amazonaws.auth.PropertiesCredentials getAWSCredentials()
           
static AbstractEmbeddedH2OConfig getEmbeddedH2OConfig()
           
static int getHiQueue(int i)
           
static Key getk(Key key)
           
static int getLoQueue()
           
static java.lang.String getVersion()
           
static int hiQPoolSize(int i)
           
static void ignore(java.lang.Throwable e)
           
static void ignore(java.lang.Throwable e, java.lang.String msg)
           
static void ignore(java.lang.Throwable e, java.lang.String msg, boolean printException)
           
static java.util.Set<Key> keySet()
           
static boolean larger(int nnn, int old)
           
 H2ONode leader()
           
static int loQPoolSize()
           
static void main(java.lang.String[] args)
           
 int nidx(H2ONode h2o)
           
static void notifyAboutCloudSize(java.net.InetAddress ip, int port, int size)
          Tell the embedding software that this H2O instance belongs to a cloud of a certain size.
static java.util.List<H2O.FlatFileEntry> parseFlatFile(java.io.File f)
           
static java.util.List<H2O.FlatFileEntry> parseFlatFile(java.io.InputStream is)
           
static java.util.HashSet<H2ONode> parseFlatFileFromString(java.lang.String s)
           
static void printAndLogVersion()
          If logging has not been setup yet, then Log.info will only print to stdout.
static void printHelp()
           
static Value putIfAbsent_raw(Key key, Value val)
           
static Value putIfMatch(Key key, Value val, Value old)
           
static Value raw_get(Key key)
           
static
<T extends java.lang.Throwable>
T
setDetailMessage(T t, java.lang.String s)
           
static void setEmbeddedH2OConfig(AbstractEmbeddedH2OConfig c)
          Register embedded H2O configuration object with H2O instance.
 int size()
           
static int store_size()
           
static void submitTask(H2O.H2OCountedCompleter task)
           
 java.lang.String toString()
           
static java.lang.RuntimeException unimpl()
           
static java.util.Collection<Value> values()
           
static void waitForCloudSize(int x)
           
static void waitForCloudSize(int x, long ms)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

embeddedH2OConfig

public static volatile AbstractEmbeddedH2OConfig embeddedH2OConfig

apiIpPortWatchdog

public static volatile H2O.ApiIpPortWatchdogThread apiIpPortWatchdog

VERSION

public static java.lang.String VERSION

NAME

public static java.lang.String NAME

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

UDP_PORT

public static int UDP_PORT

API_PORT

public static int API_PORT

SELF

public static H2ONode SELF

SELF_ADDRESS

public static java.net.InetAddress SELF_ADDRESS

ICE_ROOT

public static java.net.URI ICE_ROOT

ARGS

public static java.lang.String[] ARGS

OUT

public static final java.io.PrintStream OUT

ERR

public static final java.io.PrintStream ERR

NUMCPUS

public static final int NUMCPUS

CLOUD

public static volatile H2O CLOUD

_memary

public final H2ONode[] _memary

_hash

public final int _hash

_idx

public final char _idx

DEBUG

public static final boolean DEBUG

VOLATILE

public static volatile int VOLATILE

MAX_PRIORITY

public static final byte MAX_PRIORITY
See Also:
Constant Field Values

ACK_ACK_PRIORITY

public static final byte ACK_ACK_PRIORITY
See Also:
Constant Field Values

ACK_PRIORITY

public static final byte ACK_PRIORITY
See Also:
Constant Field Values

DESERIAL_PRIORITY

public static final byte DESERIAL_PRIORITY
See Also:
Constant Field Values

INVALIDATE_PRIORITY

public static final byte INVALIDATE_PRIORITY
See Also:
Constant Field Values

ARY_KEY_PRIORITY

public static final byte ARY_KEY_PRIORITY
See Also:
Constant Field Values

GET_KEY_PRIORITY

public static final byte GET_KEY_PRIORITY
See Also:
Constant Field Values

PUT_KEY_PRIORITY

public static final byte PUT_KEY_PRIORITY
See Also:
Constant Field Values

ATOMIC_PRIORITY

public static final byte ATOMIC_PRIORITY
See Also:
Constant Field Values

GUI_PRIORITY

public static final byte GUI_PRIORITY
See Also:
Constant Field Values

MIN_HI_PRIORITY

public static final byte MIN_HI_PRIORITY
See Also:
Constant Field Values

MIN_PRIORITY

public static final byte MIN_PRIORITY
See Also:
Constant Field Values

OPT_ARGS

public static H2O.OptArgs OPT_ARGS

IS_SYSTEM_RUNNING

public static boolean IS_SYSTEM_RUNNING

DEFAULT_CREDENTIALS_LOCATION

public static final java.lang.String DEFAULT_CREDENTIALS_LOCATION
See Also:
Constant Field Values

_udpSocket

public static java.nio.channels.DatagramChannel _udpSocket

_apiSocket

public static java.net.ServerSocket _apiSocket
Constructor Detail

H2O

public H2O(H2ONode[] h2os,
           int hash,
           int idx)
Method Detail

DEFAULT_ICE_ROOT

public static java.lang.String DEFAULT_ICE_ROOT()

unimpl

public static final java.lang.RuntimeException unimpl()

fail

public static final java.lang.RuntimeException fail()

ignore

public static final void ignore(java.lang.Throwable e)

ignore

public static final void ignore(java.lang.Throwable e,
                                java.lang.String msg)

ignore

public static final void ignore(java.lang.Throwable e,
                                java.lang.String msg,
                                boolean printException)

setEmbeddedH2OConfig

public static void setEmbeddedH2OConfig(AbstractEmbeddedH2OConfig c)
Register embedded H2O configuration object with H2O instance.


getEmbeddedH2OConfig

public static AbstractEmbeddedH2OConfig getEmbeddedH2OConfig()

notifyAboutCloudSize

public static void notifyAboutCloudSize(java.net.InetAddress ip,
                                        int port,
                                        int size)
Tell the embedding software that this H2O instance belongs to a cloud of a certain size. This may be nonblocking.

Parameters:
ip - IP address this H2O can be reached at.
port - Port this H2O can be reached at (for REST API and browser).
size - Number of H2O instances in the cloud.

exit

public static void exit(int status)
Notify embedding software instance H2O wants to exit.

Parameters:
status - H2O's requested process exit value.

larger

public static boolean larger(int nnn,
                             int old)

size

public final int size()

leader

public final H2ONode leader()

waitForCloudSize

public static void waitForCloudSize(int x)

waitForCloudSize

public static void waitForCloudSize(int x,
                                    long ms)

D

public int D(Key key,
             int repl)

nidx

public int nidx(H2ONode h2o)

contains

public boolean contains(H2ONode h2o)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

findInetAddressForSelf

public static java.net.InetAddress findInetAddressForSelf()
                                                   throws java.lang.Error
Throws:
java.lang.Error

putIfMatch

public static final Value putIfMatch(Key key,
                                     Value val,
                                     Value old)

putIfAbsent_raw

public static final Value putIfAbsent_raw(Key key,
                                          Value val)

get

public static Value get(Key key)

raw_get

public static Value raw_get(Key key)

getk

public static Key getk(Key key)

keySet

public static java.util.Set<Key> keySet()

values

public static java.util.Collection<Value> values()

store_size

public static int store_size()

getLoQueue

public static int getLoQueue()

loQPoolSize

public static int loQPoolSize()

getHiQueue

public static int getHiQueue(int i)

hiQPoolSize

public static int hiQPoolSize(int i)

submitTask

public static void submitTask(H2O.H2OCountedCompleter task)

printHelp

public static void printHelp()

printAndLogVersion

public static void printAndLogVersion()
If logging has not been setup yet, then Log.info will only print to stdout. This allows for early processing of the '-version' option without unpacking the jar file and other startup stuff.


getVersion

public static java.lang.String getVersion()

main

public static void main(java.lang.String[] args)

getAWSCredentials

public static com.amazonaws.auth.PropertiesCredentials getAWSCredentials()
                                                                  throws java.io.IOException
Throws:
java.io.IOException

setDetailMessage

public static <T extends java.lang.Throwable> T setDetailMessage(T t,
                                                                 java.lang.String s)

parseFlatFileFromString

public static java.util.HashSet<H2ONode> parseFlatFileFromString(java.lang.String s)

parseFlatFile

public static java.util.List<H2O.FlatFileEntry> parseFlatFile(java.io.File f)

parseFlatFile

public static java.util.List<H2O.FlatFileEntry> parseFlatFile(java.io.InputStream is)