Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2633

MR-279: Add a getCounter(Enum) method to the Counters interface

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mrv2
    • Labels:
      None
    • Environment:

      All

    • Hadoop Flags:
      Reviewed

      Description

      I'm fixing a few TODOs I came across in TaskAttemptImpl.java related to the fact that the MRv2 Counters interface don't expose a getCounter(Enum) method for accessing a Counter using the enum's class as the group name and the enum's value as the name of the counter.

      Will add the patch momentarily.

        Issue Links

          Activity

          Hide
          Arun C Murthy added a comment -

          The patch looks fine, thanks Josh!

          Sharad could you please take a quick look too?

          One thing - there was some talk of deprecating Counters.getCounter(Enum) in favour of Counters.getCounter(String). I need to refresh my memory, in which case we might deprecate the one added by Josh right-away. Thoughts?

          Show
          Arun C Murthy added a comment - The patch looks fine, thanks Josh! Sharad could you please take a quick look too? One thing - there was some talk of deprecating Counters.getCounter(Enum) in favour of Counters.getCounter(String). I need to refresh my memory, in which case we might deprecate the one added by Josh right-away. Thoughts?
          Hide
          Josh Wills added a comment -

          Thanks Arun-- re: Counters.getCounter(String), I'd be happy to implement the API that way- what are the semantics of the String?

          Show
          Josh Wills added a comment - Thanks Arun-- re: Counters.getCounter(String), I'd be happy to implement the API that way- what are the semantics of the String?
          Hide
          Sharad Agarwal added a comment -

          currently org/apache/hadoop/mapreduce/v2/api/records/Counters.java is used only internally. its ok go with Enum.

          +1

          Show
          Sharad Agarwal added a comment - currently org/apache/hadoop/mapreduce/v2/api/records/Counters.java is used only internally. its ok go with Enum. +1
          Hide
          Sharad Agarwal added a comment -

          I just committed this. Thanks Josh!

          Show
          Sharad Agarwal added a comment - I just committed this. Thanks Josh!

            People

            • Assignee:
              Josh Wills
              Reporter:
              Josh Wills
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development