AbstractChordNode returning the wrong neighbors

Home Forums PeerfactSim Forum AbstractChordNode returning the wrong neighbors

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #954
    Dennis
    Guest

    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.

    #955
    Kalman
    Guest

    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.

    #956
    Thim Strothmann
    Guest

    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();
    }
    };

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Comments are closed.