|
From: Jonathan L. <le...@us...> - 2006-12-08 16:52:17
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12784/src/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Log Message: progress with proxy coords Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NCManager.java 6 Dec 2006 22:56:24 -0000 1.25 --- NCManager.java 8 Dec 2006 16:52:09 -0000 1.26 *************** *** 133,137 **** if (!Pyxida.USE_ICMP) return "Proxy coords require ICMP"; if (addr2proxyClient.containsKey(remoteNode)) { ! String error = "Not creating proxy coord for "+remoteNode+ " because one already exists"; log.debug(error); --- 133,137 ---- if (!Pyxida.USE_ICMP) return "Proxy coords require ICMP"; if (addr2proxyClient.containsKey(remoteNode)) { ! String error = "Not creating proxy coord for "+remoteNode.toString(false)+ " because one already exists"; log.debug(error); *************** *** 141,145 **** addr2proxyClient.put(remoteNode,client); client.init(); ! String res = "Created proxy coord for"+remoteNode; log.debug(res); return res; --- 141,145 ---- addr2proxyClient.put(remoteNode,client); client.init(); ! String res = "Created proxy coord for "+remoteNode.toString(false); log.debug(res); return res; *************** *** 175,182 **** ProxyClient proxyCoord = addr2proxyClient.remove(remoteNode); if (proxyCoord == null) { ! String error = "No proxy coord for "+remoteNode+" found"; log.debug(error); return error; } return "Success"; } --- 175,183 ---- ProxyClient proxyCoord = addr2proxyClient.remove(remoteNode); if (proxyCoord == null) { ! String error = "No proxy coord for "+remoteNode.toString(false)+" found"; log.debug(error); return error; } + proxyCoord.expire(); return "Success"; } *************** *** 253,257 **** case TIMEOUT: case ERROR: { ! String error = "Coord request to "+nodeB+" failed:"+ resultB.toString(); log.warn(error); cbDistance.call(resultB, new Double(0), error); --- 254,259 ---- case TIMEOUT: case ERROR: { ! String error = "Coord request to "+nodeB.toString(false) ! +" failed:"+ resultB.toString(); log.warn(error); cbDistance.call(resultB, new Double(0), error); *************** *** 265,269 **** case TIMEOUT: case ERROR: { ! String error = "Coord request to "+nodeA+" failed:"+ resultA.toString(); cbDistance.call(resultA, new Double(0), error); break; --- 267,272 ---- case TIMEOUT: case ERROR: { ! String error = "Coord request to "+nodeA.toString(false) ! +" failed:"+ resultA.toString(); cbDistance.call(resultA, new Double(0), error); break; *************** *** 312,316 **** AddressIF remoteAddr, Long ts, final CB1<Boolean> cbHandled) { ! log.debug("in GossipHandler cb: " + msg); // we just heard from him so we know he is up addUpNeighbor(remoteAddr); --- 315,319 ---- AddressIF remoteAddr, Long ts, final CB1<Boolean> cbHandled) { ! log.debug("in GossipHandler cb"); // we just heard from him so we know he is up addUpNeighbor(remoteAddr); *************** *** 469,473 **** public CoordClient() { ! log.warn("coordclient ctor"); nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); --- 472,476 ---- public CoordClient() { ! log.debug("Making a CoordClient"); nc = new NCClient<AddressIF>(NCManager.NC_NUM_DIMS); *************** *** 614,617 **** --- 617,624 ---- void update() { + if (hasExpired()) { + return; + } + registerTimer(); final AddressIF neighbor = pickGossipNode(); *************** *** 660,664 **** // prp: Don't know but if you want to clone it, use the copy constructor addr = AddressFactory.create(_addr); ! log.warn("proxyclient ctor "+addr); } --- 667,671 ---- // prp: Don't know but if you want to clone it, use the copy constructor addr = AddressFactory.create(_addr); ! log.debug("Making a ProxyClient "+addr); } *************** *** 674,679 **** --- 681,691 ---- } + public void expire () { + lease = 0; + } + public boolean hasExpired() { if (System.currentTimeMillis() > lease) { + log.debug("ProxyClient "+addr+" has expired"); return true; } |