Speed up flow installation
diff --git a/src/main/java/net/onrc/onos/util/GraphDBConnection.java b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
index 4d23b0d..d5fe4c6 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBConnection.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
@@ -68,6 +68,10 @@
graph.createKeyIndex("flow_entry_id",
Vertex.class);
}
+ if (!s.contains("switch_state")) {
+ graph.createKeyIndex("switch_state",
+ Vertex.class);
+ }
graph.stopTransaction(Conclusion.SUCCESS);
eg = new EventTransactionalGraph<TitanGraph>(graph);
}
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index 7ed51b9..2dac008 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -194,6 +194,13 @@
return fg.getVertices("type", "flow_entry", IFlowEntry.class);
}
+
+ @Override
+ public Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries(GraphDBConnection conn) {
+ FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+ //TODO: Should use an enum for flow_switch_state
+ return fg.getVertices("switch_state", "FE_SWITCH_NOT_UPDATED", IFlowEntry.class);
+ }
@Override
public Iterable<ISwitchObject> getActiveSwitches(GraphDBConnection conn) {
diff --git a/src/main/java/net/onrc/onos/util/IDBUtils.java b/src/main/java/net/onrc/onos/util/IDBUtils.java
index 51948a2..4aa8168 100644
--- a/src/main/java/net/onrc/onos/util/IDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/IDBUtils.java
@@ -37,4 +37,6 @@
ISwitchObject newSwitch(GraphDBConnection conn);
void removePort(GraphDBConnection conn, IPortObject port);
void removeSwitch(GraphDBConnection conn, ISwitchObject sw);
+ Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries(
+ GraphDBConnection conn);
}