Remove "suspended" member from FlowQueueTable.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowPusher.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowPusher.java
index 940620e..61d8277 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowPusher.java
@@ -9,6 +9,7 @@
import net.floodlightcontroller.core.FloodlightContext;
import net.floodlightcontroller.core.IOFSwitch;
+import net.onrc.onos.ofcontroller.flowmanager.FlowQueueTable.QueueState;
/**
* FlowPusher intermediates flow_mod sent from FlowManager/FlowSync to switches.
@@ -45,7 +46,7 @@
while (true) {
for (IOFSwitch sw : flowQueueTable.getSwitches()) {
// Skip if queue is suspended
- if (flowQueueTable.isQueueSusupended(sw)) {
+ if (flowQueueTable.getQueueState(sw) != QueueState.READY) {
continue;
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowQueueTable.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowQueueTable.java
index d3a6318..2ee51d7 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowQueueTable.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowQueueTable.java
@@ -19,9 +19,9 @@
public class FlowQueueTable {
public enum QueueState {
- SYNCHRONIZED,
- SYNCHRONIZING,
- DELETED; // not in work and to be deleted
+ READY, // Synchronized and working
+ SYNCHRONIZING, // Synchronization is running
+// SUSPENDED, // Synchronized but stopping sending messages
}
private class QueueInfo {
@@ -29,9 +29,6 @@
// Max rate of sending message (bytes/sec). 0 implies no limitation.
long max_rate = 0;
-
- // Is sending message suspended or not.
- boolean suspended = false;
}
private Map< IOFSwitch, Queue<OFMessage> > queues
@@ -142,46 +139,6 @@
}
/**
- * Suspend sending message of a queue for given switch.
- * @param sw
- */
- public void suspendQueue(IOFSwitch sw) {
- setQueueSuspended(sw, true);
- }
-
- /**
- * Resume sending message of a queue for given switch.
- * @param sw
- */
- public void resumeQueue(IOFSwitch sw) {
- setQueueSuspended(sw, false);
- }
-
- /**
- * Check if queue is suspended or not.
- * @param sw
- * @return
- */
- public boolean isQueueSusupended(IOFSwitch sw) {
- QueueInfo info = queue_info.get(sw);
- if (info == null) {
- // TODO error handling
- return true;
- }
-
- return info.suspended;
- }
-
- private void setQueueSuspended(IOFSwitch sw, boolean suspended) {
- QueueInfo info = queue_info.get(sw);
- if (info == null) {
- return;
- }
-
- info.suspended =suspended;
- }
-
- /**
* Get a lock for queue for given switch.
* If locked already, wait for unlock.
* @param sw