water
Class H2ONode

java.lang.Object
  extended by water.Iced
      extended by water.H2ONode
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Freezable

public class H2ONode
extends Iced
implements java.lang.Comparable

A Node in an H2O Cloud. Basically a worker-bee with CPUs, Memory and Disk. One of this is the self-Node, but the rest are remote Nodes.


Nested Class Summary
static class H2ONode.AckAckTimeOutThread
           
static class H2ONode.H2Okey
           
 
Field Summary
 boolean _announcedLostContact
           
 HeartBeat _heartbeat
           
 H2ONode.H2Okey _key
           
 long _last_heard_from
           
 int _tcp_readers
           
 int _unique_idx
           
static H2ONode[] IDX
           
static java.util.concurrent.atomic.AtomicInteger TCPS
           
 
Constructor Summary
H2ONode()
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 void freeTCPSocket(java.nio.channels.SocketChannel sock)
           
 java.nio.channels.SocketChannel getTCPSocket()
           
 int hashCode()
           
 int index()
           
static H2ONode intern(H2ONode.H2Okey key)
           
static H2ONode intern(java.net.InetAddress ip, int port)
           
static H2ONode intern(int ip, int port)
           
 int ip4()
           
 int nextTaskNum()
           
 H2ONode read(AutoBuffer ab)
          Deserialize from the AutoBuffer into a pre-existing 'this' object.
 RPC taskGet(int tnum)
           
 void taskPut(int tnum, RPC rpc)
           
 void taskRemove(int tnum)
           
 java.util.Collection<RPC> tasks()
           
 int taskSize()
           
 java.lang.String toString()
           
 AutoBuffer write(AutoBuffer ab)
          Serialize the 'this' object into the AutoBuffer, returning the AutoBuffer.
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, toDocField, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_unique_idx

public int _unique_idx

_last_heard_from

public long _last_heard_from

_announcedLostContact

public boolean _announcedLostContact

_heartbeat

public volatile HeartBeat _heartbeat

_tcp_readers

public int _tcp_readers

_key

public H2ONode.H2Okey _key

IDX

public static H2ONode[] IDX

TCPS

public static final java.util.concurrent.atomic.AtomicInteger TCPS
Constructor Detail

H2ONode

public H2ONode()
Method Detail

ip4

public final int ip4()

intern

public static final H2ONode intern(H2ONode.H2Okey key)

intern

public static final H2ONode intern(java.net.InetAddress ip,
                                   int port)

intern

public static final H2ONode intern(int ip,
                                   int port)

write

public AutoBuffer write(AutoBuffer ab)
Description copied from interface: Freezable
Serialize the 'this' object into the AutoBuffer, returning the AutoBuffer.

Specified by:
write in interface Freezable
Overrides:
write in class Iced

read

public H2ONode read(AutoBuffer ab)
Description copied from interface: Freezable
Deserialize from the AutoBuffer into a pre-existing 'this' object.

Specified by:
read in interface Freezable
Overrides:
read in class Iced

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

index

public int index()

getTCPSocket

public java.nio.channels.SocketChannel getTCPSocket()
                                             throws java.io.IOException
Throws:
java.io.IOException

freeTCPSocket

public void freeTCPSocket(java.nio.channels.SocketChannel sock)

taskPut

public void taskPut(int tnum,
                    RPC rpc)

taskGet

public RPC taskGet(int tnum)

taskRemove

public void taskRemove(int tnum)

tasks

public java.util.Collection<RPC> tasks()

taskSize

public int taskSize()

nextTaskNum

public int nextTaskNum()