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

          Josh Wills created issue -
          Josh Wills made changes -
          Field Original Value New Value
          Attachment MAPREDUCE-2633.patch [ 12484797 ]
          Jeff Hammerbacher made changes -
          Link This issue is related to MAPREDUCE-279 [ MAPREDUCE-279 ]
          Arun C Murthy made changes -
          Assignee Josh Wills [ jwills ]
          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!
          Sharad Agarwal made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Resolution Fixed [ 1 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          6d 13h 12m 1 Sharad Agarwal 07/Jul/11 07:27

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development