-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Early feedback] [HUDI-8163] Refactor UnMergedLogHandler with iterators #12608
base: master
Are you sure you want to change the base?
Conversation
.build(); | ||
scanner.scan(false); | ||
Iterator<HoodieRecord<?>> recordIterator = scanner.iterator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible we return an iterator too for method getUnmergedLogFileRecords
to the list add/get can be simplified.
@@ -617,6 +617,8 @@ && compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), GREATER_THA | |||
/** | |||
* Iterate over the GenericRecord in the block, read the hoodie key and partition path and call subclass processors to | |||
* handle it. | |||
* TODO: | |||
* 1. what is the purpose of this method? should the HoodieRecord be added to a queue and consumed by an iterator? | |||
*/ | |||
private void processDataBlock(HoodieDataBlock dataBlock, Option<KeySpec> keySpecOpt) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the main entry for handling the log blocks, each kind of log block would trigger invocation of specific row-level handling methods.
} | ||
|
||
public Builder withRecordDeletionCallback(RecordDeletionCallback recordDeletionCallback) { | ||
this.recordDeletionCallback = recordDeletionCallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recordDeletionCallback
is only consumer for deleted reords from the delete avro block, we may need another iterator impl specifically for it.
while (recordIterator.hasNext()) { | ||
try { | ||
records.add(recordIterator.next()); | ||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is exactly the same if we collect all the records in the collection again , maybe we do not remove those two callbacks and just add a new iterator impl for the case that really need it: the Flink streaming reader.
Change Logs
Refactor code to deprecate usage of callbacks and replace with iterators
Impact
Describe any public API or user-facing feature change or any performance impact.
Risk level (write none, low medium or high below)
If medium or high, explain what verification was done to mitigate the risks.
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
ticket number here and follow the instruction to make
changes to the website.
Contributor's checklist