Commit 935d0ab6 by Ashutosh Mestry

ATLAS-3796: Status Reporter display fix.

parent d8cb94ac
...@@ -98,7 +98,7 @@ public class StatusReporter<T, U> { ...@@ -98,7 +98,7 @@ public class StatusReporter<T, U> {
private U acknowledged(Map.Entry<T, U> lookFor) { private U acknowledged(Map.Entry<T, U> lookFor) {
U ack = lookFor.getValue(); U ack = lookFor.getValue();
producedItems.remove(lookFor.getKey()); producedItems.remove(lookFor.getKey());
processedSet.remove(lookFor); processedSet.remove(lookFor.getKey());
return ack; return ack;
} }
...@@ -107,4 +107,12 @@ public class StatusReporter<T, U> { ...@@ -107,4 +107,12 @@ public class StatusReporter<T, U> {
lastAck = System.currentTimeMillis(); lastAck = System.currentTimeMillis();
return b; return b;
} }
public int getProducedCount() {
return this.producedItems.size();
}
public int getProcessedCount() {
return this.processedSet.size();
}
} }
...@@ -82,6 +82,9 @@ public class StatusReporterTest { ...@@ -82,6 +82,9 @@ public class StatusReporterTest {
extractResults(wi, statusReporter); extractResults(wi, statusReporter);
assertEquals(statusReporter.ack().intValue(), (maxItems - 1)); assertEquals(statusReporter.ack().intValue(), (maxItems - 1));
wi.shutdown(); wi.shutdown();
assertEquals(statusReporter.getProducedCount(), 0);
assertEquals(statusReporter.getProcessedCount(), 0);
} }
private void extractResults(WorkItemManager<Integer, WorkItemConsumer> wi, StatusReporter<Integer, Integer> statusReporter) { private void extractResults(WorkItemManager<Integer, WorkItemConsumer> wi, StatusReporter<Integer, Integer> statusReporter) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment