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

Merge pull request #79 from kjiang/master

reset device AP conflict algorithm computation after topology changes
parents b2222bd8 d54bb9cc
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