-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWholeFileInputFormat.java
More file actions
28 lines (24 loc) · 880 Bytes
/
Copy pathWholeFileInputFormat.java
File metadata and controls
28 lines (24 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package readfolderfiles;
import java.io.IOException;
import readfolderfiles.WholeFileRecordReader;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.fs.Path;
public class WholeFileInputFormat extends FileInputFormat<NullWritable, BytesWritable>
{
@Override
protected boolean isSplitable(JobContext context, Path filename)
{
return false;
}
@Override
public RecordReader<NullWritable, BytesWritable> createRecordReader(InputSplit split, TaskAttemptContext context)
{
return new WholeFileRecordReader();
}
}