Class BenchmarkCounter


  • public class BenchmarkCounter
    extends Object
    Encapsulate counter operations, compatible with Hadoop1/2, mapred/mapreduce API
    • Constructor Detail

      • BenchmarkCounter

        public BenchmarkCounter()
    • Method Detail

      • initCounterFromContext

        public static void initCounterFromContext​(org.apache.hadoop.mapreduce.TaskAttemptContext context)
        Init counters in hadoop's mapreduce API, support both 1.x and 2.x
        Parameters:
        context - a task attempt context
      • initCounterFromReporter

        public static void initCounterFromReporter​(org.apache.hadoop.mapred.Reporter reporter,
                                                   org.apache.hadoop.conf.Configuration configuration)
        Init counters in hadoop's mapred API, which is used by cascading and Hive.
        Parameters:
        reporter - a reporter
        configuration - a configuration
      • incrementTotalBytes

        public static void incrementTotalBytes​(long val)
      • getTotalBytes

        public static long getTotalBytes()
      • incrementBytesRead

        public static void incrementBytesRead​(long val)
      • getBytesRead

        public static long getBytesRead()
      • incrementTime

        public static void incrementTime​(long val)
      • getTime

        public static long getTime()