NIFI-14155 Improve ObjectMapper handling in TokenParserFactory#9648
NIFI-14155 Improve ObjectMapper handling in TokenParserFactory#9648exceptionfactory wants to merge 1 commit intoapache:mainfrom
Conversation
- Refactored TokenParserFactory interface to accept InputStream without configuration parameters - Avoided unnecessary ObjectMapper creation in JsonParserFactory
pvillard31
left a comment
There was a problem hiding this comment.
Hey @exceptionfactory - thanks for this improvement, this is going to make a huge difference performance wise. I did notice some formatting issues with additional whitespaces in TestJsonPathRowRecordReader, can you double check?
Thanks for the review @pvillard31! For whitespace, are you referring to the adjustments in the try-catch line spacing? The parameters for the Reader constructor changed, and in the process of making those changes, I noticed some of the second lines were not aligned with the first line inside the block, so that's the reason for some of the adjustments. If there is something else I am missing, please let me know. |
pvillard31
left a comment
There was a problem hiding this comment.
I need more coffee... I didn't notice that it was a multi-lines try statement... Thanks @exceptionfactory - confirmed normal behavior on multiple flows. Code changes LGTM. Merging.
Summary
NIFI-14155 Improves handling of the Jackson
ObjectMapperin theTokenParserFactoryinterface and associated implementations. Improvements include refactoring the interface definition to remove configuration variables so thatObjectMapperandJsonFactoryinstances can be reused.The refactored approach applies to JSON and YAML Record Readers as well as the Record Transform Proxy for Python Record Processors. The revised implementation creates instances of
ObjectMapperwith configured Stream Read Constraints on Controller Service enabling. With thread safety provided in JsonFactory and ObjectMapper, reusing these objects improves performance for repeated processing operations.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation