dd.host.api
Class HostInfo

java.lang.Object
  |
  +--dd.host.api.HostInfo
All Implemented Interfaces:
Cloneable, Comparable, QuickSerializable

public class HostInfo
extends Object
implements QuickSerializable, Comparable, Cloneable

HostInfo is tuple object/record that contains all the local information stored about a particular host in the system.

Version:
$Id: HostInfo.java,v 1.3 2004/05/01 05:44:08 hweather Exp $
Author:
Hakim Weatherspoon

Field Summary
 long classification
          classification is a numeric label, indicating the group/cluster that this node is a member of.
 long clockSkew
          clockSkew (in us) is the difference between the local clock and clock at the src node.
 bamboo.vivaldi.VirtualCoordinate coordinate
          VirtualCoordinate of host.
 long deadline
          deadline time (in us) that we should receive a heartbeat from src node.
 long domainId
          domainId is the last eight bytes of the hash of the domain_guess.
 short event
          event is the event that transitioned our local knowledge of a node into into the current state.
static short EVENT_HB_RECV
          HB_RECV - Node successful sent a HostHbStage.
static short EVENT_HB_TIMEOUT
          HB_TIMEOUT - Node not successfully sent a HB_RECV that we have received.
static short EVENT_JOIN
          JOIN - Node was added to local RoutingTable.
static short EVENT_MULTICAST_DEAD
          MULTICAST_DEAD - Node is dead (i.e. not responding).
