edu.harvard.syrah.pyxida.nc.lib
Class RemoteState<T>

java.lang.Object
  extended by edu.harvard.syrah.pyxida.nc.lib.RemoteState<T>
Type Parameters:
T - the type of the unique identifier of a host

public class RemoteState<T>
extends java.lang.Object

The state kept of a remote node between samples.


Field Summary
protected  T addr
           
protected  Coordinate last_coords
           
protected  double last_error
           
protected  long last_ping_time
           
protected  long last_update_time
           
static int MAX_SAMPLE_SIZE
           
static int MIN_SAMPLE_SIZE
           
protected  WindowStatistic ping_samples
           
protected static double SAMPLE_PERCENTILE
           
 
Constructor Summary
RemoteState(T _addr)
           
 
Method Summary
 void addSample(double sample_rtt, long sample_age, Coordinate r_coord, double r_error, long curr_time)
           
 void assign(Coordinate _last_coords, double _last_error, long _curr_time)
           
 T getAddress()
           
 Coordinate getLastCoordinate()
           
 double getLastError()
           
 long getLastPingTime()
           
 long getLastUpdateTime()
           
 double getSample()
           
 int getSampleSize()
           
 boolean isValid(long curr_time)
           
static void main(java.lang.String[] args)
           
 void setLastPingTime(long time)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SAMPLE_PERCENTILE

protected static double SAMPLE_PERCENTILE

MAX_SAMPLE_SIZE

public static int MAX_SAMPLE_SIZE

MIN_SAMPLE_SIZE

public static int MIN_SAMPLE_SIZE

addr

protected final T addr

ping_samples

protected final WindowStatistic ping_samples

last_coords

protected Coordinate last_coords

last_error

protected double last_error

last_update_time

protected long last_update_time

last_ping_time

protected long last_ping_time
Constructor Detail

RemoteState

public RemoteState(T _addr)
Method Detail

toString

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

getAddress

public T getAddress()

assign

public void assign(Coordinate _last_coords,
                   double _last_error,
                   long _curr_time)

addSample

public void addSample(double sample_rtt,
                      long sample_age,
                      Coordinate r_coord,
                      double r_error,
                      long curr_time)

isValid

public boolean isValid(long curr_time)

getSample

public double getSample()

getSampleSize

public int getSampleSize()

getLastCoordinate

public Coordinate getLastCoordinate()

getLastError

public double getLastError()

getLastUpdateTime

public long getLastUpdateTime()

getLastPingTime

public long getLastPingTime()

setLastPingTime

public void setLastPingTime(long time)

main

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