-
Notifications
You must be signed in to change notification settings - Fork 18
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
use singleton ObjectMapper #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jjaakola-aiven!
Overall LGTM, left some comments.
...ain/java/io/aiven/kafka/connect/common/output/jsonwriter/AbstractJsonOutputStreamWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/io/aiven/kafka/connect/common/output/jsonwriter/ObjectMapperProvider.java
Outdated
Show resolved
Hide resolved
|
||
class KeyBuilder implements OutputFieldBuilder { | ||
|
||
private final ObjectMapper objectMapper = new ObjectMapper(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mental note; changing from plain object mapper to one with a exact big decimal. I don't think it may be relevant unless record.key()
contains an object with big decimal values
|
||
class ValueBuilder implements OutputFieldBuilder { | ||
|
||
private final ObjectMapper objectMapper = new ObjectMapper(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same mental note as for KeyBuilder
Reduces some memory footprint as single reused object mapper is used instead of creating new for each output stream, key, header and value serializer.
6ffe433
to
b29c779
Compare
src/main/java/io/aiven/kafka/connect/common/output/jsonwriter/ObjectMapperProvider.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from my side
Reduces some memory footprint as single reused object mapper is used instead of creating new for each output stream, key, header and value serializer.