[
https://issues.apache.org/jira/browse/MAPREDUCE-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045107#comment-13045107
]
Todd Lipcon commented on MAPREDUCE-2557:
----------------------------------------
Hi William. Thanks for the bug report. Two things:
- a silly nit: can you use "1L" and "2L" instead of "1l" and "2l" in the tests?
I was staring at it for 5 minutes before I realized those were 'l' ("ell") and
not '1' ("one").
- what ramifications, if any, does this have on the MR framework itself? Would
this cause incorrect counters in any usual use case? How'd you come across the
bug?
> Counters don't reset state when readFields() called
> ---------------------------------------------------
>
> Key: MAPREDUCE-2557
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-2557
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: William Slacum
> Priority: Trivial
> Attachments: MAPREDUCE-2557.patch
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> When calling readFields() on a Counters object, the internal state is not
> completely reset. The IdentityHashMap<Enum<?>, Counter> cache retains all
> previous mappings, even after the actual CounterGroups are changed. Using the
> same Counters pointer over and over again results in the cache always keeping
> the mapping for the first call to getCounter(Enum<?>). I've add a clear()
> call to the cache when readFields() is called and added a unit test to verify
> that it works.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira