Get flow summary now returns flows in order of FlowId, and we attempt to filter out null flows caused by empty vertices in Titan
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index 7283d09..1646fc7 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -140,10 +140,18 @@
}
@Override
- public Iterable<IFlowPath> getAllFlowPaths(GraphDBConnection conn) {
+ public Iterable<IFlowPath> getAllFlowPaths(GraphDBConnection conn) {
FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+ Iterable<IFlowPath> flowPaths = fg.getVertices("type", "flow", IFlowPath.class);
- return fg.getVertices("type", "flow", IFlowPath.class);
+ List<IFlowPath> nonNullFlows = new ArrayList<IFlowPath>();
+
+ for (IFlowPath fp: flowPaths) {
+ if (fp.getFlowId() != null) {
+ nonNullFlows.add(fp);
+ }
+ }
+ return nonNullFlows;
}
@Override