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

Adding defaultValue to the @JsonProperty for processors. #5080

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

dlvenable
Copy link
Member

Description

This updates processors to use @JsonProperty's defaultValue to improve documentation.

Issues Resolved

N/A

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

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.

Copy link
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!

@@ -93,7 +93,7 @@ public class GrokProcessorConfig {
"<code>pattern_directories</code>. Default is <code>*</code>.")
private String patternsFilesGlob = DEFAULT_PATTERNS_FILES_GLOB;

@JsonProperty(TIMEOUT_MILLIS)
@JsonProperty(value = TIMEOUT_MILLIS, defaultValue = "30000")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to reuse DEFAULT_TIMEOUT_MILLIS in the defaultValue?

@@ -39,7 +39,7 @@ public class AggregateProcessorConfig {
private PluginModel aggregateAction;

@JsonPropertyDescription("The amount of time that a group should exist before it is concluded automatically. Supports ISO_8601 notation strings (\"PT20.345S\", \"PT15M\", etc.) as well as simple notation for seconds (\"60s\") and milliseconds (\"1500ms\"). Default value is 180s.")
@JsonProperty("group_duration")
@JsonProperty(value = "group_duration", defaultValue = DEFAULT_GROUP_DURATION_SECONDS + "s")
Copy link
Member

Choose a reason for hiding this comment

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

We don't need string conversion of DEFAULT_GROUP_DURATION_SECONDS here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default value itself is 180s because it is a duration value.

@dlvenable dlvenable merged commit 00b10bd into opensearch-project:main Oct 17, 2024
47 checks passed
san81 pushed a commit to san81/data-prepper that referenced this pull request Oct 17, 2024
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.

3 participants