public class HoodieKeyBasedFileGroupRecordBuffer<T> extends HoodieBaseFileGroupRecordBuffer<T>
HoodieMergedLogRecordReader
by calling the processDataBlock(org.apache.hudi.common.table.log.block.HoodieDataBlock, org.apache.hudi.common.util.Option<org.apache.hudi.common.table.log.KeySpec>) and processDeleteBlock(org.apache.hudi.common.table.log.block.HoodieDeleteBlock) methods into a record key based map.
The records from the base file is accessed from an iterator object. These records are merged when the
HoodieBaseFileGroupRecordBuffer.hasNext() method is called.HoodieFileGroupRecordBuffer.BufferTypebaseFileIterator, enablePartialMerging, hoodieTableMetaClient, internalSchema, logRecordIterator, nextRecord, partitionNameOverrideOpt, partitionPathFieldOpt, props, readerContext, readerSchema, recordMergeMode, recordMerger, records| Constructor and Description |
|---|
HoodieKeyBasedFileGroupRecordBuffer(HoodieReaderContext<T> readerContext,
HoodieTableMetaClient hoodieTableMetaClient,
Option<String> partitionNameOverrideOpt,
Option<String[]> partitionPathFieldOpt,
HoodieRecordMerger recordMerger,
TypedProperties props) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsLogRecord(String recordKey)
Check if a record exists in the buffered records.
|
protected boolean |
doHasNext()
This allows hasNext() to be called multiple times without incrementing the iterator by more than 1
record.
|
HoodieFileGroupRecordBuffer.BufferType |
getBufferType() |
protected boolean |
hasNextBaseRecord(T baseRecord) |
void |
processDataBlock(HoodieDataBlock dataBlock,
Option<KeySpec> keySpecOpt)
Process a log data block, and store the resulting records into the buffer.
|
void |
processDeleteBlock(HoodieDeleteBlock deleteBlock)
Process a log delete block, and store the resulting records into the buffer.
|
void |
processNextDataRecord(T record,
Map<String,Object> metadata,
Serializable recordKey)
Process a next record in a log data block.
|
void |
processNextDeletedRecord(DeleteRecord deleteRecord,
Serializable recordKey)
Process next delete record.
|
close, composeEvolvedSchemaTransformer, doProcessNextDataRecord, doProcessNextDeletedRecord, getLogRecordIterator, getLogRecords, getRecordsIterator, getSchemaTransformerWithEvolvedSchema, hasNext, hasNextBaseRecord, hasNextLogRecord, merge, next, setBaseFileIterator, sizepublic HoodieKeyBasedFileGroupRecordBuffer(HoodieReaderContext<T> readerContext, HoodieTableMetaClient hoodieTableMetaClient, Option<String> partitionNameOverrideOpt, Option<String[]> partitionPathFieldOpt, HoodieRecordMerger recordMerger, TypedProperties props)
public HoodieFileGroupRecordBuffer.BufferType getBufferType()
public void processDataBlock(HoodieDataBlock dataBlock, Option<KeySpec> keySpecOpt) throws IOException
HoodieFileGroupRecordBufferIOExceptionpublic void processNextDataRecord(T record, Map<String,Object> metadata, Serializable recordKey) throws IOException
HoodieFileGroupRecordBufferIOExceptionpublic void processDeleteBlock(HoodieDeleteBlock deleteBlock) throws IOException
HoodieFileGroupRecordBufferIOExceptionpublic void processNextDeletedRecord(DeleteRecord deleteRecord, Serializable recordKey)
HoodieFileGroupRecordBufferpublic boolean containsLogRecord(String recordKey)
HoodieFileGroupRecordBufferprotected boolean hasNextBaseRecord(T baseRecord) throws IOException
IOExceptionprotected boolean doHasNext()
throws IOException
HoodieBaseFileGroupRecordBufferdoHasNext in class HoodieBaseFileGroupRecordBuffer<T>IOExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.