hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "howard chen" <howac...@gmail.com>
Subject How can I get the current file name in the Map function of WC example?
Date Sun, 10 Dec 2006 14:19:35 GMT
for example, in the Word Count example....

 public void map(WritableComparable key, Writable value,
        OutputCollector output,
        Reporter reporter) throws IOException {
      String line = ((Text)value).toString();
      StringTokenizer itr = new StringTokenizer(line);
      while (itr.hasMoreTokens()) {
        output.collect(word, one);

How can I get the file name of value belong to?


View raw message