AbstractChordNode returning the wrong neighbors

11 views
Skip to first unread message

Dennis

unread,
Dec 11, 2011, 7:50:08 PM12/11/11
to PeerfactSim.KOM
While trying to understand the ReplicationDHTService I noticed that
the neighbors set of a ChordNode obtained through the getNeighbors()
(AbstractChordNode) method was always empty. The ChordNode class has
it's own routingTable variable which hides the routingTable variable
of the AbstractChordNode class. The routingTable variable of the
AbstractChordNode class remains null throughout the simulation. But
the getNeighbors() method in the AbstractChordNode class looks like
this:

public INeighborDeterminator getNeighbors() {
return new INeighborDeterminator() {

@Override
public Collection<OverlayContact> getNeighbors() {
if (routingTable == null)
return Collections.emptySet();
return routingTable.getNeighbors();
}
};
}

The new INeighborDeterminator will always return an empty set since
the routingTable variable is not used by the ChordNode class. I think
this problem could be resolved by using the getter for the routing
table. This way it is possible to get content of the routingTable
variable of the ChordNode class.
Am I right that the current implementation is wrong?
Does anybody see any issues with my proposed fix for this problem?

I'm talking about the ChordNode class from the package
de.tud.kom.p2psim.impl.overlay.dht.chord.chord.components.

Kalman

unread,
Dec 15, 2011, 5:55:23 AM12/15/11
to PeerfactSim.KOM
Sorry for the late answer,

the problem seems to exist and your workaround helps.
Good point, you idea will be included in the next version of the
simulator.

Thim Strothmann

unread,
Dec 15, 2011, 8:11:05 AM12/15/11
to PeerfactSim.KOM
For everybody who has the same problem as Dennis (not everybody should
run into this problem), here the work-around, just replace the method
Dennis mentioned with the following one:


public INeighborDeterminator getNeighbors() {
return new INeighborDeterminator() {

@Override
public Collection<OverlayContact> getNeighbors() {

if (getChordRoutingTable() == null)
return Collections.emptySet();
return getChordRoutingTable().getNeighbors();
}
};

Reply all
Reply to author
Forward
0 new messages