public abstract class AbstractHoodieLogRecordReader extends Object
This results in two I/O passes over the log file.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractHoodieLogRecordReader.Builder
Builder used to build
AbstractHoodieLogRecordScanner. |
protected static class |
AbstractHoodieLogRecordReader.KeySpec |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
forceFullScan |
protected List<String> |
logFilePaths |
protected org.apache.avro.Schema |
readerSchema |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractHoodieLogRecordReader(org.apache.hadoop.fs.FileSystem fs,
String basePath,
List<String> logFilePaths,
org.apache.avro.Schema readerSchema,
String latestInstantTime,
boolean readBlocksLazily,
boolean reverseReader,
int bufferSize,
Option<InstantRange> instantRange,
boolean withOperationField) |
protected |
AbstractHoodieLogRecordReader(org.apache.hadoop.fs.FileSystem fs,
String basePath,
List<String> logFilePaths,
org.apache.avro.Schema readerSchema,
String latestInstantTime,
boolean readBlocksLazily,
boolean reverseReader,
int bufferSize,
Option<InstantRange> instantRange,
boolean withOperationField,
boolean forceFullScan,
Option<String> partitionName,
InternalSchema internalSchema) |
| Modifier and Type | Method and Description |
|---|---|
protected HoodieAvroRecord<?> |
createHoodieRecord(org.apache.avro.generic.IndexedRecord rec,
HoodieTableConfig hoodieTableConfig,
String payloadClassFQN,
String preCombineField,
boolean withOperationField,
Option<Pair<String,String>> simpleKeyGenFields,
Option<String> partitionName)
Create @
HoodieRecord from the @IndexedRecord. |
protected String |
getKeyField() |
Option<String> |
getPartitionName() |
protected String |
getPayloadClassFQN() |
float |
getProgress()
Return progress of scanning as a float between 0.0 to 1.0.
|
long |
getTotalCorruptBlocks() |
long |
getTotalLogBlocks() |
long |
getTotalLogFiles() |
long |
getTotalLogRecords() |
long |
getTotalRollbacks() |
boolean |
isWithOperationField() |
protected abstract void |
processNextDeletedRecord(DeleteRecord deleteRecord)
Process next deleted record.
|
protected abstract void |
processNextRecord(HoodieRecord<? extends HoodieRecordPayload> hoodieRecord)
Process next record.
|
void |
scan() |
void |
scan(List<String> keys) |
protected void |
scanInternal(Option<AbstractHoodieLogRecordReader.KeySpec> keySpecOpt) |
protected final org.apache.avro.Schema readerSchema
protected final boolean forceFullScan
protected AbstractHoodieLogRecordReader(org.apache.hadoop.fs.FileSystem fs,
String basePath,
List<String> logFilePaths,
org.apache.avro.Schema readerSchema,
String latestInstantTime,
boolean readBlocksLazily,
boolean reverseReader,
int bufferSize,
Option<InstantRange> instantRange,
boolean withOperationField)
protected AbstractHoodieLogRecordReader(org.apache.hadoop.fs.FileSystem fs,
String basePath,
List<String> logFilePaths,
org.apache.avro.Schema readerSchema,
String latestInstantTime,
boolean readBlocksLazily,
boolean reverseReader,
int bufferSize,
Option<InstantRange> instantRange,
boolean withOperationField,
boolean forceFullScan,
Option<String> partitionName,
InternalSchema internalSchema)
protected String getKeyField()
public void scan()
protected void scanInternal(Option<AbstractHoodieLogRecordReader.KeySpec> keySpecOpt)
protected HoodieAvroRecord<?> createHoodieRecord(org.apache.avro.generic.IndexedRecord rec, HoodieTableConfig hoodieTableConfig, String payloadClassFQN, String preCombineField, boolean withOperationField, Option<Pair<String,String>> simpleKeyGenFields, Option<String> partitionName)
HoodieRecord from the @IndexedRecord.rec - - IndexedRecord to create the HoodieRecord fromhoodieTableConfig - - Table configpayloadClassFQN - - Payload class fully qualified namepreCombineField - - PreCombine fieldwithOperationField - - Whether operation field is enabledsimpleKeyGenFields - - Key generator fields when populate meta fields is tuened offpartitionName - - Partition nameprotected abstract void processNextRecord(HoodieRecord<? extends HoodieRecordPayload> hoodieRecord) throws Exception
hoodieRecord - Hoodie Record to processExceptionprotected abstract void processNextDeletedRecord(DeleteRecord deleteRecord)
deleteRecord - Deleted record(hoodie key and ordering value)public float getProgress()
public long getTotalLogFiles()
public long getTotalLogRecords()
public long getTotalLogBlocks()
protected String getPayloadClassFQN()
public long getTotalRollbacks()
public long getTotalCorruptBlocks()
public boolean isWithOperationField()
Copyright © 2022 The Apache Software Foundation. All rights reserved.