You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2019/10/29 14:38:25 UTC
[nifi] 01/02: NIFI-6800 - Fix hashmap counter overwritten in
highThroughputSession
This is an automated email from the ASF dual-hosted git repository.
markap14 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
commit 67f1677212368290228b373fdbeb73f0265e2211
Author: Ivan Ezequiel Rodriguez <iv...@claro.com.ar>
AuthorDate: Wed Oct 23 10:07:05 2019 -0300
NIFI-6800 - Fix hashmap counter overwritten in highThroughputSession
This closes #3837.
Signed-off-by: Mark Payne <ma...@hotmail.com>
---
.../apache/nifi/controller/repository/StandardProcessSession.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
index c2502d3..5684ab6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
@@ -3381,7 +3381,11 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE
this.unacknowledgedFlowFiles.putAll(session.unacknowledgedFlowFiles);
if (session.countersOnCommit != null) {
- this.countersOnCommit.putAll(session.countersOnCommit);
+ if (this.countersOnCommit.isEmpty()) {
+ this.countersOnCommit.putAll(session.countersOnCommit);
+ } else {
+ session.countersOnCommit.forEach((key, value) -> this.countersOnCommit.merge(key, value, (v1, v2) -> v1 + v2));
+ }
}
if (session.immediateCounters != null) {