My question has probably already been asked but I can not find a clear answer to my question.
My MapReduce is a basic WordCount. My current output file is :
// filename : 'part-r-00000'
789 a
755 #c
456 d
123 #b
How can I change the ouput filename ?
Then, is-it possible to have 2 output files :
// First output file
789 a
456 d
// Second output file
123 #b
755 #c
Here's my reduce class :
public static class SortReducer extends Reducer<IntWritable, Text, IntWritable, Text> {
public void reduce(IntWritable key, Text value, Context context) throws IOException, InterruptedException {
context.write(key, value);
}
}
Here's my Partitionner Class :
public class TweetPartitionner extends Partitioner<Text, IntWritable>{
@Override
public int getPartition(Text a_key, IntWritable a_value, int a_nbPartitions) {
if(a_key.toString().startsWith("#"))
return 1;
return 0;
}
}
Thanks a lot !