[Cherry-pick] [Functions] reorganize the context hierarchy for functions (#10631)#12117
Merged
Merged
Conversation
) ### Motivation Currently the context relationship for function, source and sink is not well defined. This prevents some common features to be added once for all and creates some confusion, code duplication in the current repo. As demonstrated in the following graph, this PR changes the hierarchy from left to right. By introducing a common base context, it help solving some issues we are seeing. The base context provides common access to pulsar cluster, state, metrics, and meta-data to make sure all components can reuse it.  ### Modifications - Remove `ConnectorContext` interface. - Introduce a `BaseContext` interface. - Update existing `Context`, `SourceContext`, `SinkContext` interface to extend the new common interface.
Contributor
Author
|
/pulsarbot run-failure-checks |
Member
|
@Technoboy- Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) |
Contributor
Author
Hi @Anonymitaet , no need to update doc. |
codelipenghui
approved these changes
Sep 24, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-pick #10631.
Why cherry-pick #10631?
We have to cherry-pick #11293, but 11293 depends on #10631. So we have to cherry-pick #10631 first.
Motivation
Currently the context relationship for function, source and sink is not well defined. This prevents some common features to be added once for all and creates some confusion, code duplication in the current repo. As demonstrated in the following graph, this PR changes the hierarchy from left to right. By introducing a common base context, it help solving some issues we are seeing. The base context provides common access to pulsar cluster, state, metrics, and meta-data to make sure all components can reuse it.
context hierarchy
Modifications
Remove ConnectorContext interface.
Introduce a BaseContext interface.
Update existing Context, SourceContext, SinkContext interface to extend the new common interface.