commit | 528069962255df38310f5fb6732ec67a933a4212 | [log] [tgz] |
---|---|---|
author | yoshi <yoshi@onlab.us> | Wed Nov 27 02:15:47 2013 -0800 |
committer | yoshi <yoshi@onlab.us> | Wed Nov 27 02:15:47 2013 -0800 |
tree | 47f771f76cf88051d549eb2b4ff1ec984bb5c3e9 | |
parent | 8bc311dd26a84b6fd5b70a38d71e9971b428d83d [diff] |
Optimized code
diff --git a/src/main/java/net/onrc/onos/graph/DBOperation.java b/src/main/java/net/onrc/onos/graph/DBOperation.java index f9b0e9f..1f77728 100644 --- a/src/main/java/net/onrc/onos/graph/DBOperation.java +++ b/src/main/java/net/onrc/onos/graph/DBOperation.java
@@ -116,9 +116,8 @@ } - @Override - public IDeviceObject newDevice() { - IDeviceObject obj = (IDeviceObject) conn.getFramedGraph().addVertex(null, IDeviceObject.class); + public IDeviceObject newDevice(final FramedGraph fg) { + IDeviceObject obj = (IDeviceObject) fg.addVertex(null, IDeviceObject.class); if (obj != null) { obj.setType("device"); }
diff --git a/src/main/java/net/onrc/onos/graph/RamCloudDBOperation.java b/src/main/java/net/onrc/onos/graph/RamCloudDBOperation.java index 9aa038a..8150e38 100644 --- a/src/main/java/net/onrc/onos/graph/RamCloudDBOperation.java +++ b/src/main/java/net/onrc/onos/graph/RamCloudDBOperation.java
@@ -138,4 +138,10 @@ public void close() { conn.close(); } + + @Override + public IDeviceObject newDevice() { + FramedGraph<RamCloudGraph> fg = conn.getFramedGraph(); + return super.newDevice(fg); + } }
diff --git a/src/main/java/net/onrc/onos/graph/TitanDBOperation.java b/src/main/java/net/onrc/onos/graph/TitanDBOperation.java index 02b8052..845fd46 100644 --- a/src/main/java/net/onrc/onos/graph/TitanDBOperation.java +++ b/src/main/java/net/onrc/onos/graph/TitanDBOperation.java
@@ -140,4 +140,11 @@ public void close() { conn.close(); } + + @Override + public IDeviceObject newDevice() { + FramedGraph<TitanGraph> fg = conn.getFramedGraph(); + return super.newDevice(fg); + } + } \ No newline at end of file