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

Merge pull request #257 from sriniram/master

Always recompute topology upon link updates.	
parents e73130ef abb2ff0e
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();
}
......@@ -802,9 +799,8 @@ public class TopologyManager implements
}
public boolean applyUpdates() {
public void applyUpdates() {
boolean topologyRecomputeRequired = false;
appliedUpdates.clear();
LDUpdate update = null;
while (ldUpdates.peek() != null) {
......@@ -820,23 +816,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