This is an automated email from the ASF dual-hosted git repository. madhan pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/atlas.git
commit f1297e34f4d0675ab23b531ad3dc9549381ea0bc Author: Ashutosh Mestry <[email protected]> AuthorDate: Fri May 15 11:49:51 2020 -0700 ATLAS-3796: Status Reporter display fix. (cherry picked from commit 935d0ab6465775e16db62896375d96f6a567b884) --- intg/src/main/java/org/apache/atlas/pc/StatusReporter.java | 10 +++++++++- intg/src/test/java/org/apache/atlas/pc/StatusReporterTest.java | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/intg/src/main/java/org/apache/atlas/pc/StatusReporter.java b/intg/src/main/java/org/apache/atlas/pc/StatusReporter.java index 7baf973..507e842 100644 --- a/intg/src/main/java/org/apache/atlas/pc/StatusReporter.java +++ b/intg/src/main/java/org/apache/atlas/pc/StatusReporter.java @@ -98,7 +98,7 @@ public class StatusReporter<T, U> { private U acknowledged(Map.Entry<T, U> lookFor) { U ack = lookFor.getValue(); producedItems.remove(lookFor.getKey()); - processedSet.remove(lookFor); + processedSet.remove(lookFor.getKey()); return ack; } @@ -107,4 +107,12 @@ public class StatusReporter<T, U> { lastAck = System.currentTimeMillis(); return b; } + + public int getProducedCount() { + return this.producedItems.size(); + } + + public int getProcessedCount() { + return this.processedSet.size(); + } } diff --git a/intg/src/test/java/org/apache/atlas/pc/StatusReporterTest.java b/intg/src/test/java/org/apache/atlas/pc/StatusReporterTest.java index 45bdbb0..a0c399b 100644 --- a/intg/src/test/java/org/apache/atlas/pc/StatusReporterTest.java +++ b/intg/src/test/java/org/apache/atlas/pc/StatusReporterTest.java @@ -82,6 +82,9 @@ public class StatusReporterTest { extractResults(wi, statusReporter); assertEquals(statusReporter.ack().intValue(), (maxItems - 1)); wi.shutdown(); + + assertEquals(statusReporter.getProducedCount(), 0); + assertEquals(statusReporter.getProcessedCount(), 0); } private void extractResults(WorkItemManager<Integer, WorkItemConsumer> wi, StatusReporter<Integer, Integer> statusReporter) {
