commit | d18c76255c2f95922bd592ca9c257c564158e270 | [log] [tgz] |
---|---|---|
author | Pankaj Berde <pankaj@onlab.us> | Mon Feb 04 10:28:35 2013 -0800 |
committer | Pankaj Berde <pankaj@onlab.us> | Mon Feb 04 10:28:35 2013 -0800 |
tree | d78503d404cf80e49e92e9b3ff7868d35d7d48e9 | |
parent | 82dcd98f4b063de3767632d9017cc72edfea3b42 [diff] |
Add finalize to clean up file handles to Titan
diff --git a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java index d0f0b9e..3aa1fc0 100644 --- a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java +++ b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java
@@ -248,7 +248,7 @@ @Override public Link compute(PathPipe<Vertex> pipe ) { - + // TODO Auto-generated method stub long s_dpid = 0; long d_dpid = 0; short s_port = 0; @@ -269,6 +269,16 @@ return l; } } + + public void finalize() { + close(); + } + + @Override + public void close() { + // TODO Auto-generated method stub + graph.shutdown(); + } }
diff --git a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/TopoLinkServiceImpl.java b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/TopoLinkServiceImpl.java index b73224e..2dbb338 100644 --- a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/TopoLinkServiceImpl.java +++ b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/TopoLinkServiceImpl.java
@@ -21,7 +21,8 @@ @Override public List<Link> GetActiveLinks() { // TODO Auto-generated method stub - return linkStore.getActiveLinks(); + List<Link> retval = linkStore.getActiveLinks(); + return retval; } @Override @@ -29,5 +30,4 @@ // TODO Auto-generated method stub return linkStore.getLinks(dpid); } - }