Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Add type types for extends FileInputFormat on BSONFileInputFormat #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.util.ReflectionUtils;
import org.bson.BSONObject;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


public class BSONFileInputFormat extends FileInputFormat {
public class BSONFileInputFormat extends FileInputFormat<NullWritable, BSONObject> {

private static final Log LOG = LogFactory.getLog(BSONFileInputFormat.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
import org.apache.hadoop.mapred.JobContext;
import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter;
import org.bson.BSONObject;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import static java.lang.String.format;

public class BSONFileInputFormat extends FileInputFormat {
public class BSONFileInputFormat extends FileInputFormat<NullWritable, BSONObject> {

protected boolean isSplitable(final JobContext context, final Path filename) {
return true;
Expand Down