Hadoop Common
  1. Hadoop Common
  2. HADOOP-1915

adding counters methods using String (as opposed to Enum)


    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.18.0
    • Component/s: None
    • Labels:
    • Environment:


    • Hadoop Flags:
    • Release Note:
      Provided a new method to update counters. "incrCounter(String group, String counter, long amount)"


      Currently to use the counters from within Map/Reduce code Enums have to be used, the Enum class defines the group and the Enum itself the counter. Internally they are converted to Strings (the class name and the enum toString) and you can retrieve them as strings from the client API.

      Using dynamic counters (driven by configuration of the map/reduce) is not easy with the counters Enum based API. For example, currently I have an Enum class with 50 enums and we have to map the cardinality to the counter name on the client. This is cumbersome.

      This could be easily improve by adding a String based counter method increment(String group, String counter, long count) to allow use of the counters without Enums.

      Internally this method already exists, so the changes are minimal.

      1. hadoop-1915.patch
        10 kB
        Tom White
      2. hadoop-1915-v10.patch
        17 kB
        Tom White
      3. hadoop-1915-v2.patch
        10 kB
        Tom White
      4. hadoop-1915-v3.patch
        10 kB
        Tom White
      5. hadoop-1915-v4.patch
        13 kB
        Tom White
      6. hadoop-1915-v5.patch
        13 kB
        Tom White
      7. hadoop-1915-v6.patch
        13 kB
        Tom White
      8. hadoop-1915-v7.patch
        13 kB
        Owen O'Malley
      9. hadoop-1915-v8.patch
        13 kB
        Tom White
      10. hadoop-1915-v9.patch
        13 kB
        Tom White

        Issue Links



            • Assignee:
              Tom White
              Alejandro Abdelnur
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: