[ONOS-5683] Fix Intent throughput test regression
Change 12125 in gerrit is causing regression of intent throughput test. The
results of 3, 5 and 7 node cluster regressed about 25%. Single-node results
stay the same (see attachments). NO errors/warnings/exceptions observed in
the log.
The reason is using *compute* method in IntentStore, resolve it by using
other method instead of *compute* method.
Change-Id: I4a062e6c6d5e0898e2e5ac37b2e67a2875d16846
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
index 5acf8e9..6ccb629 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
@@ -295,13 +295,16 @@
// Remove the intent data from the pending map if the newData is more
// recent or equal to the existing entry. No matter if it is an acceptable
// update or not
- pendingMap.compute(newData.key(), (key, existingValue) -> {
- if (existingValue == null || !existingValue.version().isNewerThan(newData.version())) {
- return null;
- } else {
- return existingValue;
- }
- });
+ Key key = newData.key();
+ IntentData existingValue = pendingMap.get(key);
+
+ if (existingValue == null) {
+ return;
+ }
+
+ if (!existingValue.version().isNewerThan(newData.version())) {
+ pendingMap.remove(key, existingValue);
+ }
}
private Collection<NodeId> getPeerNodes(Key key, IntentData data) {