Sho SHIMIZU
Committed by Brian O'Connor

Change the return type of IntentAccumulator.reduce()

Change-Id: I31b57537c800e1599f19e4c0a4156db9df0406af
...@@ -20,6 +20,7 @@ import org.onlab.util.AbstractAccumulator; ...@@ -20,6 +20,7 @@ import org.onlab.util.AbstractAccumulator;
20 import org.onosproject.net.intent.IntentBatchDelegate; 20 import org.onosproject.net.intent.IntentBatchDelegate;
21 import org.onosproject.net.intent.IntentData; 21 import org.onosproject.net.intent.IntentData;
22 22
23 +import java.util.Collection;
23 import java.util.List; 24 import java.util.List;
24 import java.util.Map; 25 import java.util.Map;
25 import java.util.Timer; 26 import java.util.Timer;
...@@ -50,18 +51,17 @@ public class IntentAccumulator extends AbstractAccumulator<IntentData> { ...@@ -50,18 +51,17 @@ public class IntentAccumulator extends AbstractAccumulator<IntentData> {
50 51
51 @Override 52 @Override
52 public void processEvents(List<IntentData> ops) { 53 public void processEvents(List<IntentData> ops) {
53 - Map<String, IntentData> opMap = reduce(ops); 54 + delegate.execute(reduce(ops));
54 - delegate.execute(opMap.values());
55 // FIXME kick off the work 55 // FIXME kick off the work
56 //for (IntentData data : opMap.values()) {} 56 //for (IntentData data : opMap.values()) {}
57 } 57 }
58 58
59 - private Map<String, IntentData> reduce(List<IntentData> ops) { 59 + private Collection<IntentData> reduce(List<IntentData> ops) {
60 Map<String, IntentData> map = Maps.newHashMap(); 60 Map<String, IntentData> map = Maps.newHashMap();
61 for (IntentData op : ops) { 61 for (IntentData op : ops) {
62 map.put(op.key(), op); 62 map.put(op.key(), op);
63 } 63 }
64 //TODO check the version... or maybe store will handle this. 64 //TODO check the version... or maybe store will handle this.
65 - return map; 65 + return map.values();
66 } 66 }
67 } 67 }
......