Updating Intent Manager to deal with failures.
Added ids to Flow batch futures.
Adding some basic unit tests for IntentManger
Adding failedIds to the completedOperation in FlowRuleManager
Change-Id: I7645cead193299f70d319d254cd1e82d96909e7b
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentBatchQueue.java b/core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentBatchQueue.java
index 4c146d1..68cda00 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentBatchQueue.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/intent/impl/DistributedIntentBatchQueue.java
@@ -25,7 +25,6 @@
import org.onlab.onos.net.intent.IntentOperations;
import org.slf4j.Logger;
-import java.util.Collection;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
@@ -82,10 +81,17 @@
}
@Override
- public Set<IntentOperations> getIntentOperations() {
- Set<IntentOperations> set = Sets.newHashSet(currentBatches);
- set.addAll((Collection) pendingBatches);
- return set;
+ public Set<IntentOperations> getPendingOperations() {
+ synchronized (this) {
+ return Sets.newHashSet(pendingBatches);
+ }
+ }
+
+ @Override
+ public Set<IntentOperations> getCurrentOperations() {
+ synchronized (this) {
+ return Sets.newHashSet(currentBatches);
+ }
}
@Override