public class GsonRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>
| Constructor and Description |
|---|
GsonRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the record reader.
|
org.apache.hadoop.io.LongWritable |
getCurrentKey()
Gets the current key.
|
com.google.gson.JsonObject |
getCurrentValue()
Gets the current value.
|
float |
getProgress()
Returns the current progress of the record reader through its data.
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Called once at initialization to initialize the RecordReader.
|
boolean |
nextKeyValue()
Reads the next key, value pair.
|
public void initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws java.io.IOException
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>genericSplit - the split that defines the range of records to read.context - the information about the task.java.io.IOException - on IO Error.public boolean nextKeyValue()
throws java.io.IOException
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>java.io.IOException - on IO Error.public org.apache.hadoop.io.LongWritable getCurrentKey()
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>public com.google.gson.JsonObject getCurrentValue()
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>public float getProgress()
throws java.io.IOException
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>java.io.IOException - on IO Error.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,com.google.gson.JsonObject>java.io.IOException - on IO Error.Copyright © 2019. All rights reserved.