@PublicApi @ThreadSafe public final class KeyValueInputFormat extends org.apache.hadoop.mapreduce.InputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
org.apache.hadoop.mapred.InputFormat
for MapReduce programs to access
KeyValueSystem
.
It takes a KeyValueSystem
URI, and emits key-value pairs stored in the KeyValueStore to
org.apache.hadoop.mapred.Mapper
s.
Constructor and Description |
---|
KeyValueInputFormat()
Constructs a new
KeyValueInputFormat . |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable> |
createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) |
List<org.apache.hadoop.mapreduce.InputSplit> |
getSplits(org.apache.hadoop.mapreduce.JobContext jobContext)
Returns a list of
KeyValueInputSplit where each split is one key-value partition. |
public KeyValueInputFormat()
KeyValueInputFormat
.public List<org.apache.hadoop.mapreduce.InputSplit> getSplits(org.apache.hadoop.mapreduce.JobContext jobContext) throws IOException
KeyValueInputSplit
where each split is one key-value partition.getSplits
in class org.apache.hadoop.mapreduce.InputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
jobContext
- MapReduce job configurationInputSplit
s, each split is a partitionIOException
public org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable> createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) throws IOException
createRecordReader
in class org.apache.hadoop.mapreduce.InputFormat<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
IOException
Copyright © 2023. All Rights Reserved.