Skip to content

[Issue-8162] [pulsar-io] Added org.apache.pulsar.io.core.Context interface #8164

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

Merged
merged 3 commits into from
Oct 2, 2020

Conversation

david-streamlio
Copy link
Contributor

@david-streamlio david-streamlio commented Sep 29, 2020

No description provided.

Copy link
Contributor

@jerrypeng jerrypeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot simply extend SourceContext / SinkContext with Context. There are methods in in Context that don't make sense to be in SourceContext or SinkContext. For example:

String getOutputTopic();

Does not make sense to be callable from a SinkContext

@david-streamlio
Copy link
Contributor Author

@jerrypeng I have moved the duplicate method definitions into a "base" interface named Context, all the Source specific methods such as String getOutputTopic(); remain in the SourceContext interface, while the Sink specific methods such as Collection<String> getInputTopics(); remain in the SinkContext interface. Both the SinkContext and SourceContext will extend the base Context interface.

@jerrypeng
Copy link
Contributor

jerrypeng commented Sep 30, 2020

@david-streamlio I think you are talking about a new interface called Context? Have you included the Context.java file? I only seeing modification for SourceContext and SinkContext in this PR. Also can we name it something different since we already have a interface called called Context:

https://github.com/apache/pulsar/blob/master/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java

Something like ConnectorContext?

* Interface for a connector providing information about environment where it is running.
* It also allows to propagate information, such as logs, metrics, states, back to the Pulsar environment.
*/
public interface Context {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this this class to something like ConnectorContext? To avoid confusion with the existing Context interface for functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@srkukarni srkukarni merged commit 700131b into apache:master Oct 2, 2020
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Oct 3, 2020
…rface (apache#8164)

* Added org.apache.pulsar.io.core.Context interface

* Added the Context interface

* Renamed Context to ConnectorContext

Co-authored-by: David Kjerrumgaard <dkjerrumgaard@splunk.com>
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
…rface (apache#8164)

* Added org.apache.pulsar.io.core.Context interface

* Added the Context interface

* Renamed Context to ConnectorContext

Co-authored-by: David Kjerrumgaard <dkjerrumgaard@splunk.com>
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Dec 19, 2020
…rface (apache#8164)

* Added org.apache.pulsar.io.core.Context interface

* Added the Context interface

* Renamed Context to ConnectorContext

Co-authored-by: David Kjerrumgaard <dkjerrumgaard@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants