Skip to content

[pulsar-io] Using ObjectMapper instead of Gson to parse Source/SInk configuration - #10441

Merged
merlimat merged 4 commits into
apache:masterfrom
abhilashmandaliya:master
May 1, 2021
Merged

merlimat merged 4 commits into
apache:masterfrom
abhilashmandaliya:master

Conversation

@abhilashmandaliya

Copy link
Copy Markdown
Contributor

Fixes #10440

Motivation

Data types should be preserved after deserializing the sink/source config.

Modifications

Using ObjectMapper instead of Gson to parse the config.

This change added tests and can be verified as follows:

(example:)

  • Added unit tests

  • The schema: don't know

fixed minor issue in closing some of the PulsarClientImpl resources

private void shutdownEventLoopGroup(EventLoopGroup eventLoopGroup) throws PulsarClientException {
if (createdEventLoopGroup && !eventLoopGroup.isShutdown()) {
if (createdEventLoopGroup && eventLoopGroup != null && !eventLoopGroup.isShutdown()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was throwing an exception when this method was called from constructor if the exception was thrown before assigning parameter passed eventLoopGroup to the member variable eventLoopGroup. The same is for the cnxPool.

@abhilashmandaliya abhilashmandaliya changed the title Using ObjectMapper instead of Gson to parse Source/SInk configuration [pulsar-io] Using ObjectMapper instead of Gson to parse Source/SInk configuration Apr 29, 2021
@abhilashmandaliya

Copy link
Copy Markdown
Contributor Author

@MarvinCai @eolivelli @315157973 @lhotari kindly review it

@abhilashmandaliya

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Apr 29, 2021
@merlimat merlimat added this to the 2.8.0 milestone Apr 29, 2021
@abhilashmandaliya

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@merlimat
merlimat merged commit 900547f into apache:master May 1, 2021
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.

Sink config parsing doesn't preserve the original data type

3 participants