mongodb/mongo-hadoop — pull request #28 by muddydixon (2011-12-21 07:38:48+00:00)
Title: Develop/multipleinputs. 

This branch enables each to take query, fields, sort, limit and skip.
It gives us possibilities join multiple collection data.

* CAUTION: this improve needs to change Hadoop core.
change org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit.java "public class" hadoop-0.20.2-cdh3u2

```
− class TaggedInputSplit extends InputSplit implements Configurable, Writable {
+ public class TaggedInputSplit extends InputSplit implements Configurable, Writable {
```

* Usage

-----
```
public int run(String[] arg0) throws Exception {
Configuration conf = this.getConf();
MongoConfigUtil.setShardChunkSplittingEnabled(conf, true);
MongoConfigUtil.setReadSplitsFromShards(conf, false);
MongoConfigUtil.setReadSplitsFromSecondary(conf, true);

MongoConfigUtil.setOutputURI( conf, "mongodb://localhost:27017/multiple.myout");
Job job = new Job(conf, "multipleJob");

MongoMultipleInputs.addInputPath(job, "mongodb://localhost:27017/multiple.in1", MongoInputFormat.class, MultipleMapper.class);
MongoMultipleInputs.addInputPath(job, "mongodb://localhost:27017/multiple.in2", MongoInputFormat.class, MultipleMapper2.class);
MongoMultipleInputs.addInputPath(job, "mongodb://localhost:27017/multiple.in3", MongoInputFormat.class, MultipleMapper3.class);

log.info(job.getConfiguration().get("mongo.input.request"));
```