K
- the type of the keys returned by the current CompositeInputFormat
V
- the type of the values returned by the current CompositeInputFormat
public class RecordInfoLoader<K,V>
extends java.lang.Object
A convenience class to read records as RecordInfo
instances from an InputSplit using the internalInputFormat of a CompositeInputFormat
implementation set as the current input format in the job configuration and the current RecordInfoProvider
.
Once an instance is created and its startLoading() it can be used as an iterator to read all the records from the given split
Constructor and Description |
---|
RecordInfoLoader(JobConf jobConf)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
finishLoading()
Finishes the current loading and closes any resource.
|
<any> |
getCurrReader() |
K |
getKey()
Gets the last read record's key
|
java.lang.String |
getLocationField() |
static java.lang.String |
getLocationField(RecordInfoProvider riProvider, Configuration conf) |
RecordInfoProvider<K,V> |
getRecordInfoProvider()
Gets an instance of the
RecordInfoProvider class currently set in the job configuration |
V |
getValue()
Gets the last read record's value
|
boolean |
hasNext() |
RecordInfo |
next() |
void |
remove() |
void |
startLoading(InputSplit split, Reporter reporter)
Prepares the loader to start reading records from the given split
|
public RecordInfoLoader(JobConf jobConf)
CompositeInputFormat
and RecordInfoProvider
jobConf
- the job configurationpublic void finishLoading()
public <any> getCurrReader()
public K getKey()
public java.lang.String getLocationField()
public static java.lang.String getLocationField(RecordInfoProvider riProvider, Configuration conf)
public RecordInfoProvider<K,V> getRecordInfoProvider()
RecordInfoProvider
class currently set in the job configurationpublic V getValue()
public boolean hasNext()
public RecordInfo next()
public void remove()
public void startLoading(InputSplit split, Reporter reporter) throws java.io.IOException
split
- the split where the data will be read fromreporter
- a reporter instancejava.io.IOException
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.