You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(123) |
Dec
(100) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(12) |
Feb
(80) |
Mar
(35) |
Apr
|
May
|
Jun
(28) |
Jul
(10) |
Aug
(6) |
Sep
|
Oct
|
Nov
(16) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
| 2009 |
Jan
(20) |
Feb
(1) |
Mar
(19) |
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
|
From: Peter P. <pr...@us...> - 2006-11-27 16:25:01
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22326/src/edu/harvard/syrah/pyxida/ping Modified Files: PingManager.java Log Message: Fixed problem with missing port numbers Index: PingManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping/PingManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PingManager.java 27 Nov 2006 04:06:37 -0000 1.6 --- PingManager.java 27 Nov 2006 16:24:59 -0000 1.7 *************** *** 31,35 **** pingerSet.add(pinger); pinger.init(defaultPingAddr, cbDone); ! } }); --- 31,35 ---- pingerSet.add(pinger); pinger.init(defaultPingAddr, cbDone); ! } }); |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:57:23
|
Update of /cvsroot/pyxida/Pyxida/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12249/config Modified Files: pyxida.cfg Log Message: name resolution problem (port) Index: pyxida.cfg =================================================================== RCS file: /cvsroot/pyxida/Pyxida/config/pyxida.cfg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyxida.cfg 27 Nov 2006 15:46:35 -0000 1.1 --- pyxida.cfg 27 Nov 2006 15:57:21 -0000 1.2 *************** *** 13,14 **** --- 13,15 ---- #sbon.local.port=16170 + #pyxida.bootstraplist="glenora.eecs.harvard.edu, sb01.eecs.harvard.edu, sb02.eecs.harvard.edu, sb10.eecs.harvard.edu, sb11.eecs.harvard.edu" |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:57:23
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12249/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Log Message: name resolution problem (port) Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NCManager.java 27 Nov 2006 15:34:40 -0000 1.6 --- NCManager.java 27 Nov 2006 15:57:22 -0000 1.7 *************** *** 46,50 **** // JTLTODO: You need to test the regex below. It should work ! private String bootstrapList[] = Config.getProperty("pyxida.bootstraplist", "glenora, sb01, sb02, sb10, sb11").split("[,\\s]"); /** --- 46,50 ---- // JTLTODO: You need to test the regex below. It should work ! private String bootstrapList[] = Config.getProperty("pyxida.bootstraplist", "glenora.eecs.harvard.edu, sb01.eecs.harvard.edu, sb02.eecs.harvard.edu, sb10.eecs.harvard.edu, sb11.eecs.harvard.edu").split("[,\\s]"); /** |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:46:37
|
Update of /cvsroot/pyxida/Pyxida/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8150/config Added Files: pyxida.cfg Log Message: added config --- NEW FILE: pyxida.cfg --- ############################## # PYXIDA # ############################## # This is the configuration file for an PYXIDA node. # It should be the same for all nodes. ############################## # General PYXIDA Configuration ############################## #format: #sbon.local.port=16170 |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:44:40
|
Update of /cvsroot/pyxida/Pyxida/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7378/config Log Message: Directory /cvsroot/pyxida/Pyxida/config added to the repository |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:34:51
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3699/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: starting to test Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Pyxida.java 27 Nov 2006 11:10:48 -0000 1.9 --- Pyxida.java 27 Nov 2006 15:34:40 -0000 1.10 *************** *** 1,4 **** ! package edu.harvard.syrah.pyxida; import edu.harvard.syrah.prp.ANSI; import edu.harvard.syrah.prp.Log; --- 1,5 ---- ! package edu.harvard.syrah.pyxida; + import java.util.Random; import edu.harvard.syrah.prp.ANSI; import edu.harvard.syrah.prp.Log; *************** *** 30,36 **** --- 31,40 ---- private ObjCommIF comm; + public static Random random; + private Pyxida() { /* empty */} private void init() { + random = new Random(System.currentTimeMillis()); // Initiliase the ObjComm communication module |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:34:44
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3699/src/edu/harvard/syrah/pyxida/ping Removed Files: PingResult.java Log Message: starting to test --- PingResult.java DELETED --- |
|
From: Jonathan L. <le...@us...> - 2006-11-27 15:34:44
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3699/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Log Message: starting to test Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NCManager.java 27 Nov 2006 11:10:48 -0000 1.5 --- NCManager.java 27 Nov 2006 15:34:40 -0000 1.6 *************** *** 1,11 **** ! package edu.harvard.syrah.pyxida.nc; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Set; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.pyxida.nc.lib.Coordinate; import edu.harvard.syrah.pyxida.nc.lib.NCClient; import edu.harvard.syrah.pyxida.ping.PingManager; --- 1,14 ---- ! package edu.harvard.syrah.pyxida.nc; import java.util.Arrays; import java.util.HashSet; + import java.util.ArrayList; import java.util.Map; + import java.util.HashMap; import java.util.Set; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.pyxida.nc.lib.Coordinate; + import edu.harvard.syrah.pyxida.*; import edu.harvard.syrah.pyxida.nc.lib.NCClient; import edu.harvard.syrah.pyxida.ping.PingManager; *************** *** 22,27 **** import edu.harvard.syrah.sbon.comm.obj.ObjMessageIF; ! // TODO add proxy coordinates public class NCManager { private static final Log log = new Log(NCManager.class); --- 25,36 ---- import edu.harvard.syrah.sbon.comm.obj.ObjMessageIF; ! // MEDTODO add proxy coordinates + /** + * Manages the local and proxy coordinates. + * Initiates gossip to other overlay nodes. + * Receives and responds to gossip messages. + * Manages gossip set, e.g. set of overlay nodes that the coordinates might use as neighbors + */ public class NCManager { private static final Log log = new Log(NCManager.class); *************** *** 36,44 **** // which is important for Azureus integration. ! // TODO JTL: You need to test the regex below. It should work private String bootstrapList[] = Config.getProperty("pyxida.bootstraplist", "glenora, sb01, sb02, sb10, sb11").split("[,\\s]"); - - public static final long UPDATE_DELAY = 10 * 1000; // 10 seconds public static final long DEFAULT_PROXY_LEASE = 3600 * 1000; --- 45,61 ---- // which is important for Azureus integration. ! // JTLTODO: You need to test the regex below. It should work private String bootstrapList[] = Config.getProperty("pyxida.bootstraplist", "glenora, sb01, sb02, sb10, sb11").split("[,\\s]"); + /** + * Time between gossip messages to coordinate neighbors. + * Default is 10 seconds. + */ + public static final long UPDATE_DELAY = 10 * 1000; + + /** + * Default lifetime that proxy coordinates are managed for. + * Set to one hour. + */ public static final long DEFAULT_PROXY_LEASE = 3600 * 1000; *************** *** 50,53 **** --- 67,77 ---- final CoordClient localNC; + Map<AddressIF,Long> neighbor2age; + ArrayList<AddressIF> neighbors; + + /** + * Create a coordinate manager. + * Does not block. + */ public NCManager(ObjCommIF _comm, PingManager pingManager) { comm = _comm; *************** *** 57,63 **** --- 81,95 ---- } + /** + * Asynchronous initialization of coordinate manager. + * Resolves bootstrap neighbors and starts gossip for local coordinate. + * Starts listening for gossip messages. + */ public void init(final CB0 cbDone) { comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); + neighbor2age = new HashMap<AddressIF,Long>(); + neighbors = new ArrayList<AddressIF>(); + AddressFactory.createResolved(Arrays.asList(bootstrapList), new CB1<Map<String, AddressIF>>() { protected void cb(CBResult result, Map<String, AddressIF> addrMap) { *************** *** 66,75 **** for (String remoteNode : addrMap.keySet()) { AddressIF remoteAddr = addrMap.get(remoteNode); ! // TODO JTL: add remoteAddr to your data structure } localNC.init(); ! // Also ping for any proxy coordinates. cbDone.callOK(); --- 98,109 ---- for (String remoteNode : addrMap.keySet()) { AddressIF remoteAddr = addrMap.get(remoteNode); ! addGossipNode(remoteAddr); } + // Starts local coordinate timer localNC.init(); ! // MEDTODO Start periodic cleaner ! //neighborClean(); cbDone.callOK(); *************** *** 86,110 **** } public void createProxyCoord(AddressIF remoteNode, long lease) { ! // TODO } public void destroyProxyCoord(AddressIF remoteNode) { ! // TODO } public Coordinate getLocalCoord() { return localNC.nc.getSystemCoords(); } public double getLocalError() { return localNC.nc.getSystemError(); } public Coordinate getProxyCoord(AddressIF remoteNode) { ! // TODO return null; } public double estimateRTT(AddressIF nodeA, AddressIF nodeB) { // TODO --- 120,162 ---- } + /** + * Not implemented yet. + */ public void createProxyCoord(AddressIF remoteNode, long lease) { ! // LOWTODO } + /** + * Not implemented yet. + */ public void destroyProxyCoord(AddressIF remoteNode) { ! // LOWTODO } + /** + * @return local coordinate + */ public Coordinate getLocalCoord() { return localNC.nc.getSystemCoords(); } + /** + * @return local error + */ public double getLocalError() { return localNC.nc.getSystemError(); } + /** + * Not implemented yet. + */ public Coordinate getProxyCoord(AddressIF remoteNode) { ! // LOWTODO return null; } + /** + * + */ public double estimateRTT(AddressIF nodeA, AddressIF nodeB) { // TODO *************** *** 113,123 **** /* ! // TODO PRP low priority public void startUp(DataInputStream is) throws IOException { - // TODO } public void shutDown(DataOutputStream os) throws IOException { - // TODO } */ --- 165,173 ---- /* ! // LOWTODO PRP public void startUp(DataInputStream is) throws IOException { } public void shutDown(DataOutputStream os) throws IOException { } */ *************** *** 168,213 **** } Set<AddressIF> getGossipNodes(Coordinate remoteCoord) { ! // TODO return coordinates, possibly based on this guy's coordinate ! return null; } void addGossipNodes(Set<AddressIF> nodes) { ! // TODO add nodes to the set that we know about } ! AddressIF getGossipNode() { ! // TODO return a guy to gossip with ! return null; } class CoordClient { final NCClient<AddressIF> nc; public CoordClient() { nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); } public void init() { ! // TODO continuous timer ! // really would prefer randomly distributed timings ! // or an adaptive delay :) ! // ! // TODO JTL ! // ! // You can easily do this by varying UPDATE_DELAY. Remember that the semantics ! // of the call is that you have to re-register after each callback. ! EventLoop.get().registerTimerCB(UPDATE_DELAY, new CB0() { ! protected void cb(CBResult result) { ! update(); ! } ! }); } void update() { final AddressIF neighbor = pickGossipNode(); // send him a gossip msg ! // TODO could bias which nodes are sent based on his coord GossipRequestMsg msg = new GossipRequestMsg(localNC.nc.getSystemCoords(), getGossipNodes(null)); --- 218,302 ---- } + + AddressIF getGossipNode() { + if (neighbors.size() == 0) { + log.warn("we are lonely and have no one to gossip with"); + return null; + } + + int index = Pyxida.random.nextInt(neighbors.size()); + AddressIF node = neighbors.get(index); + + return node; + } + Set<AddressIF> getGossipNodes(Coordinate remoteCoord) { ! Set<AddressIF> nodes = new HashSet<AddressIF>(); ! // LOWTODO add option of loop here ! AddressIF node = getGossipNode(); ! if (node != null) { ! nodes.add(node); ! } ! return nodes; } void addGossipNodes(Set<AddressIF> nodes) { ! for (AddressIF node : nodes) { ! addGossipNode (node); ! } } ! void addGossipNode(AddressIF node) { ! long curr_time = System.currentTimeMillis(); ! Long expiry = neighbor2age.get(node); ! if (expiry != null) { ! log.debug ("gossip already knew node "+node); ! long old_time = expiry.longValue(); ! expiry = new Long (curr_time); ! ! expiry = neighbor2age.get(node); ! long new_time = expiry.longValue(); ! log.debug ("old_time "+old_time+" new "+new_time); ! ! return; ! } ! neighbors.add(node); ! neighbor2age.put(node,curr_time); ! log.debug ("gossip added new neighbor "+node); } class CoordClient { final NCClient<AddressIF> nc; + final CB0 updateCB; public CoordClient() { nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); + + updateCB = new CB0() { + protected void cb(CBResult result) { + update(); + } + }; + } + void registerTimer () { + // LOWTODO adaptive delay + double rnd = Pyxida.random.nextGaussian(); + long delay = UPDATE_DELAY + (long)(1000 * rnd); + log.debug ("setting timer to "+delay); + EventLoop.get().registerTimerCB(delay, updateCB); + } + public void init() { ! registerTimer(); } void update() { + registerTimer(); final AddressIF neighbor = pickGossipNode(); // send him a gossip msg ! // LOWTODO could bias which nodes are sent based on his coord GossipRequestMsg msg = new GossipRequestMsg(localNC.nc.getSystemCoords(), getGossipNodes(null)); *************** *** 217,225 **** AddressIF remoteAddr, Long ts, CB1<Boolean> cbHandled) { ! // TODO can use time of this instead of ping time // if we want to not use jpcap pings // (running not at root) // ! // TODO JTL: good idea. however, i'm not sure what the best way is to integrate this... // Ideally, all latency measurements should be done by the ping manager...? --- 306,314 ---- AddressIF remoteAddr, Long ts, CB1<Boolean> cbHandled) { ! // LOWTODO can use time of this instead of ping time // if we want to not use jpcap pings // (running not at root) // ! // However however PRP not sure what the best way is to integrate this... // Ideally, all latency measurements should be done by the ping manager...? *************** *** 234,246 **** switch (pingResult.state) { case OK: { - // and update our coordinate ! // TODO convert nclib to use floats // ! // TODO JTL: why do you want to use floats and not double? won't we run into // accuracy problems? long lat_ms = (long) Math.round(latency); long curr_time = System.currentTimeMillis(); localNC.nc.processSample(neighbor, responseMsg.remoteCoordinate, responseMsg.remoteError, lat_ms, responseMsg.remoteAge, curr_time, true); --- 323,336 ---- switch (pingResult.state) { case OK: { ! ! // MEDTODO convert nclib to use floats // ! // JTLTODO: why do you want to use floats and not double? won't we run into // accuracy problems? long lat_ms = (long) Math.round(latency); long curr_time = System.currentTimeMillis(); + // and update our coordinate localNC.nc.processSample(neighbor, responseMsg.remoteCoordinate, responseMsg.remoteError, lat_ms, responseMsg.remoteAge, curr_time, true); *************** *** 270,274 **** AddressIF pickGossipNode() { ! // TODO ask our ncClient if it has a preferred gossip node // if not, use somebody from our neighbor set --- 360,364 ---- AddressIF pickGossipNode() { ! // LOWTODO ask our ncClient if it has a preferred gossip node // if not, use somebody from our neighbor set *************** *** 284,288 **** void update() { ! AddressIF neighbor = pickGossipNode(); // ask him to ping our address --- 374,379 ---- void update() { ! registerTimer(); ! final AddressIF neighbor = pickGossipNode(); // ask him to ping our address *************** *** 296,300 **** super(); renewLease(_lease); ! // TODO Does this need to be cloned? // prp: Don't know but if you want to clone it, use the copy constructor addr = AddressFactory.create(_addr); --- 387,391 ---- super(); renewLease(_lease); ! // MEDTODO Does this need to be cloned? // prp: Don't know but if you want to clone it, use the copy constructor addr = AddressFactory.create(_addr); |
|
From: Peter P. <pr...@us...> - 2006-11-27 11:10:51
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3812/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: Addressed some (all?) of Jon's TODO. Jon, grep for "TODO JTL". Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Pyxida.java 26 Nov 2006 23:41:37 -0000 1.8 --- Pyxida.java 27 Nov 2006 11:10:48 -0000 1.9 *************** *** 10,19 **** import edu.harvard.syrah.sbon.async.EventLoop; import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; - import edu.harvard.syrah.sbon.comm.AddressFactory; import edu.harvard.syrah.sbon.comm.AddressIF; - import edu.harvard.syrah.sbon.comm.*; - import edu.harvard.syrah.sbon.comm.obj.*; - import edu.harvard.syrah.sbon.comm.obj.ObjComm; import edu.harvard.syrah.sbon.comm.obj.ObjCommIF; --- 10,15 ---- *************** *** 24,32 **** private static final String PYXIDA_VERSION = "0.1"; private static Pyxida pyxida = null; ! private NCManager ncManager = null; ! private APIManager apiManager = null; ! private PingManager pingManager = null; private ObjCommIF comm; --- 20,31 ---- private static final String PYXIDA_VERSION = "0.1"; + public static final String PYXIDA_CONFIG_FILE = System + .getProperty("pyxida.config", "config/pyxida.cfg"); + private static Pyxida pyxida = null; ! private NCManager ncManager; ! private APIManager apiManager; ! private PingManager pingManager; private ObjCommIF comm; *************** *** 35,54 **** private void init() { ! // TODO not sure if this needs to be out here ! // or can be pushed into NCManager comm = new ObjComm(); ! // Initialise the measurement modules ! pingManager = new PingManager(); ! pingManager.init(new CB0() { protected void cb(CBResult result) { ! // Initialise the NCs that we're responsible for ! ncManager = new NCManager(comm, pingManager); ! ncManager.init(); ! ! // Initialise the external APIs ! apiManager = new APIManager(ncManager); ! apiManager.init(); ! } ! }); } --- 34,80 ---- private void init() { ! // Initiliase the ObjComm communication module comm = new ObjComm(); ! int port = Integer.parseInt(Config.getConfigProps().getProperty("pyxida.port", "55500")); ! AddressIF objCommAddr = AddressFactory.createServer(port); ! comm.initServer(objCommAddr, new CB0() { protected void cb(CBResult result) { ! switch (result.state) { ! case OK: { ! // Initialise the measurement modules ! pingManager = new PingManager(); ! pingManager.init(new CB0() { ! protected void cb(CBResult result) { ! // Initialise the NCs that we're responsible for ! ncManager = new NCManager(comm, pingManager); ! ncManager.init(new CB0() { ! protected void cb(CBResult result) { ! switch (result.state) { ! case OK: { ! // Initialise the external APIs ! apiManager = new APIManager(ncManager); ! apiManager.init(); ! break; ! } ! case TIMEOUT: ! case ERROR: { ! log.error("Could not initialise the NCManager: " + result.what); ! break; ! } ! } ! } ! }); ! } ! }); ! break; ! } ! case TIMEOUT: ! case ERROR: { ! log.error("Could not bind to objcomm port: " + result.what); ! break; ! } ! } ! } ! }); } *************** *** 59,62 **** --- 85,91 ---- log.main("Pyxida Version " + PYXIDA_VERSION + " starting..."); + // TODO JTL: do you GetOpt magic here + // we need a switch to specify the config file and to turn on debugging + if (args.length > 0 && args[0].equals("-d")) { Log.setPackageRoot(Pyxida.class); *************** *** 66,69 **** --- 95,105 ---- args = newArgs; } + + // Read the config file + String configFileName = PYXIDA_CONFIG_FILE; + if (args.length == 1) { + configFileName = args[0]; + } + Config.read(configFileName); // Turn on assertions |
|
From: Peter P. <pr...@us...> - 2006-11-27 11:10:51
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3812/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java GossipResponseMsg.java GossipRequestMsg.java Log Message: Addressed some (all?) of Jon's TODO. Jon, grep for "TODO JTL". Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NCManager.java 27 Nov 2006 04:06:37 -0000 1.4 --- NCManager.java 27 Nov 2006 11:10:48 -0000 1.5 *************** *** 1,288 **** package edu.harvard.syrah.pyxida.nc; import java.util.HashSet; import java.util.Set; - import edu.harvard.syrah.pyxida.nc.lib.*; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.pyxida.nc.lib.NCClient; import edu.harvard.syrah.pyxida.ping.PingManager; import edu.harvard.syrah.sbon.comm.AddressIF; ! import edu.harvard.syrah.sbon.comm.obj.*; ! import edu.harvard.syrah.sbon.async.*; ! import edu.harvard.syrah.sbon.async.CallbacksIF.*; // TODO add proxy coordinates public class NCManager { ! static Log log = new Log(NCManager.class); ! ! // TODO read from config file ! private static final int NC_NUM_DIMS = 5; ! // Height is set within NCClient and is the "last dimension" ! // of the coordinates array. ! // Thus, setting this to 5 is 4d+height if height is in use. ! // This allows the size on the wire to remain constant ! // which is important for Azureus integration. ! ! // TODO PRP read from config file ! //private String bootstrapList[] = ("glenora", "sb01", "sb02", "sb10", "sb11"); ! // TODO PRP read from config file ! public static final long UPDATE_DELAY = 10*1000; // 10 seconds ! public static final long DEFAULT_PROXY_LEASE = 3600 * 1000; ! private PingManager pingManager = null; ! ! private Set<ProxyClient> proxyClients = new HashSet<ProxyClient>(); ! final ObjCommIF comm; ! final CoordClient localNC; ! ! public NCManager(ObjCommIF _comm, PingManager pingManager) { ! comm = _comm; ! this.pingManager = pingManager; ! // Initialise the local coord first ! localNC = new CoordClient (); ! } ! public void init() { ! comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); ! // TODO PRP ! /* ! foreach (String remoteNode : bootstrapList) { ! // resolve and add him ! } ! */ ! localNC.init(); ! ! // Also ping for any proxy coordinates. ! } ! public void createProxyCoord(AddressIF remoteNode, long lease) { ! // TODO ! } ! public void destroyProxyCoord(AddressIF remoteNode) { ! // TODO ! } ! public Coordinate getLocalCoord() { ! return localNC.nc.getSystemCoords(); ! } ! public double getLocalError() { ! return localNC.nc.getSystemError(); ! } ! public Coordinate getProxyCoord(AddressIF remoteNode) { ! // TODO ! return null; ! } ! public double estimateRTT(AddressIF nodeA, AddressIF nodeB) { ! // TODO ! return 0; ! } ! /* ! // TODO PRP low priority ! public void startUp(DataInputStream is) throws IOException { ! // TODO ! } ! public void shutDown(DataOutputStream os) throws IOException { ! // TODO ! } ! */ ! ! abstract class ResponseObjCommCB<T extends ObjMessageIF> extends ObjCommCB<T> { ! void sendResponseMessage (final String handler, final AddressIF remoteAddr, final ObjMessage response, long requestMsgId, final String errorMessage, final CB1<Boolean> cbHandled) { ! CBResult result = null; ! if (errorMessage != null) { ! log.debug(handler+ " :"+errorMessage); ! result = CBResult.ERROR(errorMessage); ! } else { ! result = CBResult.OK(); ! } ! ! comm.sendResponseMessage(response, remoteAddr, requestMsgId, new CB0() { ! protected void cb(CBResult sendResult) { ! switch (sendResult.state) { ! case TIMEOUT: ! case ERROR: { ! log.warn(handler+": "+sendResult.what); ! return; ! } ! } ! }}); ! cbHandled.call(CBResult.OK(), true); ! } ! } ! class GossipHandler extends ResponseObjCommCB<GossipRequestMsg> { ! public void cb(CBResult result, GossipRequestMsg msg, ! AddressIF remoteAddr, Long ts, ! final CB1<Boolean> cbHandled) { ! log.debug ("in GossipHandler cb: "+msg); ! long curr_time = System.currentTimeMillis(); ! sendResponseMessage ! ("Gossip", remoteAddr, ! new GossipResponseMsg(localNC.nc.getSystemCoords(), localNC.nc.getSystemError(), localNC.nc.getAge(curr_time), getGossipNodes(msg.coordinate)), ! msg.getMsgId(), null, cbHandled); ! ! } ! } ! Set<AddressIF> getGossipNodes (Coordinate remoteCoord) { ! // TODO return coordinates, possibly based on this guy's coordinate ! return null; ! } ! void addGossipNodes (Set<AddressIF> nodes) { ! // TODO add nodes to the set that we know about ! } ! AddressIF getGossipNode () { ! // TODO return a guy to gossip with ! return null; ! } ! class CoordClient { ! final NCClient<AddressIF> nc; ! public CoordClient () { ! nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); } ! public void init() { ! // TODO continuous timer ! // really would prefer randomly distributed timings ! // or an adaptive delay :) ! EventLoop.get().registerTimerCB(UPDATE_DELAY, new CB0() { ! protected void cb(CBResult result) { ! update(); ! // TODO PRP result.call(CBResult.OK()); ?? ! } ! }); } ! void update () { ! final AddressIF neighbor = pickGossipNode (); ! // send him a gossip msg ! // TODO could bias which nodes are sent based on his coord ! GossipRequestMsg msg = ! new GossipRequestMsg(localNC.nc.getSystemCoords(),getGossipNodes(null)); ! comm.sendRequestMessage(msg, neighbor, new ObjCommCB<GossipResponseMsg>() { ! protected void cb(CBResult result, final GossipResponseMsg responseMsg, ! AddressIF remoteAddr, Long ts, CB1<Boolean> cbHandled) { ! // TODO can use time of this instead of ping time ! // if we want to not use jpcap pings ! // (running not at root) ! switch (result.state) { ! case OK: { ! // keep track of new guys he's told us about ! addGossipNodes(responseMsg.nodes); ! // and ping him ! pingManager.addPingRequest(comm.getLocalAddress(), neighbor, new CB1<Float>() { ! protected void cb(CBResult pingResult, Float latency) { ! switch (pingResult.state) { ! case OK:{ ! // and update our coordinate ! // TODO convert nclib to use floats ! long lat_ms = (long) Math.round(latency); ! long curr_time = System.currentTimeMillis(); ! localNC.nc.processSample(neighbor, responseMsg.remoteCoordinate, responseMsg.remoteError, lat_ms, responseMsg.remoteAge, curr_time, true); ! break; ! } ! case TIMEOUT: ! case ERROR: { ! log.warn("Ping to "+neighbor+" failed"); ! break; ! } } - } }); - - break; - } - case ERROR: - case TIMEOUT: { - log.warn("Did not receive gossip response from "+neighbor); - break; - } - } } - }); - } ! AddressIF pickGossipNode () { ! // TODO ask our ncClient if it has a preferred gossip node ! // if not, use somebody from our neighbor set ! return getGossipNode(); ! } ! } ! class ProxyClient extends CoordClient { ! final AddressIF addr; ! long lease; ! void update () { ! AddressIF neighbor = pickGossipNode (); ! // ask him to ping our address ! // and tell us about him ! // update our coordinate ! } ! public ProxyClient (AddressIF _addr, long _lease) { ! super (); ! renewLease (_lease); ! // TODO PRP does this need to be cloned? ! //addr = _addr.clone(); ! addr = _addr; ! } ! public void renewLease (long _lease) { ! if (_lease <= 0) { ! log.warn ("Changing given lease "+_lease+" to default lease "+ ! DEFAULT_PROXY_LEASE); ! _lease = DEFAULT_PROXY_LEASE; ! } ! lease = System.currentTimeMillis() + _lease; ! if (lease < 0) lease = Long.MAX_VALUE; ! } ! public boolean hasExpired () { ! if (System.currentTimeMillis() > lease) { ! return true; ! } ! return false; } - } } --- 1,322 ---- package edu.harvard.syrah.pyxida.nc; + import java.util.Arrays; import java.util.HashSet; + import java.util.Map; import java.util.Set; import edu.harvard.syrah.prp.Log; + import edu.harvard.syrah.pyxida.nc.lib.Coordinate; import edu.harvard.syrah.pyxida.nc.lib.NCClient; import edu.harvard.syrah.pyxida.ping.PingManager; + import edu.harvard.syrah.sbon.async.CBResult; + import edu.harvard.syrah.sbon.async.Config; + import edu.harvard.syrah.sbon.async.EventLoop; + import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; + import edu.harvard.syrah.sbon.async.CallbacksIF.CB1; + import edu.harvard.syrah.sbon.comm.AddressFactory; import edu.harvard.syrah.sbon.comm.AddressIF; ! import edu.harvard.syrah.sbon.comm.obj.ObjCommCB; ! import edu.harvard.syrah.sbon.comm.obj.ObjCommIF; ! import edu.harvard.syrah.sbon.comm.obj.ObjMessage; ! import edu.harvard.syrah.sbon.comm.obj.ObjMessageIF; // TODO add proxy coordinates public class NCManager { ! private static final Log log = new Log(NCManager.class); ! // Number of dimensions ! private static final int NC_NUM_DIMS = Integer.parseInt(Config.getProperty("pyxida.dimensions", "5")); ! ! // Height is set within NCClient and is the "last dimension" ! // of the coordinates array. ! // Thus, setting this to 5 is 4d+height if height is in use. ! // This allows the size on the wire to remain constant ! // which is important for Azureus integration. ! // TODO JTL: You need to test the regex below. It should work ! private String bootstrapList[] = Config.getProperty("pyxida.bootstraplist", "glenora, sb01, sb02, sb10, sb11").split("[,\\s]"); ! ! public static final long UPDATE_DELAY = 10 * 1000; // 10 seconds ! public static final long DEFAULT_PROXY_LEASE = 3600 * 1000; ! private PingManager pingManager = null; ! private Set<ProxyClient> proxyClients = new HashSet<ProxyClient>(); ! final ObjCommIF comm; ! final CoordClient localNC; ! public NCManager(ObjCommIF _comm, PingManager pingManager) { ! comm = _comm; ! this.pingManager = pingManager; ! // Initialise the local coord first ! localNC = new CoordClient(); ! } ! public void init(final CB0 cbDone) { ! comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); ! AddressFactory.createResolved(Arrays.asList(bootstrapList), new CB1<Map<String, AddressIF>>() { ! protected void cb(CBResult result, Map<String, AddressIF> addrMap) { ! switch (result.state) { ! case OK: { ! for (String remoteNode : addrMap.keySet()) { ! AddressIF remoteAddr = addrMap.get(remoteNode); ! // TODO JTL: add remoteAddr to your data structure ! } ! localNC.init(); ! // Also ping for any proxy coordinates. ! cbDone.callOK(); ! break; ! } ! case TIMEOUT: ! case ERROR: { ! log.error("Could not resolve bootstrap list: " + result.what); ! break; ! } ! } ! } ! }); ! } ! public void createProxyCoord(AddressIF remoteNode, long lease) { ! // TODO ! } ! public void destroyProxyCoord(AddressIF remoteNode) { ! // TODO ! } ! public Coordinate getLocalCoord() { ! return localNC.nc.getSystemCoords(); ! } ! public double getLocalError() { ! return localNC.nc.getSystemError(); ! } ! public Coordinate getProxyCoord(AddressIF remoteNode) { ! // TODO ! return null; ! } ! public double estimateRTT(AddressIF nodeA, AddressIF nodeB) { ! // TODO ! return 0; ! } ! /* ! // TODO PRP low priority ! public void startUp(DataInputStream is) throws IOException { ! // TODO ! } ! public void shutDown(DataOutputStream os) throws IOException { ! // TODO ! } ! */ ! abstract class ResponseObjCommCB<T extends ObjMessageIF> extends ObjCommCB<T> { ! void sendResponseMessage(final String handler, final AddressIF remoteAddr, ! final ObjMessage response, long requestMsgId, final String errorMessage, ! final CB1<Boolean> cbHandled) { ! CBResult result = null; ! if (errorMessage != null) { ! log.debug(handler + " :" + errorMessage); ! result = CBResult.ERROR(errorMessage); ! } else { ! result = CBResult.OK(); ! } ! comm.sendResponseMessage(response, remoteAddr, requestMsgId, new CB0() { ! protected void cb(CBResult sendResult) { ! switch (sendResult.state) { ! case TIMEOUT: ! case ERROR: { ! log.warn(handler + ": " + sendResult.what); ! return; ! } ! } ! } ! }); ! cbHandled.call(CBResult.OK(), true); ! } ! } + class GossipHandler extends ResponseObjCommCB<GossipRequestMsg> { ! public void cb(CBResult result, GossipRequestMsg msg, AddressIF remoteAddr, Long ts, ! final CB1<Boolean> cbHandled) { ! log.debug("in GossipHandler cb: " + msg); ! long curr_time = System.currentTimeMillis(); ! sendResponseMessage("Gossip", remoteAddr, ! new GossipResponseMsg(localNC.nc.getSystemCoords(), localNC.nc.getSystemError(), ! localNC.nc.getAge(curr_time), getGossipNodes(msg.coordinate)), msg.getMsgId(), null, ! cbHandled); ! ! } } ! Set<AddressIF> getGossipNodes(Coordinate remoteCoord) { ! // TODO return coordinates, possibly based on this guy's coordinate ! return null; } ! void addGossipNodes(Set<AddressIF> nodes) { ! // TODO add nodes to the set that we know about ! } ! AddressIF getGossipNode() { ! // TODO return a guy to gossip with ! return null; ! } ! class CoordClient { ! final NCClient<AddressIF> nc; ! public CoordClient() { ! nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); ! } ! public void init() { ! // TODO continuous timer ! // really would prefer randomly distributed timings ! // or an adaptive delay :) ! // ! // TODO JTL ! // ! // You can easily do this by varying UPDATE_DELAY. Remember that the semantics ! // of the call is that you have to re-register after each callback. ! EventLoop.get().registerTimerCB(UPDATE_DELAY, new CB0() { ! protected void cb(CBResult result) { ! update(); ! } ! }); ! } ! void update() { ! final AddressIF neighbor = pickGossipNode(); ! // send him a gossip msg ! // TODO could bias which nodes are sent based on his coord ! GossipRequestMsg msg = new GossipRequestMsg(localNC.nc.getSystemCoords(), ! getGossipNodes(null)); ! comm.sendRequestMessage(msg, neighbor, new ObjCommCB<GossipResponseMsg>() { ! protected void cb(CBResult result, final GossipResponseMsg responseMsg, ! AddressIF remoteAddr, Long ts, CB1<Boolean> cbHandled) { ! // TODO can use time of this instead of ping time ! // if we want to not use jpcap pings ! // (running not at root) ! // ! // TODO JTL: good idea. however, i'm not sure what the best way is to integrate this... ! // Ideally, all latency measurements should be done by the ping manager...? ! ! switch (result.state) { ! case OK: { ! // keep track of new guys he's told us about ! addGossipNodes(responseMsg.nodes); ! ! // and ping him ! pingManager.addPingRequest(comm.getLocalAddress(), neighbor, new CB1<Float>() { ! protected void cb(CBResult pingResult, Float latency) { ! switch (pingResult.state) { ! case OK: { ! // and update our coordinate ! ! // TODO convert nclib to use floats ! // ! // TODO JTL: why do you want to use floats and not double? won't we run into ! // accuracy problems? ! long lat_ms = (long) Math.round(latency); ! long curr_time = System.currentTimeMillis(); ! ! localNC.nc.processSample(neighbor, responseMsg.remoteCoordinate, ! responseMsg.remoteError, lat_ms, responseMsg.remoteAge, curr_time, true); ! ! break; ! } ! case TIMEOUT: ! case ERROR: { ! log.warn("Ping to " + neighbor + " failed"); ! break; ! } ! } ! } ! }); ! ! break; ! } ! case ERROR: ! case TIMEOUT: { ! log.warn("Did not receive gossip response from " + neighbor); ! break; ! } ! } } }); } ! AddressIF pickGossipNode() { ! // TODO ask our ncClient if it has a preferred gossip node ! // if not, use somebody from our neighbor set ! return getGossipNode(); ! } ! } ! class ProxyClient extends CoordClient { ! final AddressIF addr; ! long lease; ! void update() { ! AddressIF neighbor = pickGossipNode(); ! // ask him to ping our address ! // and tell us about him ! // update our coordinate ! } ! public ProxyClient(AddressIF _addr, long _lease) { ! super(); ! renewLease(_lease); ! // TODO Does this need to be cloned? ! // prp: Don't know but if you want to clone it, use the copy constructor ! addr = AddressFactory.create(_addr); ! } ! public void renewLease(long _lease) { ! if (_lease <= 0) { ! log.warn("Changing given lease " + _lease + " to default lease " + DEFAULT_PROXY_LEASE); ! _lease = DEFAULT_PROXY_LEASE; ! } ! lease = System.currentTimeMillis() + _lease; ! if (lease < 0) ! lease = Long.MAX_VALUE; ! } ! public boolean hasExpired() { ! if (System.currentTimeMillis() > lease) { ! return true; ! } ! return false; ! } } } Index: GossipResponseMsg.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/GossipResponseMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GossipResponseMsg.java 27 Nov 2006 04:06:37 -0000 1.2 --- GossipResponseMsg.java 27 Nov 2006 11:10:48 -0000 1.3 *************** *** 2,9 **** import java.util.Set; ! import edu.harvard.syrah.sbon.comm.obj.ObjMessage; ! import edu.harvard.syrah.pyxida.nc.lib.*; ! import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.sbon.comm.AddressIF; /** --- 2,9 ---- import java.util.Set; ! ! import edu.harvard.syrah.pyxida.nc.lib.Coordinate; import edu.harvard.syrah.sbon.comm.AddressIF; + import edu.harvard.syrah.sbon.comm.obj.ObjMessage; /** Index: GossipRequestMsg.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/GossipRequestMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GossipRequestMsg.java 25 Nov 2006 21:39:59 -0000 1.1 --- GossipRequestMsg.java 27 Nov 2006 11:10:48 -0000 1.2 *************** *** 2,9 **** import java.util.Set; ! import edu.harvard.syrah.sbon.comm.obj.ObjMessage; ! import edu.harvard.syrah.pyxida.nc.lib.*; ! import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.sbon.comm.AddressIF; /** --- 2,9 ---- import java.util.Set; ! ! import edu.harvard.syrah.pyxida.nc.lib.Coordinate; import edu.harvard.syrah.sbon.comm.AddressIF; + import edu.harvard.syrah.sbon.comm.obj.ObjMessage; /** |
|
From: Peter P. <pr...@us...> - 2006-11-27 11:10:51
|
Update of /cvsroot/pyxida/Pyxida/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3812/lib Modified Files: sbon-async.jar Log Message: Addressed some (all?) of Jon's TODO. Jon, grep for "TODO JTL". Index: sbon-async.jar =================================================================== RCS file: /cvsroot/pyxida/Pyxida/lib/sbon-async.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvs4SHbft and /tmp/cvsl56GbH differ |
|
From: Jonathan L. <le...@us...> - 2006-11-27 04:06:39
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10781/src/edu/harvard/syrah/pyxida/ping Modified Files: PingManager.java Log Message: bit more code Index: PingManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping/PingManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PingManager.java 25 Nov 2006 21:39:59 -0000 1.5 --- PingManager.java 27 Nov 2006 04:06:37 -0000 1.6 *************** *** 1,3 **** ! package edu.harvard.syrah.pyxida.ping; import java.util.HashSet; --- 1,3 ---- ! package edu.harvard.syrah.pyxida.ping; import java.util.HashSet; *************** *** 38,43 **** } ! public void addPingReq(AddressIF nodeA, AddressIF nodeB, CB1<Double> cbMeasurement) { // TODO implement me } --- 38,47 ---- } ! public void addPingRequest(AddressIF nodeA, AddressIF nodeB, CB1<Float> cbMeasurement) { // TODO implement me + + // TODO use floats, not doubles (or longs) + // This is to limit the amount of memory used within Azureus + log.warn ("implement me"); } |
|
From: Jonathan L. <le...@us...> - 2006-11-27 04:06:39
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10781/src/edu/harvard/syrah/pyxida/nc Modified Files: GossipResponseMsg.java NCManager.java Log Message: bit more code Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NCManager.java 26 Nov 2006 23:41:37 -0000 1.3 --- NCManager.java 27 Nov 2006 04:06:37 -0000 1.4 *************** *** 52,64 **** // TODO PRP /* ! foreach (String remoteNode : bootstrapList) { ! // resolve and add him ! } */ - // TODO create timer to ping neighbors localNC.init(); - - // and/or ask local client who it would like to ping // Also ping for any proxy coordinates. --- 52,61 ---- // TODO PRP /* ! foreach (String remoteNode : bootstrapList) { ! // resolve and add him ! } */ localNC.init(); // Also ping for any proxy coordinates. *************** *** 93,103 **** /* ! // TODO PRP low priority public void startUp(DataInputStream is) throws IOException { ! // TODO } public void shutDown(DataOutputStream os) throws IOException { ! // TODO } */ --- 90,100 ---- /* ! // TODO PRP low priority public void startUp(DataInputStream is) throws IOException { ! // TODO } public void shutDown(DataOutputStream os) throws IOException { ! // TODO } */ *************** *** 152,155 **** --- 149,157 ---- } + void addGossipNodes (Set<AddressIF> nodes) { + // TODO add nodes to the set that we know about + } + + AddressIF getGossipNode () { // TODO return a guy to gossip with *************** *** 171,174 **** --- 173,177 ---- protected void cb(CBResult result) { update(); + // TODO PRP result.call(CBResult.OK()); ?? } }); *************** *** 176,180 **** void update () { ! AddressIF neighbor = pickGossipNode (); // send him a gossip msg --- 179,183 ---- void update () { ! final AddressIF neighbor = pickGossipNode (); // send him a gossip msg *************** *** 182,192 **** GossipRequestMsg msg = new GossipRequestMsg(localNC.nc.getSystemCoords(),getGossipNodes(null)); ! // TODO JTL leaving off here ! //comm.sendTheMsg(); ! ! // and ping him ! // and update our coordinate } --- 185,236 ---- GossipRequestMsg msg = new GossipRequestMsg(localNC.nc.getSystemCoords(),getGossipNodes(null)); ! comm.sendRequestMessage(msg, neighbor, new ObjCommCB<GossipResponseMsg>() { ! protected void cb(CBResult result, final GossipResponseMsg responseMsg, ! AddressIF remoteAddr, Long ts, CB1<Boolean> cbHandled) { ! ! // TODO can use time of this instead of ping time ! // if we want to not use jpcap pings ! // (running not at root) ! ! switch (result.state) { ! case OK: { ! // keep track of new guys he's told us about ! addGossipNodes(responseMsg.nodes); ! ! // and ping him ! pingManager.addPingRequest(comm.getLocalAddress(), neighbor, new CB1<Float>() { ! protected void cb(CBResult pingResult, Float latency) { ! switch (pingResult.state) { ! case OK:{ ! // and update our coordinate + // TODO convert nclib to use floats + long lat_ms = (long) Math.round(latency); + long curr_time = System.currentTimeMillis(); + + localNC.nc.processSample(neighbor, responseMsg.remoteCoordinate, responseMsg.remoteError, lat_ms, responseMsg.remoteAge, curr_time, true); + + break; + } + case TIMEOUT: + case ERROR: { + log.warn("Ping to "+neighbor+" failed"); + break; + } + } + } + }); + + break; + } + case ERROR: + case TIMEOUT: { + log.warn("Did not receive gossip response from "+neighbor); + break; + } + } + } + }); } Index: GossipResponseMsg.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/GossipResponseMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GossipResponseMsg.java 25 Nov 2006 21:39:59 -0000 1.1 --- GossipResponseMsg.java 27 Nov 2006 04:06:37 -0000 1.2 *************** *** 1,3 **** ! package edu.harvard.syrah.pyxida.nc; import java.util.Set; --- 1,3 ---- ! package edu.harvard.syrah.pyxida.nc; import java.util.Set; |
|
From: Jonathan L. <le...@us...> - 2006-11-26 23:41:39
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Log Message: part way through inter-node gossip (non-proxy) Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NCManager.java 25 Nov 2006 21:39:59 -0000 1.2 --- NCManager.java 26 Nov 2006 23:41:37 -0000 1.3 *************** *** 16,23 **** public class NCManager { ! private static Log log = new Log(NCManager.class); ! ! // TODO read from config file ! private static final int NC_NUM_DIMS = 5; // Height is set within NCClient and is the "last dimension" // of the coordinates array. --- 16,23 ---- public class NCManager { ! static Log log = new Log(NCManager.class); ! ! // TODO read from config file ! private static final int NC_NUM_DIMS = 5; // Height is set within NCClient and is the "last dimension" // of the coordinates array. *************** *** 25,96 **** // This allows the size on the wire to remain constant // which is important for Azureus integration. ! ! private PingManager pingManager = null; ! ! private Set<NCClient<AddressIF>> ncClients = new HashSet<NCClient<AddressIF>>(); final ObjCommIF comm; ! final NCClient<AddressIF> localNCClient; ! public NCManager(ObjCommIF _comm, PingManager pingManager) { ! comm = _comm; ! this.pingManager = pingManager; ! // Initialise the local coord first ! localNCClient = new NCClient<AddressIF>(NC_NUM_DIMS); ! } - - public void init() { - comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); - // TODO read in list of bootstrap neighbors from config file ! // TODO create timer to ping neighbors ! // and/or ask local client who it would like to ping ! ! // Also ping for any proxy coordinates. } abstract class ResponseObjCommCB<T extends ObjMessageIF> extends ObjCommCB<T> { ! void sendResponseMessage (final String handler, final AddressIF remoteAddr, final ObjMessage response, long requestMsgId, final String errorMessage, final CB1<Boolean> cbHandled) { ! CBResult result = null; ! if (errorMessage != null) { ! log.debug(handler+ " :"+errorMessage); ! result = CBResult.ERROR(errorMessage); ! } else { ! result = CBResult.OK(); ! } ! ! comm.sendResponseMessage(response, remoteAddr, requestMsgId, new CB0() { ! protected void cb(CBResult sendResult) { ! switch (sendResult.state) { ! case TIMEOUT: ! case ERROR: { ! log.warn(handler+": "+sendResult.what); ! return; ! } ! } ! }}); ! cbHandled.call(CBResult.OK(), true); ! } } class GossipHandler extends ResponseObjCommCB<GossipRequestMsg> { ! public void cb(CBResult result, GossipRequestMsg msg, ! AddressIF remoteAddr, Long ts, ! final CB1<Boolean> cbHandled) { ! log.debug ("in GossipHandler cb: "+msg); ! long curr_time = System.currentTimeMillis(); ! sendResponseMessage ! ("Gossip", remoteAddr, ! new GossipResponseMsg(localNCClient.getSystemCoords(), localNCClient.getSystemError(), localNCClient.getAge(curr_time), getGossipNodes(msg.coordinate)), ! msg.getMsgId(), null, cbHandled); ! ! } } --- 25,148 ---- // This allows the size on the wire to remain constant // which is important for Azureus integration. ! ! // TODO PRP read from config file ! //private String bootstrapList[] = ("glenora", "sb01", "sb02", "sb10", "sb11"); ! // TODO PRP read from config file ! public static final long UPDATE_DELAY = 10*1000; // 10 seconds ! ! public static final long DEFAULT_PROXY_LEASE = 3600 * 1000; ! ! private PingManager pingManager = null; ! ! private Set<ProxyClient> proxyClients = new HashSet<ProxyClient>(); final ObjCommIF comm; ! final CoordClient localNC; ! public NCManager(ObjCommIF _comm, PingManager pingManager) { ! comm = _comm; ! this.pingManager = pingManager; ! // Initialise the local coord first ! localNC = new CoordClient (); } ! public void init() { ! comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); + // TODO PRP + /* + foreach (String remoteNode : bootstrapList) { + // resolve and add him } + */ + + // TODO create timer to ping neighbors + localNC.init(); + + // and/or ask local client who it would like to ping + + // Also ping for any proxy coordinates. + + } + + public void createProxyCoord(AddressIF remoteNode, long lease) { + // TODO + } + + public void destroyProxyCoord(AddressIF remoteNode) { + // TODO + } + + public Coordinate getLocalCoord() { + return localNC.nc.getSystemCoords(); + } + + public double getLocalError() { + return localNC.nc.getSystemError(); + } + + public Coordinate getProxyCoord(AddressIF remoteNode) { + // TODO + return null; + } + + public double estimateRTT(AddressIF nodeA, AddressIF nodeB) { + // TODO + return 0; + } + + /* + // TODO PRP low priority + public void startUp(DataInputStream is) throws IOException { + // TODO + } + + public void shutDown(DataOutputStream os) throws IOException { + // TODO + } + */ + abstract class ResponseObjCommCB<T extends ObjMessageIF> extends ObjCommCB<T> { ! void sendResponseMessage (final String handler, final AddressIF remoteAddr, final ObjMessage response, long requestMsgId, final String errorMessage, final CB1<Boolean> cbHandled) { ! CBResult result = null; ! if (errorMessage != null) { ! log.debug(handler+ " :"+errorMessage); ! result = CBResult.ERROR(errorMessage); ! } else { ! result = CBResult.OK(); ! } ! ! comm.sendResponseMessage(response, remoteAddr, requestMsgId, new CB0() { ! protected void cb(CBResult sendResult) { ! switch (sendResult.state) { ! case TIMEOUT: ! case ERROR: { ! log.warn(handler+": "+sendResult.what); ! return; ! } ! } ! }}); ! cbHandled.call(CBResult.OK(), true); ! } } class GossipHandler extends ResponseObjCommCB<GossipRequestMsg> { ! public void cb(CBResult result, GossipRequestMsg msg, ! AddressIF remoteAddr, Long ts, ! final CB1<Boolean> cbHandled) { ! log.debug ("in GossipHandler cb: "+msg); ! long curr_time = System.currentTimeMillis(); ! sendResponseMessage ! ("Gossip", remoteAddr, ! new GossipResponseMsg(localNC.nc.getSystemCoords(), localNC.nc.getSystemError(), localNC.nc.getAge(curr_time), getGossipNodes(msg.coordinate)), ! msg.getMsgId(), null, cbHandled); ! ! } } *************** *** 100,102 **** --- 152,244 ---- } + AddressIF getGossipNode () { + // TODO return a guy to gossip with + return null; + } + + class CoordClient { + final NCClient<AddressIF> nc; + + public CoordClient () { + nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); + } + + public void init() { + // TODO continuous timer + // really would prefer randomly distributed timings + // or an adaptive delay :) + EventLoop.get().registerTimerCB(UPDATE_DELAY, new CB0() { + protected void cb(CBResult result) { + update(); + } + }); + } + + void update () { + AddressIF neighbor = pickGossipNode (); + + // send him a gossip msg + // TODO could bias which nodes are sent based on his coord + GossipRequestMsg msg = + new GossipRequestMsg(localNC.nc.getSystemCoords(),getGossipNodes(null)); + // TODO JTL leaving off here + //comm.sendTheMsg(); + + // and ping him + + // and update our coordinate + + } + + AddressIF pickGossipNode () { + // TODO ask our ncClient if it has a preferred gossip node + + // if not, use somebody from our neighbor set + return getGossipNode(); + + } + + } + + class ProxyClient extends CoordClient { + final AddressIF addr; + long lease; + + void update () { + AddressIF neighbor = pickGossipNode (); + + // ask him to ping our address + // and tell us about him + + // update our coordinate + + } + + public ProxyClient (AddressIF _addr, long _lease) { + super (); + renewLease (_lease); + // TODO PRP does this need to be cloned? + //addr = _addr.clone(); + addr = _addr; + } + + public void renewLease (long _lease) { + if (_lease <= 0) { + log.warn ("Changing given lease "+_lease+" to default lease "+ + DEFAULT_PROXY_LEASE); + _lease = DEFAULT_PROXY_LEASE; + } + + lease = System.currentTimeMillis() + _lease; + if (lease < 0) lease = Long.MAX_VALUE; + } + + public boolean hasExpired () { + if (System.currentTimeMillis() > lease) { + return true; + } + return false; + } + } + } |
|
From: Jonathan L. <le...@us...> - 2006-11-26 23:41:39
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: part way through inter-node gossip (non-proxy) Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Pyxida.java 26 Nov 2006 18:05:03 -0000 1.7 --- Pyxida.java 26 Nov 2006 23:41:37 -0000 1.8 *************** *** 10,13 **** --- 10,19 ---- import edu.harvard.syrah.sbon.async.EventLoop; import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; + + import edu.harvard.syrah.sbon.comm.AddressFactory; + import edu.harvard.syrah.sbon.comm.AddressIF; + import edu.harvard.syrah.sbon.comm.*; + import edu.harvard.syrah.sbon.comm.obj.*; + import edu.harvard.syrah.sbon.comm.obj.ObjComm; import edu.harvard.syrah.sbon.comm.obj.ObjCommIF; |
|
From: Jonathan L. <le...@us...> - 2006-11-26 23:41:39
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588/src/edu/harvard/syrah/pyxida/api Modified Files: ExternalAPIIF.java Log Message: part way through inter-node gossip (non-proxy) Index: ExternalAPIIF.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/api/ExternalAPIIF.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExternalAPIIF.java 21 Nov 2006 21:14:59 -0000 1.1 --- ExternalAPIIF.java 26 Nov 2006 23:41:37 -0000 1.2 *************** *** 6,10 **** public interface ExternalAPIIF { ! // Return a coord public Coordinate getCoord(AddressIF node); --- 6,13 ---- public interface ExternalAPIIF { ! /* ! * Returns a coordinate ! * of either a substrate node or a local proxy node ! */ public Coordinate getCoord(AddressIF node); *************** *** 13,20 **** // Create a new proxy coord with a lease ! public void createProxyCoord(AddressIF remoteNode); // Renew proxy coord lease ! public void renewProxyCoord(AddressIF remoteNode); } --- 16,31 ---- // Create a new proxy coord with a lease ! // lease is given in ms ! // lease of 0 will expire in one hour ! public void createProxyCoord(AddressIF remoteNode, long lease); // Renew proxy coord lease ! public void renewProxyCoord(AddressIF remoteNode, long lease); + public void destroyProxyCoord(AddressIF remoteNode); + + // TODO Add routing methods + + // TODO add startup and shutdown either here or to pyxida main + } |
|
From: Jonathan L. <le...@us...> - 2006-11-26 23:41:39
|
Update of /cvsroot/pyxida/Pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588 Modified Files: TODO Log Message: part way through inter-node gossip (non-proxy) Index: TODO =================================================================== RCS file: /cvsroot/pyxida/Pyxida/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TODO 20 Nov 2006 13:33:24 -0000 1.1 --- TODO 26 Nov 2006 23:41:37 -0000 1.2 *************** *** 6,8 **** - roll out on PL - make front page nice ! - proxy coord fns and stuff for Mema/BU \ No newline at end of file --- 6,10 ---- - roll out on PL - make front page nice ! - proxy coord fns and stuff for Mema/BU ! ! - add startup/shutdown functionality so that coords are restored on restart |
|
From: Peter P. <pr...@us...> - 2006-11-26 18:05:05
|
Update of /cvsroot/pyxida/Pyxida/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18457/lib Modified Files: sbon-async.jar Log Message: Removed the SBON dependency from sbon-async.jar Index: sbon-async.jar =================================================================== RCS file: /cvsroot/pyxida/Pyxida/lib/sbon-async.jar,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvs3E2bdB and /tmp/cvsyegrmM differ |
|
From: Peter P. <pr...@us...> - 2006-11-26 18:05:05
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18457/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: Removed the SBON dependency from sbon-async.jar Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Pyxida.java 25 Nov 2006 21:39:59 -0000 1.6 --- Pyxida.java 26 Nov 2006 18:05:03 -0000 1.7 *************** *** 1,6 **** package edu.harvard.syrah.pyxida; - import java.util.Properties; - import edu.harvard.syrah.prp.ANSI; import edu.harvard.syrah.prp.Log; --- 1,4 ---- *************** *** 9,61 **** import edu.harvard.syrah.pyxida.ping.PingManager; import edu.harvard.syrah.sbon.async.CBResult; import edu.harvard.syrah.sbon.async.EventLoop; import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; ! ! import edu.harvard.syrah.sbon.comm.AddressFactory; ! import edu.harvard.syrah.sbon.comm.AddressIF; ! import edu.harvard.syrah.sbon.comm.obj.*; public class Pyxida { private static final Log log = new Log(Pyxida.class); ! private static final String PYXIDA_VERSION = "0.1"; - - private static Properties configProps = System.getProperties(); - public static Properties getConfigProps() { return configProps; } - public static void setConfigProps(Properties props) { configProps = props; } - - private static Pyxida pyxida = null; - - private NCManager ncManager = null; - private APIManager apiManager = null; - private PingManager pingManager = null; - private ObjCommIF comm; - - private Pyxida() { /* empty */ } - - private void init() { ! // TODO not sure if this needs to be out here ! // or can be pushed into NCManager ! comm = new ObjComm(); ! // Initialise the measurement modules ! pingManager = new PingManager(); ! pingManager.init(new CB0() { protected void cb(CBResult result) { ! // Initialise the NCs that we're responsible for ! ncManager = new NCManager(comm,pingManager); ! ncManager.init(); ! ! // Initialise the external APIs ! apiManager = new APIManager(ncManager); ! apiManager.init(); ! } ! }); ! } ! /** * @param args */ ! public static void main(String[] args) { log.main("Pyxida Version " + PYXIDA_VERSION + " starting..."); --- 7,54 ---- import edu.harvard.syrah.pyxida.ping.PingManager; import edu.harvard.syrah.sbon.async.CBResult; + import edu.harvard.syrah.sbon.async.Config; import edu.harvard.syrah.sbon.async.EventLoop; import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; ! import edu.harvard.syrah.sbon.comm.obj.ObjComm; ! import edu.harvard.syrah.sbon.comm.obj.ObjCommIF; public class Pyxida { private static final Log log = new Log(Pyxida.class); ! private static final String PYXIDA_VERSION = "0.1"; ! private static Pyxida pyxida = null; ! ! private NCManager ncManager = null; ! private APIManager apiManager = null; ! private PingManager pingManager = null; ! private ObjCommIF comm; ! ! private Pyxida() { /* empty */} ! ! private void init() { ! ! // TODO not sure if this needs to be out here ! // or can be pushed into NCManager ! comm = new ObjComm(); ! // Initialise the measurement modules ! pingManager = new PingManager(); ! pingManager.init(new CB0() { protected void cb(CBResult result) { ! // Initialise the NCs that we're responsible for ! ncManager = new NCManager(comm, pingManager); ! ncManager.init(); ! ! // Initialise the external APIs ! apiManager = new APIManager(ncManager); ! apiManager.init(); ! } ! }); ! } ! /** * @param args */ ! public static void main(String[] args) { log.main("Pyxida Version " + PYXIDA_VERSION + " starting..."); *************** *** 67,99 **** args = newArgs; } ! // Turn on assertions boolean assertsEnabled = false; assert assertsEnabled = true; if (!assertsEnabled) ! log.error("Please run the code with assertions turned on: java -ea ..."); ! // Turn on colour support ! ANSI.use(Boolean.valueOf(getConfigProps().getProperty("sbon.console.ansi", "true"))); /* * Create the event loop */ ! EventLoop.set(new EventLoop( ! Long.valueOf(getConfigProps().getProperty("sbon.eventloop.statedump", "30000")), ! Boolean.valueOf(getConfigProps().getProperty("sbon.eventloop.showidle", "false"))) ! ); ! pyxida = new Pyxida(); pyxida.init(); ! try { ! EventLoop.get().main(); } catch (OutOfMemoryError e) { ! EventLoop.get().dumpState(true); ! e.printStackTrace(); ! log.error("Error: Out of memory: " + e); } ! log.main("Shutdown"); System.exit(0); --- 60,91 ---- args = newArgs; } ! // Turn on assertions boolean assertsEnabled = false; assert assertsEnabled = true; if (!assertsEnabled) ! log.error("Please run the code with assertions turned on: java -ea ..."); ! // Turn on colour support ! ANSI.use(Boolean.valueOf(Config.getConfigProps().getProperty("sbon.console.ansi", "true"))); /* * Create the event loop */ ! EventLoop.set(new EventLoop(Long.valueOf(Config.getConfigProps().getProperty( ! "sbon.eventloop.statedump", "30000")), Boolean.valueOf(Config.getConfigProps().getProperty( ! "sbon.eventloop.showidle", "false")))); ! pyxida = new Pyxida(); pyxida.init(); ! try { ! EventLoop.get().main(); } catch (OutOfMemoryError e) { ! EventLoop.get().dumpState(true); ! e.printStackTrace(); ! log.error("Error: Out of memory: " + e); } ! log.main("Shutdown"); System.exit(0); |
|
From: Jonathan L. <le...@us...> - 2006-11-25 21:40:05
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3630/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Added Files: GossipRequestMsg.java GossipResponseMsg.java Log Message: objComm is looking for SBON code :( Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NCManager.java 21 Nov 2006 21:14:59 -0000 1.1 --- NCManager.java 25 Nov 2006 21:39:59 -0000 1.2 *************** *** 4,11 **** --- 4,17 ---- import java.util.Set; + import edu.harvard.syrah.pyxida.nc.lib.*; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.pyxida.nc.lib.NCClient; import edu.harvard.syrah.pyxida.ping.PingManager; import edu.harvard.syrah.sbon.comm.AddressIF; + import edu.harvard.syrah.sbon.comm.obj.*; + import edu.harvard.syrah.sbon.async.*; + import edu.harvard.syrah.sbon.async.CallbacksIF.*; + + // TODO add proxy coordinates public class NCManager { *************** *** 13,31 **** // TODO read from config file ! private static final int NC_NUM_DIMS = 3; private PingManager pingManager = null; private Set<NCClient<AddressIF>> ncClients = new HashSet<NCClient<AddressIF>>(); ! public NCManager(PingManager pingManager) { ! this.pingManager = pingManager; ! } public void init() { ! // Initialise the local coord first ! NCClient<AddressIF> localNCClient = new NCClient<AddressIF>(NC_NUM_DIMS); } } --- 19,102 ---- // TODO read from config file ! private static final int NC_NUM_DIMS = 5; ! // Height is set within NCClient and is the "last dimension" ! // of the coordinates array. ! // Thus, setting this to 5 is 4d+height if height is in use. ! // This allows the size on the wire to remain constant ! // which is important for Azureus integration. private PingManager pingManager = null; private Set<NCClient<AddressIF>> ncClients = new HashSet<NCClient<AddressIF>>(); + + final ObjCommIF comm; + final NCClient<AddressIF> localNCClient; ! public NCManager(ObjCommIF _comm, PingManager pingManager) { ! comm = _comm; ! this.pingManager = pingManager; ! // Initialise the local coord first ! localNCClient = new NCClient<AddressIF>(NC_NUM_DIMS); ! ! } public void init() { ! comm.registerMessageCB(GossipRequestMsg.class, new GossipHandler()); ! // TODO read in list of bootstrap neighbors from config file ! ! // TODO create timer to ping neighbors ! // and/or ask local client who it would like to ping + // Also ping for any proxy coordinates. + } + abstract class ResponseObjCommCB<T extends ObjMessageIF> extends ObjCommCB<T> { + + void sendResponseMessage (final String handler, final AddressIF remoteAddr, final ObjMessage response, long requestMsgId, final String errorMessage, final CB1<Boolean> cbHandled) { + + CBResult result = null; + if (errorMessage != null) { + log.debug(handler+ " :"+errorMessage); + result = CBResult.ERROR(errorMessage); + } else { + result = CBResult.OK(); + } + + comm.sendResponseMessage(response, remoteAddr, requestMsgId, new CB0() { + protected void cb(CBResult sendResult) { + switch (sendResult.state) { + case TIMEOUT: + case ERROR: { + log.warn(handler+": "+sendResult.what); + return; + } + } + }}); + cbHandled.call(CBResult.OK(), true); + } + } + + class GossipHandler extends ResponseObjCommCB<GossipRequestMsg> { + + public void cb(CBResult result, GossipRequestMsg msg, + AddressIF remoteAddr, Long ts, + final CB1<Boolean> cbHandled) { + log.debug ("in GossipHandler cb: "+msg); + + long curr_time = System.currentTimeMillis(); + + sendResponseMessage + ("Gossip", remoteAddr, + new GossipResponseMsg(localNCClient.getSystemCoords(), localNCClient.getSystemError(), localNCClient.getAge(curr_time), getGossipNodes(msg.coordinate)), + msg.getMsgId(), null, cbHandled); + + } + } + + Set<AddressIF> getGossipNodes (Coordinate remoteCoord) { + // TODO return coordinates, possibly based on this guy's coordinate + return null; + } + } --- NEW FILE: GossipResponseMsg.java --- package edu.harvard.syrah.pyxida.nc; import java.util.Set; import edu.harvard.syrah.sbon.comm.obj.ObjMessage; import edu.harvard.syrah.pyxida.nc.lib.*; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.sbon.comm.AddressIF; /** * Response to GossipRequestMsg. * Responds with the receiving node's current coordinate, confidence * and last update time. */ public class GossipResponseMsg extends ObjMessage { static final long serialVersionUID = 1000000001L; final Coordinate remoteCoordinate; final double remoteError; final long remoteAge; final Set<AddressIF> nodes; public GossipResponseMsg (Coordinate _remoteCoordinate, double _remoteError, long _remoteAge, Set<AddressIF> _nodes) { remoteCoordinate = _remoteCoordinate; remoteError = _remoteError; remoteAge = _remoteAge; nodes = _nodes; } } --- NEW FILE: GossipRequestMsg.java --- package edu.harvard.syrah.pyxida.nc; import java.util.Set; import edu.harvard.syrah.sbon.comm.obj.ObjMessage; import edu.harvard.syrah.pyxida.nc.lib.*; import edu.harvard.syrah.prp.Log; import edu.harvard.syrah.sbon.comm.AddressIF; /** * Requests the receiving node's current coordinate, confidence * and last update time. */ public class GossipRequestMsg extends ObjMessage { static final long serialVersionUID = 1000000001L; final Coordinate coordinate; final Set<AddressIF> nodes; /** * Creates a GossipRequestMsg * @param nodes * set of nodes sender is gossipping to receiver */ public GossipRequestMsg (Coordinate _coordinate, Set<AddressIF> _nodes) { coordinate = _coordinate; nodes = _nodes; } } |
|
From: Jonathan L. <le...@us...> - 2006-11-25 21:40:05
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3630/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: objComm is looking for SBON code :( Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Pyxida.java 24 Nov 2006 13:58:57 -0000 1.5 --- Pyxida.java 25 Nov 2006 21:39:59 -0000 1.6 *************** *** 12,15 **** --- 12,19 ---- import edu.harvard.syrah.sbon.async.CallbacksIF.CB0; + import edu.harvard.syrah.sbon.comm.AddressFactory; + import edu.harvard.syrah.sbon.comm.AddressIF; + import edu.harvard.syrah.sbon.comm.obj.*; + public class Pyxida { private static final Log log = new Log(Pyxida.class); *************** *** 26,33 **** --- 30,42 ---- private APIManager apiManager = null; private PingManager pingManager = null; + private ObjCommIF comm; private Pyxida() { /* empty */ } private void init() { + + // TODO not sure if this needs to be out here + // or can be pushed into NCManager + comm = new ObjComm(); // Initialise the measurement modules pingManager = new PingManager(); *************** *** 35,39 **** protected void cb(CBResult result) { // Initialise the NCs that we're responsible for ! ncManager = new NCManager(pingManager); ncManager.init(); --- 44,48 ---- protected void cb(CBResult result) { // Initialise the NCs that we're responsible for ! ncManager = new NCManager(comm,pingManager); ncManager.init(); |
|
From: Jonathan L. <le...@us...> - 2006-11-25 21:40:05
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3630/src/edu/harvard/syrah/pyxida/nc/lib Modified Files: Coordinate.java NCClient.java Log Message: objComm is looking for SBON code :( Index: Coordinate.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/lib/Coordinate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Coordinate.java 21 Nov 2006 21:14:59 -0000 1.1 --- Coordinate.java 25 Nov 2006 21:39:59 -0000 1.2 *************** *** 6,10 **** /* ! * NCLib - a network coordinate library * * This program is free software; you can redistribute it and/or modify it under --- 6,10 ---- /* ! * Pyxida - a network coordinate library * * This program is free software; you can redistribute it and/or modify it under Index: NCClient.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/lib/NCClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NCClient.java 21 Nov 2006 21:14:59 -0000 1.1 --- NCClient.java 25 Nov 2006 21:39:59 -0000 1.2 *************** *** 2,6 **** /* ! * NCLib - a network coordinate library * * This program is free software; you can redistribute it and/or modify it under --- 2,6 ---- /* ! * Pyxida - a network coordinate library * * This program is free software; you can redistribute it and/or modify it under *************** *** 39,43 **** * hosts that support Vivaldi. * ! * @author Michael Parker, Jonathan Ledlie * * @param <T> --- 39,43 ---- * hosts that support Vivaldi. * ! * @author Michael Parker, Jonathan Ledlie, Peter Pietzuch * * @param <T> |
|
From: Jonathan L. <le...@us...> - 2006-11-25 21:40:05
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3630/src/edu/harvard/syrah/pyxida/ping Modified Files: ICMPPinger.java PingManager.java Log Message: objComm is looking for SBON code :( Index: PingManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping/PingManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PingManager.java 23 Nov 2006 15:51:55 -0000 1.4 --- PingManager.java 25 Nov 2006 21:39:59 -0000 1.5 *************** *** 11,14 **** --- 11,15 ---- import edu.harvard.syrah.sbon.comm.AddressIF; + public class PingManager { private static final Log log = new Log(PingManager.class); *************** *** 41,44 **** } ! } --- 42,45 ---- } ! } Index: ICMPPinger.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/ping/ICMPPinger.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ICMPPinger.java 24 Nov 2006 13:58:57 -0000 1.8 --- ICMPPinger.java 25 Nov 2006 21:39:59 -0000 1.9 *************** *** 1,3 **** ! package edu.harvard.syrah.pyxida.ping; import jpcap.packet.EthernetPacket; --- 1,3 ---- ! package edu.harvard.syrah.pyxida.ping; import jpcap.packet.EthernetPacket; |
|
From: Jonathan L. <le...@us...> - 2006-11-25 19:47:07
|
Update of /cvsroot/pyxida/Pyxida/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26835 Modified Files: libjpcap.so Log Message: libjpcap was referencing a library that JL does not have Index: libjpcap.so =================================================================== RCS file: /cvsroot/pyxida/Pyxida/lib/libjpcap.so,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsUYHXYG and /tmp/cvs0yN44u differ |
|
From: Jonathan L. <le...@us...> - 2006-11-25 19:47:07
|
Update of /cvsroot/pyxida/Pyxida/lib/jpcap-0.5.1-lib/src/c In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26835/jpcap-0.5.1-lib/src/c Modified Files: Makefile libjpcap.so Log Message: libjpcap was referencing a library that JL does not have Index: libjpcap.so =================================================================== RCS file: /cvsroot/pyxida/Pyxida/lib/jpcap-0.5.1-lib/src/c/libjpcap.so,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsRkgYeQ and /tmp/cvs8o2LwE differ Index: Makefile =================================================================== RCS file: /cvsroot/pyxida/Pyxida/lib/jpcap-0.5.1-lib/src/c/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 17 Nov 2006 14:03:42 -0000 1.1 --- Makefile 25 Nov 2006 19:46:58 -0000 1.2 *************** *** 11,15 **** # Specify where pcap.h is ! PCAP_INCLUDE = /usr/include #PCAP_INCLUDE = /usr/include/pcap --- 11,15 ---- # Specify where pcap.h is ! PCAP_INCLUDE = /usr/local/include #PCAP_INCLUDE = /usr/include/pcap |