Skip to content

Conversation

@Technoboy-
Copy link
Contributor

@Technoboy- Technoboy- commented Sep 21, 2021

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.

)

### 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](https://user-images.githubusercontent.com/16407807/118730483-8ebf5200-b7ec-11eb-9220-d41261f148bb.png)



### Modifications

- Remove `ConnectorContext` interface.
- Introduce a `BaseContext` interface. 
- Update existing `Context`, `SourceContext`, `SinkContext` interface to extend the new common interface.
@Technoboy-
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Anonymitaet
Copy link
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)

@Technoboy-
Copy link
Contributor Author

@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)

Hi @Anonymitaet , no need to update doc.

@codelipenghui codelipenghui merged commit e2a0866 into apache:branch-2.8 Sep 24, 2021
@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Sep 24, 2021
@Technoboy- Technoboy- deleted the cherry-pick-10631 branch August 10, 2022 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants