Package com.mongodb.hadoop

Examples of com.mongodb.hadoop.MongoConfig


        return new MongoRecordReader(mis);
    }

    public InputSplit[] getSplits(JobConf job, int numSplits) {
        final MongoConfig conf = new MongoConfig(job);
        // TODO - Support allowing specification of numSplits to affect our ops?
        final List<org.apache.hadoop.mapreduce.InputSplit> splits = MongoSplitter.calculateSplits( conf );
        // TODO - Make me less egregiously inefficient.
        InputSplit[] classicSplits = new InputSplit[splits.size()];
        for ( int i = 0; i < splits.size(); i++ ) {
View Full Code Here


    public BookstoreConfig() {
        this(new Configuration());
    }

    public BookstoreConfig(final Configuration configuration) {
        MongoConfig config = new MongoConfig(configuration);
        setConf(configuration);

        config.setInputFormat(MongoInputFormat.class);

        config.setMapper(TagsMapper.class);
        config.setMapperOutputKey(Text.class);
        config.setMapperOutputValue(BSONWritable.class);

        config.setReducer(TagsReducer.class);
        config.setOutputKey(Text.class);
        config.setOutputValue(MongoUpdateWritable.class);
        config.setOutputFormat(MongoOutputFormat.class);
    }
View Full Code Here

       
                    "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");
    }
View Full Code Here

TOP

Related Classes of com.mongodb.hadoop.MongoConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.