Skip to content
Snippets Groups Projects
Commit abb2ff0e authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Always recompute topology upon link updates.

parent ce68c6ed
No related branches found
No related tags found
No related merge requests found
......@@ -106,11 +106,8 @@ public class TopologyManager implements
@Override
public void run() {
try {
boolean recomputeFlag = false;
recomputeFlag = applyUpdates();
if (recomputeFlag) {
createNewInstance();
}
applyUpdates();
createNewInstance();
lastUpdateTime = new Date();
informListeners();
}
......@@ -798,9 +795,8 @@ public class TopologyManager implements
}
public boolean applyUpdates() {
public void applyUpdates() {
boolean topologyRecomputeRequired = false;
appliedUpdates.clear();
LDUpdate update = null;
while (ldUpdates.peek() != null) {
......@@ -816,23 +812,18 @@ public class TopologyManager implements
addOrUpdateLink(update.getSrc(), update.getSrcPort(),
update.getDst(), update.getDstPort(),
update.getType());
topologyRecomputeRequired = true;
} else if (update.getOperation() == UpdateOperation.LINK_REMOVED){
removeLink(update.getSrc(), update.getSrcPort(),
update.getDst(), update.getDstPort());
topologyRecomputeRequired = true;
} else if (update.getOperation() == UpdateOperation.SWITCH_REMOVED) {
topologyRecomputeRequired = removeSwitch(update.getSrc());
removeSwitch(update.getSrc());
} else if (update.getOperation() == UpdateOperation.PORT_DOWN) {
topologyRecomputeRequired = removeSwitchPort(update.getSrc(),
update.getSrcPort());
removeSwitchPort(update.getSrc(), update.getSrcPort());
}
// Add to the list of applied updates.
appliedUpdates.add(update);
}
return topologyRecomputeRequired;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment