Examples of BSONFileRecordReader


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

Examples of com.mongodb.hadoop.input.BSONFileRecordReader

        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

Examples of com.mongodb.hadoop.input.BSONFileRecordReader

    @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

Examples of com.mongodb.hadoop.mapred.input.BSONFileRecordReader

        return false;
    }

    @Override
    public RecordReader getRecordReader(InputSplit split, JobConf job, Reporter reporter) throws IOException {
        BSONFileRecordReader reader = new BSONFileRecordReader(job, (FileSplit) split);
        return reader;
    }
View Full Code Here

Examples of com.mongodb.hadoop.mapred.input.BSONFileRecordReader

    }

    @Override
    public RecordReader<NullWritable, BSONWritable> getRecordReader(final InputSplit split, final JobConf job, final Reporter reporter)
        throws IOException {
        BSONFileRecordReader reader = new BSONFileRecordReader();
        reader.initialize(split, job);
        return reader;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.