Skip to content
Snippets Groups Projects
Commit d54bb9cc authored by Kanzhe Jiang's avatar Kanzhe Jiang
Browse files

reset device ap's blocking algorithm computation on topology change.

parent b2222bd8
No related branches found
No related tags found
No related merge requests found
...@@ -46,8 +46,7 @@ public class DeviceAttachmentPoint { ...@@ -46,8 +46,7 @@ public class DeviceAttachmentPoint {
this.lastSeenInStorage = null; this.lastSeenInStorage = null;
this.lastWrittenToStorage = null; this.lastWrittenToStorage = null;
this.lastConflict = null; resetConflictState();
this.conflictFrequency = 0;
} }
public SwitchPortTuple getSwitchPort() { public SwitchPortTuple getSwitchPort() {
...@@ -138,6 +137,12 @@ public class DeviceAttachmentPoint { ...@@ -138,6 +137,12 @@ public class DeviceAttachmentPoint {
conflictFrequency += 100; conflictFrequency += 100;
} }
public void resetConflictState() {
lastConflict = null;
conflictFrequency = 0;
setBlocked(false);
}
public boolean isInConflict() { public boolean isInConflict() {
return lastConflict != null; return lastConflict != null;
} }
......
...@@ -1670,11 +1670,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1670,11 +1670,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
* Also make sure the attachmentPoints are in non-blocked state * Also make sure the attachmentPoints are in non-blocked state
*/ */
for (DeviceAttachmentPoint dap: tempAPMap.values()) { for (DeviceAttachmentPoint dap: tempAPMap.values()) {
dap.setBlocked(false); dap.resetConflictState();
} }
d.setAttachmentPoints(tempAPMap.values()); d.setAttachmentPoints(tempAPMap.values());
for (DeviceAttachmentPoint dap : tempOldAPMap.values()) { for (DeviceAttachmentPoint dap : tempOldAPMap.values()) {
dap.setBlocked(false); dap.resetConflictState();
d.addOldAttachmentPoint(dap); d.addOldAttachmentPoint(dap);
} }
......
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