commit | 13211801729d1376e79f2d66812a811f37c8eb0e | [log] [tgz] |
---|---|---|
author | Brian O'Connor <bocon@onlab.us> | Tue Feb 25 14:16:25 2014 -0800 |
committer | Gerrit Code Review <gerrit2@onos-services> | Tue Feb 25 14:16:25 2014 -0800 |
tree | ab7413eb25272cd2bfd01acb3f6fad06cb2c6221 | |
parent | c2f5cdda5e6c3982eff6e8fb3f0410f324bc503e [diff] | |
parent | 85dd8f20c5d4b3239a885723d26c095c6da23dfb [diff] |
Merge "Adding some measurement timestamps for PlanInstallModule" into dev/ramcloud-new-datamodel
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphLinksResource.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphLinksResource.java index a244dc1..16da940 100644 --- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphLinksResource.java +++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphLinksResource.java
@@ -31,10 +31,13 @@ mapper.registerModule(module); try { + graph.acquireReadLock(); return mapper.writeValueAsString(graph.getLinks()); } catch (IOException e) { log.error("Error writing link list to JSON", e); return ""; + } finally { + graph.releaseReadLock(); } } }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphSwitchesResource.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphSwitchesResource.java index 92e94f6..3e2a57c 100644 --- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphSwitchesResource.java +++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/web/NetworkGraphSwitchesResource.java
@@ -33,11 +33,13 @@ mapper.registerModule(module); try { + graph.acquireReadLock(); return mapper.writeValueAsString(graph.getSwitches()); } catch (IOException e) { log.error("Error writing switch list to JSON", e); return ""; + } finally { + graph.releaseReadLock(); } } - }