"mongo.output.uri=mongodb://localhost:27017/mongo_hadoop.message_pairs",
"mongo.job.output.format=com.mongodb.hadoop.MongoOutputFormat"
*/
Configuration conf = new Configuration();
MongoConfig config = new MongoConfig(conf);
setConf(conf);
if (MongoTool.isMapRedV1()) {
MapredMongoConfigUtil.setInputFormat(getConf(), com.mongodb.hadoop.mapred.MongoInputFormat.class);
MapredMongoConfigUtil.setOutputFormat(getConf(), com.mongodb.hadoop.mapred.MongoOutputFormat.class);
} else {
MongoConfigUtil.setInputFormat(getConf(), MongoInputFormat.class);
MongoConfigUtil.setOutputFormat(getConf(), MongoOutputFormat.class);
}
config.setInputURI("mongodb://localhost:27017/mongo_hadoop.messages");
config.setMapper(EnronMailMapper.class);
config.setReducer(EnronMailReducer.class);
config.setMapperOutputKey(MailPair.class);
config.setMapperOutputValue(IntWritable.class);
config.setOutputKey(MailPair.class);
config.setOutputValue(IntWritable.class);
config.setOutputURI("mongodb://localhost:27017/mongo_hadoop.message_pairs");
}