Package com.mongodb.hadoop.input

Examples of com.mongodb.hadoop.input.BSONFileRecordReader


public class BSONFileInputFormat extends FileInputFormat {

    @Override
    public RecordReader createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
        BSONFileRecordReader reader = new BSONFileRecordReader();
        reader.initialize(split, context);
        return reader;
    }
View Full Code Here


        mongoClient.close();
    }

    @Test
    public void mongoUpdateStorage() throws InterruptedException, TimeoutException, IOException {
        BSONFileRecordReader reader = new BSONFileRecordReader();
        File file = new File(PROJECT_HOME + "/pig/src/test/resources/dump/test/persons_info.bson");
        FileSplit split = new FileSplit(new Path(file.toURI()), 0L, file.length(), new String[0]);
        reader.initialize(split, new TaskAttemptContextImpl(new JobConf(), new TaskAttemptID()));
        while (reader.nextKeyValue()) {
            LOG.info(reader.getCurrentValue().toString());
        }
        runScript("update_simple_mus.pig");
    }
View Full Code Here

    @Override
    public RecordReader createRecordReader(final InputSplit split, final TaskAttemptContext context)
        throws IOException, InterruptedException {

        BSONFileRecordReader reader = new BSONFileRecordReader();
        reader.initialize(split, context);
        return reader;
    }
View Full Code Here

TOP

Related Classes of com.mongodb.hadoop.input.BSONFileRecordReader

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.