|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NCClientIF<T>
Method Summary | |
---|---|
boolean |
addHost(T addr)
Notifies this VivaldiClient object that a host that supports
Vivaldi has joined the system. |
boolean |
addHost(T addr,
Coordinate _r_coord,
double r_error,
long curr_time,
boolean can_update)
Notifies this VivaldiClient object that a host that supports
Vivaldi and has the provided coordinates and error has joined the system. |
boolean |
containsHost(T addr)
Returns whether the given host has been registered with this VivaldiClient object. |
long |
getAge(long curr_time)
Returns the age of our coordinate Note that this does not require clock-synchronization because it is relative to our coordinate |
java.util.Set<T> |
getHosts()
Returns all hosts that support Vivaldi and have been registered with this VivaldiClient object. |
T |
getNeighborToPing(long curr_time)
|
int |
getNumDimensions()
Returns the dimension of the Euclidian space coordinates are embedded in. |
ObserverList |
getObserverList()
Returns the list of observers, to which observers for the application-level coordinate can be added, removed, and so forth. |
java.util.Hashtable<java.lang.String,java.lang.Double> |
getStatistics()
|
Coordinate |
getSystemCoords()
Returns the system-level Vivaldi coordinates. |
double |
getSystemError()
Returns the system-level error, which denotes the accuracy of the system-level coordinates. |
boolean |
hasAllNeighbors()
|
java.lang.String |
printNeighbors()
|
boolean |
processSample(T addr,
Coordinate _r_coord,
double r_error,
double sample_rtt,
long sample_age,
long curr_time,
boolean can_add)
This method is invoked when a new RTT sample is made to a host that supports Vivaldi. |
boolean |
removeHost(T addr)
Notifies this VivaldiClient object that a host that supports
Vivaldi has left the system. |
void |
reset()
|
void |
setLocalID(T _local_addr)
|
void |
shutDown(java.io.DataOutputStream os)
|
boolean |
stabilized()
|
void |
startUp(java.io.DataInputStream is)
|
java.lang.String |
toString()
|
Method Detail |
---|
void setLocalID(T _local_addr)
java.lang.String toString()
toString
in class java.lang.Object
java.util.Hashtable<java.lang.String,java.lang.Double> getStatistics()
void reset()
int getNumDimensions()
Coordinate getSystemCoords()
double getSystemError()
long getAge(long curr_time)
ObserverList getObserverList()
boolean addHost(T addr)
VivaldiClient
object that a host that supports
Vivaldi has joined the system. State associated with the new host is
created. This method succeeds and returns true
only if the
host is not already registered with this VivaldiClient
object.
addr
- the address of the joining host
true
if addr
is registered and its
associated state created, false
otherwiseboolean addHost(T addr, Coordinate _r_coord, double r_error, long curr_time, boolean can_update)
VivaldiClient
object that a host that supports
Vivaldi and has the provided coordinates and error has joined the system.
State associated with the new host is created. This method succeeds and
returns true
only if the host is not already registered with
this VivaldiClient
object.
addr
- the address of the joining host_r_coord
- the app-level coordinates of the remote hostr_error
- the system-level error of the remote hostsample_rtt
- the RTT sample to the remote hostcurr_time
- the current time, in millisecondscan_update
- true
if this method can update a host already
present
true
if addr
is registered and its
associated state created, false
otherwiseboolean removeHost(T addr)
VivaldiClient
object that a host that supports
Vivaldi has left the system. However, the state (i.e. short list of RTT
values) is kept because it will be useful if and when the node returns into
the system
addr
- the address of the departing host
true
if addr
was a known nodeboolean containsHost(T addr)
VivaldiClient
object.
addr
- the address to query as registered
true
if registered, false
otherwisejava.util.Set<T> getHosts()
VivaldiClient
object. The returned set is backed by the true
set of registered hosts, but cannot be modified.
boolean processSample(T addr, Coordinate _r_coord, double r_error, double sample_rtt, long sample_age, long curr_time, boolean can_add)
true
only
if the host is already registered with this VivaldiClient
object, and the RTT sample is valid.
addr
- the address of the host_r_coord
- the system-level coordinates of the remote hostr_error
- the system-level error of the remote hostsample_rtt
- the RTT sample to the remote hostcurr_time
- the current time, in millisecondscan_add
- true
if this method can add a host not already
present
true
if addr
is registered and the
sample is processed, false
otherwiseboolean hasAllNeighbors()
boolean stabilized()
java.lang.String printNeighbors()
T getNeighborToPing(long curr_time)
void startUp(java.io.DataInputStream is) throws java.io.IOException
java.io.IOException
void shutDown(java.io.DataOutputStream os) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |