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

Pulsar IO: allow Sinks to use native AVRO and JSON #11322

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Jul 15, 2021

The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();

Modifications

  • Add AVRO to the list of classes (like slf4j) to be loaded from the Pulsar runtime (this in turn imports Commons Compress and Jackson Databind).
  • Enhance the existing integration tests, that tested about the Schema definition, but it didn't actually try to "use" the org.apache.avro.GenericRecord object as well as the Jackson JsonNode object

@eolivelli eolivelli marked this pull request as ready for review July 15, 2021 09:52
@Anonymitaet
Copy link
Member

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 info in future PR descriptions? Thanks)

The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();
@eolivelli
Copy link
Contributor Author

@Anonymitaet when we will find a good solution for this problem I will be happy to help with the docs.
This PR is part of a bigger issue with have with Pulsar IO and Pulsar Functions

currently this is only a draft

@eolivelli eolivelli force-pushed the fix/core-api-deps branch 2 times, most recently from 910014a to 01dea55 Compare July 16, 2021 12:39
@eolivelli
Copy link
Contributor Author

@nlu90 can you please take a final look ?
I would like to fix this problem ASAP in 2.9.0 and commit this patch, this way @merlimat can move forward with his work about the classpath

Copy link
Member

@nlu90 nlu90 left a comment

Choose a reason for hiding this comment

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

👍🏼

@sijie sijie merged commit f35766f into apache:master Jul 20, 2021
lhotari added a commit to lhotari/pulsar that referenced this pull request Jul 21, 2021
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Jul 22, 2021
The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();

*Modifications*
- Add AVRO to the list of classes (like slf4j) to be loaded from the Pulsar runtime (this in turn imports Commons Compress and Jackson Databind).
- Enhance the existing integration tests, that tested about the Schema definition, but it didn't actually try to "use" the `org.apache.avro.GenericRecord` object as well as the `Jackson JsonNode` object
codelipenghui pushed a commit that referenced this pull request Jul 23, 2021
The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();

*Modifications*
- Add AVRO to the list of classes (like slf4j) to be loaded from the Pulsar runtime (this in turn imports Commons Compress and Jackson Databind).
- Enhance the existing integration tests, that tested about the Schema definition, but it didn't actually try to "use" the `org.apache.avro.GenericRecord` object as well as the `Jackson JsonNode` object

(cherry picked from commit f35766f)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 23, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();

*Modifications*
- Add AVRO to the list of classes (like slf4j) to be loaded from the Pulsar runtime (this in turn imports Commons Compress and Jackson Databind).
- Enhance the existing integration tests, that tested about the Schema definition, but it didn't actually try to "use" the `org.apache.avro.GenericRecord` object as well as the `Jackson JsonNode` object
eolivelli added a commit to eolivelli/pulsar that referenced this pull request Apr 3, 2022
The Sink should be able to manage the result of GenericRecord.getNativeObject().
In order to do this Apache AVRO must be loaded from the same classloader that is loading Apache Pulsar Runtime.

The same problem applies in the case of a JsonNode returned by getNativeObject();

*Modifications*
- Add AVRO to the list of classes (like slf4j) to be loaded from the Pulsar runtime (this in turn imports Commons Compress and Jackson Databind).
- Enhance the existing integration tests, that tested about the Schema definition, but it didn't actually try to "use" the `org.apache.avro.GenericRecord` object as well as the `Jackson JsonNode` object

(cherry picked from commit f35766f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants