Merge pull request #538 from masayoshik/gui-fix
Old GUI fixes to show the number of switches and links
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
index e075bad..c3d7501 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -4,8 +4,6 @@
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.LinkedList;
-import java.util.List;
-
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.graph.GraphDBOperation;
@@ -221,7 +219,7 @@
flowEntryObj.setFlowEntryId(flowEntry.flowEntryId().toString());
flowEntryObj.setType("flow_entry");
- //
+ //
// Set the Flow Entry Edges and attributes:
// - Switch edge
// - InPort edge
@@ -373,24 +371,15 @@
* @return true on success, otherwise false.
*/
static boolean deleteAllFlows(GraphDBOperation dbHandler) {
- List<FlowId> allFlowIds = new LinkedList<FlowId>();
-
// Get all Flow IDs
Iterable<IFlowPath> allFlowPaths = dbHandler.getAllFlowPaths();
for (IFlowPath flowPathObj : allFlowPaths) {
if (flowPathObj == null)
continue;
- String flowIdStr = flowPathObj.getFlowId();
- if (flowIdStr == null)
- continue;
- FlowId flowId = new FlowId(flowIdStr);
- allFlowIds.add(flowId);
- }
- // Delete all flows one-by-one
- for (FlowId flowId : allFlowIds) {
- deleteFlow(dbHandler, flowId);
+ deleteIFlowPath(dbHandler, flowPathObj);
}
+ dbHandler.commit();
return true;
}
@@ -417,6 +406,18 @@
return true; // OK: No such flow
}
+ deleteIFlowPath(dbHandler, flowObj);
+ dbHandler.commit();
+ return true;
+ }
+
+ /**
+ * Delete a previously added flow.
+ * @note You need to call commit after calling this method.
+ * @param dbHandler the Graph Database handler to use.
+ * @param flowObj IFlowPath object to delete.
+ */
+ private static void deleteIFlowPath(GraphDBOperation dbHandler, IFlowPath flowObj) {
//
// Remove all Flow Entries
//
@@ -427,9 +428,6 @@
}
// Remove the Flow itself
dbHandler.removeFlowPath(flowObj);
- dbHandler.commit();
-
- return true;
}
/**
diff --git a/start-onos.sh b/start-onos.sh
index b1fed60..899cd34 100755
--- a/start-onos.sh
+++ b/start-onos.sh
@@ -19,6 +19,7 @@
## If you want JaCoCo Code Coverage reports... uncomment line below
#JVM_OPTS="$JVM_OPTS -javaagent:${ONOS_HOME}/lib/jacocoagent.jar=dumponexit=true,output=file,destfile=${LOGDIR}/jacoco.exec"
JVM_OPTS="$JVM_OPTS -server -d64"
+#JVM_OPTS="$JVM_OPTS -XX:+TieredCompilation -XX:InitialCodeCacheSize=512m -XX:ReservedCodeCacheSize=512m"
#JVM_OPTS="$JVM_OPTS -Xmx2g -Xms2g -Xmn800m"
JVM_OPTS="$JVM_OPTS -Xmx1g -Xms1g -Xmn800m"
#JVM_OPTS="$JVM_OPTS -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods"