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

Add Flink - Pulsar Batch Sink Support #2979

Merged
merged 4 commits into from
Nov 16, 2018

Conversation

erenavsarogullari
Copy link
Member

@erenavsarogullari erenavsarogullari commented Nov 12, 2018

Motivation

This PR aims to bring Flink - Pulsar Batch Sink Support. If user works with Flink DataSet API and would like to write these DataSets to Pulsar, this sink can help.

Ref: Flink Batch Sink API

Modifications

Please find the change-set as follows:

  • Defines PulsarOutputFormat to write Flink Batch DataSets into Pulsar.
  • UT Coverage
  • FlinkPulsarBatchSinkExample to show how to use and to be used by users.
  • README.md documentation
  • Minor javadoc fix

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Nov 12, 2018
@merlimat merlimat added this to the 2.3.0 milestone Nov 12, 2018
}

@Override
public void close() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

close the producer when the output format is closed?

Copy link
Member Author

@erenavsarogullari erenavsarogullari Nov 13, 2018

Choose a reason for hiding this comment

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

@sijie Thanks for the review this.

This is the my concern as well. However, afais in local tests, close is called multiple times and causing to be closed the Producer before submitting all batch.


private transient Function<Throwable, MessageId> failureCallback;

private static volatile Producer<byte[]> producer;
Copy link
Member

Choose a reason for hiding this comment

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

any reason why you make it static?

Copy link
Member Author

@erenavsarogullari erenavsarogullari Nov 13, 2018

Choose a reason for hiding this comment

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

As same with close function, open function is also called multiple times. To avoid multiple Producer instance creation, it needs to be singleton at class level so it is static.

@sijie sijie merged commit aefbaac into apache:master Nov 16, 2018
@erenavsarogullari erenavsarogullari deleted the PulsarPR_FlinkBatchSinkSupport branch November 18, 2018 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants