-
Notifications
You must be signed in to change notification settings - Fork 594
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
refactor(source): refine source macro #12260
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
5bd5f44
refactor source with trait
wenym1 a205e09
refactor(source): specify cdc generic type parameter for different cd…
wenym1 6282937
Merge branch 'yiming/refactor-cdc-type' into yiming/refactor-source-w…
wenym1 074a57c
refactor(source): implement the common split reader as a generic func…
wenym1 d824b76
Merge branch 'yiming/extract-source-common-reader' into yiming/refact…
wenym1 8167f25
Merge branch 'main' into yiming/extract-source-common-reader
wenym1 07a6e82
Merge branch 'main' into yiming/extract-source-common-reader
wenym1 c11d850
Merge branch 'yiming/extract-source-common-reader' into yiming/refact…
wenym1 8cdc90e
extract more common cdc logic
wenym1 dbaf522
Merge branch 'yiming/refactor-cdc-type' into yiming/refactor-source-w…
wenym1 a1c9cf6
Merge branch 'main' into yiming/refactor-cdc-type
wenym1 14e0792
Merge branch 'yiming/refactor-cdc-type' into yiming/refactor-source-w…
wenym1 bdb20b4
make code compile
wenym1 73ae14c
refactor(source): refine source macro
wenym1 6be9d4f
Merge branch 'main' into yiming/refactor-source-with-trait
wenym1 2206d07
fmt
wenym1 c61f588
Merge branch 'main' into yiming/refactor-source-with-trait
wenym1 c03e7f0
Merge branch 'yiming/refactor-source-with-trait' into yiming/refactor…
wenym1 8ae946f
Merge branch 'main' into yiming/refactor-source-macro
wenym1 0fc9b65
extract update_with_offset to split trait
wenym1 9a3b9b0
extract init_from_pb_source
wenym1 d7ca600
Merge branch 'main' into yiming/refactor-source-macro
wenym1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor(source): refine source macro
- Loading branch information
commit 73ae14cded102a4fcd53fdc64dae0f69e62ba076
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I revisit this pr to want to understand how does
dispatch_source_prop!
work, but it is hard to get it. Because these macros are nested instead of in a flatten structure.For example to understand the third arg
{$source_prop, IgnorePropType, IgnoreSplitType}
, I need to dive into other macros level by level. What's worse is that IDE can't expand thesemacro_rules!
directly without calling it in a function. Is there a way to show the expanded code of amacro_rules!
without calling it just like a function definition? Or coud we flatten these macros a bit? cc @wenym1There 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.
You can write an example in a random function and use
cargo expand
to see the expanded code.This main idea of this PR is to declare all source related information in only one place so that when developing a new source, we don't have to declare these information in places previously scattered around in our codebase.