SHARE
TWEET

Untitled

a guest May 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static class WordMap
  2.        extends Mapper<Object, Text, Text, IntWritable>{
  3.  
  4.     private final static IntWritable one = new IntWritable(1);
  5.     private Text word = new Text();
  6.  
  7.     public void map(Object key, Text value, Context context
  8.                     ) throws IOException, InterruptedException {
  9.       StringTokenizer itr = new StringTokenizer(value.toString());
  10.       while (itr.hasMoreTokens()) {
  11.         word.set(itr.nextToken());
  12.         context.write(word, one);
  13.       }
  14.     }
  15.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top