Skip to content

feat: Add configurable stream read constraints for JSON input codec#5541

Merged
dlvenable merged 3 commits intoopensearch-project:mainfrom
fidelity-contributions:fix-issue-5466
Apr 9, 2025
Merged

feat: Add configurable stream read constraints for JSON input codec#5541
dlvenable merged 3 commits intoopensearch-project:mainfrom
fidelity-contributions:fix-issue-5466

Conversation

@saketh-pallempati
Copy link
Copy Markdown
Contributor

  • Introduced a configurable option for setting the maximum event length in the JSON input codec.
  • Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
  • Added validation to ensure the maximum event length is within acceptable limits.

Description

This change introduces a new configurable option that allows users to set the maximum event length for the JSON input codec. By setting this parameter, users can control the maximum size of JSON strings that the codec will process, ensuring that excessively large events are not processed and potentially causing issues. The JsonDecoder has been updated to accept the max_event_length parameter and apply it to the StreamReadConstraints. Additionally, validation has been added to ensure that the maximum event length is within acceptable limits.

Issues Resolved

fixes #5466

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

The documentation issue link : opensearch-project/documentation-website#9370

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
graytaylor0
graytaylor0 previously approved these changes Mar 25, 2025
Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
@saketh-pallempati
Copy link
Copy Markdown
Contributor Author

Hi @graytaylor0 ,
The suggestions were implemented in the new commit please do review.

graytaylor0
graytaylor0 previously approved these changes Mar 28, 2025
chenqi0805
chenqi0805 previously approved these changes Mar 31, 2025
Copy link
Copy Markdown
Collaborator

@chenqi0805 chenqi0805 left a comment

Choose a reason for hiding this comment

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

Thanks for making the change!

@saketh-pallempati
Copy link
Copy Markdown
Contributor Author

Thanks for making the change!

@chenqi0805 Thanks for approval.

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
@kayhern kayhern dismissed stale reviews from chenqi0805 and graytaylor0 via f358e56 April 1, 2025 17:21
Copy link
Copy Markdown
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

Thank you @saketh-pallempati for this improvement!

@dlvenable dlvenable merged commit 193df93 into opensearch-project:main Apr 9, 2025
5 of 6 checks passed
@saketh-pallempati
Copy link
Copy Markdown
Contributor Author

Thanks to all ✌️

amdhing pushed a commit to amdhing/data-prepper that referenced this pull request Apr 16, 2025
…pensearch-project#5541)

feat: Add configurable stream read constraints for JSON input codec

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

* Set maxEventLength default to null for safer usage.
* Set min value of maxEventLength to Jackson's default

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
Davidding4718 pushed a commit to Davidding4718/data-prepper that referenced this pull request Apr 25, 2025
…pensearch-project#5541)

feat: Add configurable stream read constraints for JSON input codec

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

* Set maxEventLength default to null for safer usage.
* Set min value of maxEventLength to Jackson's default

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
Davidding4718 pushed a commit to Davidding4718/data-prepper that referenced this pull request Apr 25, 2025
…pensearch-project#5541)

feat: Add configurable stream read constraints for JSON input codec

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

* Set maxEventLength default to null for safer usage.
* Set min value of maxEventLength to Jackson's default

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
Mamol27 pushed a commit to Mamol27/data-prepper that referenced this pull request May 6, 2025
…pensearch-project#5541)

feat: Add configurable stream read constraints for JSON input codec

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

* Set maxEventLength default to null for safer usage.
* Set min value of maxEventLength to Jackson's default

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
Signed-off-by: mamol27 <mamol27@yandex.ru>
Mamol27 pushed a commit to Mamol27/data-prepper that referenced this pull request May 6, 2025
…pensearch-project#5541)

feat: Add configurable stream read constraints for JSON input codec

- Introduced a configurable option for setting the maximum event length in the JSON input codec.
- Updated JsonDecoder to accept max_event_length parameter and apply it to StreamReadConstraints.
- Added validation to ensure the maximum event length is within acceptable limits.
Fixes opensearch-project#5466

* Set maxEventLength default to null for safer usage.
* Set min value of maxEventLength to Jackson's default

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
Signed-off-by: mamol27 <mamol27@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable stream read constraints max length in the JSON input codec

5 participants