public abstract class AbstractPojoRecordReader<T> extends AbstractRecordReader implements Iterable<T>
| Modifier and Type | Field and Description |
|---|---|
protected List<T> |
records |
protected List<PojoWriter> |
writers |
DEFAULT_TEXT_COLS_TO_READALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPojoRecordReader(List<T> records) |
| Modifier and Type | Method and Description |
|---|---|
void |
allocate(Map<String,ValueVector> vectorMap) |
void |
close() |
protected abstract Object |
getFieldValue(T row,
int fieldPosition)
Retrieves field value to be written based for given row and field position.
|
protected PojoWriter |
initWriter(Class<?> type,
String fieldName,
OutputMutator output)
Creates writer based input class type and then initiates it.
|
Iterator<T> |
iterator() |
int |
next()
Increments this record reader forward, writing via the provided output
mutator into the output batch.
|
void |
setup(OperatorContext context,
OutputMutator output)
Configure the RecordReader with the provided schema and the record batch that should be written to.
|
protected abstract List<PojoWriter> |
setupWriters(OutputMutator output)
Setups writers for each field in the row.
|
getColumns, getDefaultColumnsToRead, isSkipQuery, isStarQuery, setColumns, toString, transformColumnsprotected List<PojoWriter> writers
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException
RecordReadersetup in interface RecordReadercontext - operator context for the readeroutput - The place where output for a particular scan should be written. The record reader is responsible for
mutating the set of schema values for that particular record.ExecutionSetupExceptionpublic int next()
RecordReadernext in interface RecordReaderpublic void allocate(Map<String,ValueVector> vectorMap) throws OutOfMemoryException
allocate in interface RecordReaderallocate in class AbstractRecordReaderOutOfMemoryExceptionpublic void close()
close in interface AutoCloseableprotected PojoWriter initWriter(Class<?> type, String fieldName, OutputMutator output) throws ExecutionSetupException
type - class typefieldName - field nameoutput - output mutatorExecutionSetupExceptionprotected abstract List<PojoWriter> setupWriters(OutputMutator output) throws ExecutionSetupException
output - output mutatorExecutionSetupExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.