Yuta HIGUCHI
Committed by Yuta Higuchi

DistributedFlowRuleStore: always add FlowEntry on batchStore

related to ONOS-481

Change-Id: I9f82c7d9736dab7326062af9c38ae6e290a9b818
......@@ -417,12 +417,15 @@ public class DistributedFlowRuleStore
} else if (op.equals(FlowRuleOperation.ADD)) {
StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule);
DeviceId deviceId = flowRule.deviceId();
if (!flowEntries.containsEntry(deviceId, flowEntry)) {
flowEntries.put(deviceId, flowEntry);
Collection<StoredFlowEntry> ft = flowEntries.get(deviceId);
// always add requested FlowRule
// Note: 2 equal FlowEntry may have different treatment
ft.remove(flowEntry);
ft.add(flowEntry);
toAdd.add(batchEntry);
}
}
}
if (toAdd.isEmpty() && toRemove.isEmpty()) {
return Futures.immediateFuture(new CompletedBatchOperation(true, Collections.<FlowRule>emptySet()));
}
......