Skip to content
Snippets Groups Projects
Commit 4eb4e57c authored by Melanie Bruns's avatar Melanie Bruns
Browse files

Merge branch 'feature-#464-adapt-prophet' into 'master'

Fix prophet routing

See merge request !155
parents ba61acf7 2a50f619
No related branches found
No related tags found
1 merge request!155Fix prophet routing
Pipeline #
...@@ -12,6 +12,7 @@ import java.util.HashMap; ...@@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import core.BroadcastMessage;
import core.DataMessage; import core.DataMessage;
import core.MulticastMessage; import core.MulticastMessage;
import routing.util.DatabaseApplicationUtil; import routing.util.DatabaseApplicationUtil;
...@@ -285,8 +286,12 @@ public class ProphetRouter extends ActiveRouter { ...@@ -285,8 +286,12 @@ public class ProphetRouter extends ActiveRouter {
availableConnections.add(con); availableConnections.add(con);
for (Message m : msgCollection) { for (Message m : msgCollection) {
if (othRouter.hasMessage(m.getId())) { if (othRouter.hasMessage(m.getId()) || m instanceof BroadcastMessage) {
continue; // skip messages that the other one has // Ignore both messages that the other one has and all broadcast messages.
// (Broadcasts should be sent via exchangeDeliverableMessages.)
// The latter check may not be caught by the former because of caching (direct messages may be
// sent belatedly; see explanation at ActiveRouter#cachedMessagesForConnected.).
continue;
} }
if (othRouter.getPredFor(m) > getPredFor(m)) { if (othRouter.getPredFor(m) > getPredFor(m)) {
// the other node has higher probability of delivery // the other node has higher probability of delivery
......
  • Contributor

    SonarQube analysis reported 1 issue

    • 1 major
    1. Remove this unused private "getMaxPredFor" method. 📘
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment