@NotThreadSafe public class HoodieMergedLogRecordScanner extends AbstractHoodieLogRecordReader implements Iterable<HoodieRecord>, Closeable
NOTE: If readBlockLazily is turned on, does not merge, instead keeps reading log blocks and merges everything at once This is an optimization to avoid seek() back and forth to read new block (forward seek()) and lazily read content of seen block (reverse and forward seek()) during merge | | Read Block 1 Metadata | | Read Block 1 Data | | | Read Block 2 Metadata | | Read Block 2 Data | | I/O Pass 1 | ..................... | I/O Pass 2 | ................. | | | Read Block N Metadata | | Read Block N Data |
This results in two I/O passes over the log file.
| Modifier and Type | Class and Description |
|---|---|
static class |
HoodieMergedLogRecordScanner.Builder
Builder used to build
HoodieUnMergedLogRecordScanner. |
AbstractHoodieLogRecordReader.KeySpec| Modifier and Type | Field and Description |
|---|---|
HoodieTimer |
timer |
forceFullScan, hoodieTableMetaClient, logFilePaths, preCombineField, readerSchema, recordMerger, recordType| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getNumMergedRecordsInLog() |
Map<String,HoodieRecord> |
getRecords() |
HoodieRecord.HoodieRecordType |
getRecordType() |
long |
getTotalTimeTakenToReadAndMergeBlocks() |
Iterator<HoodieRecord> |
iterator() |
static HoodieMergedLogRecordScanner.Builder |
newBuilder()
Returns the builder for
HoodieMergedLogRecordScanner. |
protected void |
processNextDeletedRecord(DeleteRecord deleteRecord)
Process next deleted record.
|
<T> void |
processNextRecord(HoodieRecord<T> newRecord)
Process next record.
|
void |
scan()
Scans delta-log files processing blocks
|
void |
scan(boolean skipProcessingBlocks) |
void |
scanByFullKeys(List<String> keys)
Provides incremental scanning capability where only provided keys will be looked
up in the delta-log files, scanned and subsequently materialized into the internal
cache
|
void |
scanByKeyPrefixes(List<String> keyPrefixes)
Provides incremental scanning capability where only keys matching provided key-prefixes
will be looked up in the delta-log files, scanned and subsequently materialized into
the internal cache
|
getCurrentInstantLogBlocks, getPartitionNameOverride, getPayloadClassFQN, getPayloadProps, getProgress, getTotalCorruptBlocks, getTotalLogBlocks, getTotalLogFiles, getTotalLogRecords, getTotalRollbacks, getValidBlockInstants, isWithOperationField, scanInternalclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic final HoodieTimer timer
public final void scan()
public final void scan(boolean skipProcessingBlocks)
public void scanByFullKeys(List<String> keys)
keys - to be looked uppublic void scanByKeyPrefixes(List<String> keyPrefixes)
keyPrefixes - to be looked uppublic Iterator<HoodieRecord> iterator()
iterator in interface Iterable<HoodieRecord>public Map<String,HoodieRecord> getRecords()
public HoodieRecord.HoodieRecordType getRecordType()
public long getNumMergedRecordsInLog()
public static HoodieMergedLogRecordScanner.Builder newBuilder()
HoodieMergedLogRecordScanner.public <T> void processNextRecord(HoodieRecord<T> newRecord) throws IOException
AbstractHoodieLogRecordReaderprocessNextRecord in class AbstractHoodieLogRecordReadernewRecord - Hoodie Record to processIOExceptionprotected void processNextDeletedRecord(DeleteRecord deleteRecord)
AbstractHoodieLogRecordReaderprocessNextDeletedRecord in class AbstractHoodieLogRecordReaderdeleteRecord - Deleted record(hoodie key and ordering value)public long getTotalTimeTakenToReadAndMergeBlocks()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2024 The Apache Software Foundation. All rights reserved.