|
From: Jonathan L. <le...@us...> - 2008-12-18 22:43:57
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30573/edu/harvard/syrah/pyxida/nc Modified Files: NCManager.java Log Message: first pass on integrating erics changes which make neighbor set more stable Index: NCManager.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/nc/NCManager.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** NCManager.java 27 Mar 2008 18:33:01 -0000 1.41 --- NCManager.java 18 Dec 2008 21:49:51 -0000 1.42 *************** *** 16,19 **** --- 16,21 ---- * limitations under the License. */ + + package edu.harvard.syrah.pyxida.nc; *************** *** 142,145 **** --- 144,148 ---- public void printStats() { log.info("coord=" + localNC.primaryNC + " " + summarizeNeighbors()); + log.info(localNC.primaryNC.printNeighbors()); } *************** *** 724,741 **** } AddressIF pickGossipNode() { AddressIF neighbor; ! // LOWTODO ask our ncClient if it has a preferred gossip node ! // if not, use somebody from our neighbor set ! neighbor = getUpNeighbor(); ! if (neighbor == null) { ! resetBootstrapNeighbors(); neighbor = getUpNeighbor(); } //assert (neighbor != null) : "Could not find a bootstrap neighbour"; return neighbor; } - } --- 727,759 ---- } + // Note that primaryNC and secondaryNC are using the same set of ping neighbors + // (drawn from primary's suggestions) + AddressIF pickGossipNode() { AddressIF neighbor; ! // ask our ncClient if it has a preferred gossip node ! if (localNC.primaryNC.stabilized() && localNC.primaryNC.neighborsFull()) { ! log.info("NCManager - stabilized and full"); ! neighbor = localNC.primaryNC.getNeighborToPing(System.currentTimeMillis()); ! if (neighbor == null) { ! log.info("NCManager - stabilized and full but null neighbor"); ! neighbor = getUpNeighbor(); ! if (neighbor == null) { ! resetBootstrapNeighbors(); ! neighbor = getUpNeighbor(); ! } ! } ! } else { ! // if not, use somebody from our neighbor set neighbor = getUpNeighbor(); + if (neighbor == null) { + resetBootstrapNeighbors(); + neighbor = getUpNeighbor(); + } } //assert (neighbor != null) : "Could not find a bootstrap neighbour"; return neighbor; } } |