static short EVENT_PING_DEAD
          PING_DEAD - Node declared dead (i.e.
static short EVENT_PING_JOIN
          PING_JOIN - Node was added to local RoutingTable and we need to ping node to tell whether how many hops the remote node is from the local node.
static short EVENT_PING_REMOVE
          PING_REMOVE - Node was removed from local RoutingTable and we need to ping node to tell whether, node was removed because it is dead or just RoutingTable re-adjustment.
static short EVENT_PUBLISH
          PUBLISH - Node was added to local PtrMgr because a publish resulted in a AddPtrReq.
static short EVENT_Q_TIMEOUT
          Q_TIMEOUT - Node has finished incubating in the reviving state.
static short EVENT_REMOVE
          REMOVE - Node was removed from local RoutingTable.
static String[] EVENT_STRING
          Strings corresponding to host states.
static short EVENT_UNPUBLISH
          UNPUBLISH - Node was modified in local PtrMgr because an unpublish resulted in a RemovePtrReq.
 HostAppFilter filter
          HostAppFilter is a summary of the applications that host is exporting to the rest of the system.
 long firstSeen
          firstSeen is the recorded local time (in us) of of time when the host was first heard of.
 SecureHash guid
          guid of the src/host node.
 short hops
          hops is the number of overlay hops between the src node and local node.
 short latitude
          latitude is the angle of a host above (or below) the equator.
 byte locationGranularity
          location_granularity is granularity of the latitude/longitude coordinates.
 short longitude
          longitude is the angle of a host west or east of the prime meridian passing through the old Royal Astronomical Observatory in Greenwich, England.
 NodeId nodeId
          NodeId of the src/host node.
 long srcTime
          srcTime (in us) is the time at the src.
 short state
          state is the local nodes knowledge of the state of the src node.
static short STATE_DEAD
          DEAD - Node has not been responding for a while.
static short STATE_HIBERNATING
          HIBERNATING - Node has stop responding.
static short STATE_NOEXIST
          NOEXIST - Node does not exist to us; that is, we have not heard of node before.
static short STATE_NORMAL
          NORMAL - Node is functioning normal.
static short STATE_REVIVING
          REVIVING - We have just heard from node, but do not know if node if functioning normally.
static String[] STATE_STRING
          Strings corresponding to host states.
 long sumSession
          sumSession is the sum of time that the node was availabile (in us).
 
Constructor Summary
HostInfo(InputBuffer buffer)
          Constructs a HostInfo from its serialized form.
HostInfo(SecureHash guid, NodeId nodeId, long srcTime, short hops, short state, short event, long deadline, long clockSkew, long sumSession, long firstSeen, long classification, long domainId, short latitude, short longitude, byte locationGranularity, bamboo.vivaldi.VirtualCoordinate coordinate, HostAppFilter filter)
          Constructor: Creates a new HostInfo.
 
Method Summary
 Object clone()
          Specified by java.lang.Object
 int compareTo(Object other)
          Specified by java.lang.Comparable
 boolean equals(Object other)
          Specified by java.lang.Object
 int hashCode()
          Specified by java.lang.Object
 void serialize(OutputBuffer buffer)
          Specified by ostore.util.QuickSerializable
 String toString()
          Specified by java.lang.Object
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_NOEXIST

public static final short STATE_NOEXIST
NOEXIST - Node does not exist to us; that is, we have not heard of node before.

See Also:
Constant Field Values

STATE_NORMAL

public static final short STATE_NORMAL
NORMAL - Node is functioning normal. We send DDLocateMsg routing traffic to node.

See Also:
Constant Field Values

STATE_REVIVING

public static final short STATE_REVIVING
REVIVING - We have just heard from node, but do not know if node if functioning normally. With caution, we send DDLocateMsg routing traffic to node; that is, we are monitoring node very closely.

See Also:
Constant Field Values

STATE_HIBERNATING

public static final short STATE_HIBERNATING
HIBERNATING - Node has stop responding. Monitor node very closely, but do NOT send DDLocateMsg routing traffic to node.

See Also:
Constant Field Values

STATE_DEAD

public static final short STATE_DEAD
DEAD - Node has not been responding for a while. Node is dead to us. Do NOT foward traffic or monitor node. Okay to remove pointer state associated with node.

See Also:
Constant Field Values

STATE_STRING

public static final String[] STATE_STRING
Strings corresponding to host states. Used for debugging.


EVENT_JOIN

public static final short EVENT_JOIN
JOIN - Node was added to local RoutingTable.

See Also:
Constant Field Values

EVENT_PUBLISH

public static final short EVENT_PUBLISH
PUBLISH - Node was added to local PtrMgr because a publish resulted in a AddPtrReq.

See Also:
Constant Field Values

EVENT_UNPUBLISH

public static final short EVENT_UNPUBLISH
UNPUBLISH - Node was modified in local PtrMgr because an unpublish resulted in a RemovePtrReq.

See Also:
Constant Field Values

EVENT_PING_JOIN

public static final short EVENT_PING_JOIN
PING_JOIN - Node was added to local RoutingTable and we need to ping node to tell whether how many hops the remote node is from the local node.

See Also:
Constant Field Values

EVENT_PING_REMOVE

public static final short EVENT_PING_REMOVE
PING_REMOVE - Node was removed from local RoutingTable and we need to ping node to tell whether, node was removed because it is dead or just RoutingTable re-adjustment.

See Also:
Constant Field Values

EVENT_PING_DEAD

public static final short EVENT_PING_DEAD
PING_DEAD - Node declared dead (i.e. HB_TIMEOUT), ping to confirm node not responding (i.e. node is dead).

See Also:
Constant Field Values

EVENT_REMOVE

public static final short EVENT_REMOVE
REMOVE - Node was removed from local RoutingTable.

See Also:
Constant Field Values

EVENT_HB_RECV

public static final short EVENT_HB_RECV
HB_RECV - Node successful sent a HostHbStage.

See Also:
Constant Field Values

EVENT_Q_TIMEOUT

public static final short EVENT_Q_TIMEOUT
Q_TIMEOUT - Node has finished incubating in the reviving state. That is, we have been receiving HB_RECV normally.

See Also:
Constant Field Values

EVENT_HB_TIMEOUT

public static final short EVENT_HB_TIMEOUT
HB_TIMEOUT - Node not successfully sent a HB_RECV that we have received.

See Also:
Constant Field Values

EVENT_MULTICAST_DEAD

public static final short EVENT_MULTICAST_DEAD
MULTICAST_DEAD - Node is dead (i.e. not responding). Another node is telling us this. If the node is actually alive it will immediately send a HB_RECV to correct the mistake.

See Also:
Constant Field Values

EVENT_STRING

public static final String[] EVENT_STRING
Strings corresponding to host states. Used for debugging.


guid

public SecureHash guid
guid of the src/host node.


nodeId

public NodeId nodeId
NodeId of the src/host node.


srcTime

public long srcTime
srcTime (in us) is the time at the src.


hops

public short hops
hops is the number of overlay hops between the src node and local node.


state

public short state
state is the local nodes knowledge of the state of the src node.


event

public short event
event is the event that transitioned our local knowledge of a node into into the current state.


deadline

public long deadline
deadline time (in us) that we should receive a heartbeat from src node.


clockSkew

public long clockSkew
clockSkew (in us) is the difference between the local clock and clock at the src node. If clocks are synchronized clockSkew is the latency between local and src node.


sumSession

public long sumSession
sumSession is the sum of time that the node was availabile (in us).

This quantity is used to produce a rate of availability. For example, sumSession/(current - firstSeen) = availability. Alternative values can be used in the denominator of the availability calculation. For example, the first time the node has been seen, or a window of time, etc.


firstSeen

public long firstSeen
firstSeen is the recorded local time (in us) of of time when the host was first heard of.

This quantity is used to produce a rate of availability. For example, sumSession/(current - firstSeen) = availability. Alternative values can be used in the denominator of the availability calculation. For example, the first time the node has been seen, or a window of time, etc.


classification

public long classification
classification is a numeric label, indicating the group/cluster that this node is a member of. classification is an int because each node could potentially be un-related to all other nodes. That is, there is a max of 2^64-1 = 18,446,744,073,709,551,615 (i.e. 18 quintillion!) labels/classifications. The default classification is Long.MIN_VALUE. Note: if there is not classifier running locally than the HostHbStage labels each individual node with its own unique classification based on NodeId.


domainId

public long domainId
domainId is the last eight bytes of the hash of the domain_guess. In simulation, domainId is the hashCode of the transit stub domain.


latitude

public short latitude
latitude is the angle of a host above (or below) the equator. The latitude is stored as a short by multiplying the latitude in decimal form by 100. For example, Berkeley, CA, USA is at latitude 37.87; we therefore, multiply 37.87*100=3787 and store 3787 as a short since latitude is bound by [-90.00,90.00] (south pole and north pole, respectively). We do the same with longitude.

Note: We only store latitude and longitude because they uniquely identify any location on earth. We also store the granularity of the latitude and longitude as city=>0, state/province=>1, or country=>2. Also note. If the latitude, longitude, and/or granularity is unknown we store a Short.MIN_VALUE (or Byte.MIN_VALUE for granularity).


longitude

public short longitude
longitude is the angle of a host west or east of the prime meridian passing through the old Royal Astronomical Observatory in Greenwich, England. The longitude is stored as a short by multiplying the longitude in decimal form by 100. For example, Berkeley, CA, USA is at longitude -122.29; we therefore, multiply -122.29*100=-12229 and store -12229 as a short since longitude is bound by [-180.00,180.00] (just east and west of the international date line respectively). We do the same with longitude.

Note: We only store latitude and longitude because they uniquely identify any location on earth. We also store the granularity of the latitude and longitude as city=>0, state/province=>1, or country=>2. Also note. If the latitude, longitude, and/or granularity is unknown we store Short.MIN_VALUE (or Byte.MIN_VALUE for granularity).


locationGranularity

public byte locationGranularity
location_granularity is granularity of the latitude/longitude coordinates. We store the granularity of the latitude and longitude as city => 0, state/province => 1, or country => 2. NOTE: If the latitude, longitude, and/or granularity is unknown we store a Short.MIN_VALUE (or Byte.MIN_VALUE for granularity).


coordinate

public bamboo.vivaldi.VirtualCoordinate coordinate
VirtualCoordinate of host.


filter

public HostAppFilter filter
HostAppFilter is a summary of the applications that host is exporting to the rest of the system.

Constructor Detail

HostInfo

public HostInfo(SecureHash guid,
                NodeId nodeId,
                long srcTime,
                short hops,
                short state,
                short event,
                long deadline,
                long clockSkew,
                long sumSession,
                long firstSeen,
                long classification,
                long domainId,
                short latitude,
                short longitude,
                byte locationGranularity,
                bamboo.vivaldi.VirtualCoordinate coordinate,
                HostAppFilter filter)
Constructor: Creates a new HostInfo.


HostInfo

public HostInfo(InputBuffer buffer)
         throws QSException
Constructs a HostInfo from its serialized form.

Parameters:
buffer - serialized form of object.
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable

Specified by:
serialize in interface QuickSerializable

hashCode

public int hashCode()
Specified by java.lang.Object

Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Specified by java.lang.Object

Overrides:
equals in class Object

compareTo

public int compareTo(Object other)
Specified by java.lang.Comparable

Specified by:
compareTo in interface Comparable

clone

public Object clone()
             throws CloneNotSupportedException
Specified by java.lang.Object

Overrides:
clone in class Object
CloneNotSupportedException

toString

public String toString()
Specified by java.lang.Object

Overrides:
toString in class Object