hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lei liu <liulei...@gmail.com>
Subject use counter to statistics file row number
Date Thu, 20 Jan 2011 02:38:55 GMT
I use counter to statistics  file row number in Mapper, example below code:

public void map(LongWritable key, Text value,
            OutputCollector<Text, IntWritable> output, Reporter reporter)
            throws IOException {

        try {

            reporter.incrCounter("row", "num", 1);

        } catch (Throwable e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

Could everyone tell me whether there are any risks do so?


Thanks,

LiuLei

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message