Package com.mongodb.hadoop.splitter

Examples of com.mongodb.hadoop.splitter.MongoSplitter


    @Override
    public FileSplit[] getSplits(final JobConf conf, final int numSplits)
        throws IOException {

        try {
            MongoSplitter splitterImpl = MongoSplitterFactory.getSplitter(conf);
            final List<org.apache.hadoop.mapreduce.InputSplit> splits =
                splitterImpl.calculateSplits();
            InputSplit[] splitIns = splits.toArray(new InputSplit[splits.size()]);

            // wrap InputSplits in FileSplits so that 'getPath'
            // doesn't produce an error (Hive bug)
            FileSplit[] wrappers = new FileSplit[splitIns.length];
View Full Code Here


        return new MongoRecordReader(mis);
    }

    public InputSplit[] getSplits(final JobConf job, final int numSplits) throws IOException {
        try {
            MongoSplitter splitterImpl = MongoSplitterFactory.getSplitter(job);
            LOG.info("Using " + splitterImpl + " to calculate splits. (old mapreduce API)");
            final List<org.apache.hadoop.mapreduce.InputSplit> splits = splitterImpl.calculateSplits();
            return splits.toArray(new InputSplit[splits.size()]);
        } catch (SplitFailedException spfe) {
            throw new IOException(spfe);
        }
    }
View Full Code Here

    @Override
    public List<InputSplit> getSplits(final JobContext context) throws IOException {
        final Configuration conf = context.getConfiguration();
        try {
            MongoSplitter splitterImpl = MongoSplitterFactory.getSplitter(conf);
            LOG.debug("Using " + splitterImpl.toString() + " to calculate splits.");
            return splitterImpl.calculateSplits();
        } catch (SplitFailedException spfe) {
            throw new IOException(spfe);
        }
    }
View Full Code Here

TOP

Related Classes of com.mongodb.hadoop.splitter.MongoSplitter

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.