Skip to content
Snippets Groups Projects
Commit 854b0d02 authored by Lei Xu's avatar Lei Xu
Browse files

fix concurrency issue in Statistics

parent bb4f8ea4
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ public class BandwidthResource extends ServerResource { ...@@ -70,7 +70,7 @@ public class BandwidthResource extends ServerResource {
//fix concurrency scenario //fix concurrency scenario
IOFSwitch sw = switchService.getSwitch(dpid); IOFSwitch sw = switchService.getSwitch(dpid);
if (sw == null){ if (sw == null){
return Collections.singletonMap("ERROR", "Switch was not online: " + dpid); return Collections.singletonMap("ERROR", "Switch was not online: " + dpid);
} }
for (OFPortDesc pd : sw.getPorts()) { /* do specific DPID; do all ports */ for (OFPortDesc pd : sw.getPorts()) { /* do specific DPID; do all ports */
SwitchPortBandwidth spb = statisticsService.getBandwidthConsumption(dpid, pd.getPortNo()); SwitchPortBandwidth spb = statisticsService.getBandwidthConsumption(dpid, pd.getPortNo());
......
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