Skip to content
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

[Question] Why does the connector need two init methods? #4565

Closed
1 task done
hhuang1231 opened this issue Nov 18, 2023 · 4 comments
Closed
1 task done

[Question] Why does the connector need two init methods? #4565

hhuang1231 opened this issue Nov 18, 2023 · 4 comments
Labels
question Further information is requested

Comments

@hhuang1231
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Question

image

In the org.apache.eventmesh.openconnect.SinkWorker#init(), just call org.apache.eventmesh.openconnect.api.connector.Connector#init(org.apache.eventmesh.openconnect.api.connector.ConnectorContext )(the second method framed below), then what is the role of the first method in the picture below.


org.apache.eventmesh.openconnect.SinkWorker#init()方法中,只会调用org.apache.eventmesh.openconnect.api.connector.Connector#init(org.apache.eventmesh.openconnect.api.connector.ConnectorContext)接口方法(如下图中框起来的第二个方法),那么下图中第一个方法是有什么作用。

image

@hhuang1231 hhuang1231 added the question Further information is requested label Nov 18, 2023
@pandaapo
Copy link
Contributor

pandaapo commented Nov 18, 2023

I'm not very sure if my opinion is correct. I have encountered similar confusion in PR #4389 before, this is the community's response: #4389 (comment). From this response, I speculate that the community may not have planned when to use the method SinkWorker#init (Config).

我不是很确定我的看法是否正确。我之前在PR #4389中也遇到过类似的困惑,这是社区的回复:#4389 (comment) ,从该回复中我猜测可能社区对什么时候使用该方法SinkWorker#init(Config)还在规划中。

@mxsm
Copy link
Member

mxsm commented Nov 19, 2023

@hhuang1231 At the beginning, there was only the first initialization method. However, as many connectors were developed, the ConnectorContext was later introduced. In my opinion, the second method was added for compatibility reasons. I suggest marking the first one as deprecated, and it could be removed in future versions. The current version can still maintain both methods.

@xwm1992
Copy link
Contributor

xwm1992 commented Nov 19, 2023

@hhuang1231 At the beginning, there was only the first initialization method. However, as many connectors were developed, the ConnectorContext was later introduced. In my opinion, the second method was added for compatibility reasons. I suggest marking the first one as deprecated, and it could be removed in future versions. The current version can still maintain both methods.

Yes, your statement is correct.

@mxsm
Copy link
Member

mxsm commented Nov 24, 2023

This qustion issue will be closed

@mxsm mxsm closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants