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

NIFI-11483 correctly use the DescribedValue enum for JsonQueryElasticsearch processor properties #7195

Closed
wants to merge 1 commit into from

Conversation

ChrisSamo632
Copy link
Contributor

@ChrisSamo632 ChrisSamo632 commented Apr 25, 2023

Summary

NIFI-11483 correctly use the DescribedValue enum for JsonQueryElasticsearch processor properties

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 11
    • JDK 17

Licensing

  • [ ] New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • [ ] New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • [ ] Documentation formatting appears as expected in rendered files

Copy link
Contributor

@exceptionfactory exceptionfactory 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 the adjustment @ChrisSamo632. As noted in the comments, it should be possible to use the direct class reference to the enum that implements DescribedValue, as opposed to introducing a new method to return an EnumSet.

@@ -65,7 +65,7 @@
.name("el-rest-split-up-hits")
.displayName("Search Results Split")
.description("Output a flowfile containing all hits or one flowfile for each individual hit.")
.allowableValues(ResultOutputStrategy.PER_RESPONSE.getValue(), ResultOutputStrategy.PER_HIT.getValue())
.allowableValues(ResultOutputStrategy.getNonPaginatedResponseOutputStrategies())
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be possible to use ResultOutputStrategy.class:

Suggested change
.allowableValues(ResultOutputStrategy.getNonPaginatedResponseOutputStrategies())
.allowableValues(ResultOutputStrategy.class)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disagree - we don't want all three options here, just the 2, which is why I've put these in a non-paginated method to provide the filtered EnumSet

The full set of options is needed for the properties of the PaginatedJsonQueryElasticsearch processor where the COMBINED option makes sense, but not for the non-paginated processors

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification @ChrisSamo632, I missed that important detail. In that light, the changes make sense as implemented.

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks again for clarifying the approach @ChrisSamo632, the changes look good. +1 merging

exceptionfactory pushed a commit that referenced this pull request Apr 26, 2023
This closes #7195

Signed-off-by: David Handermann <exceptionfactory@apache.org>
(cherry picked from commit 99b2412)
@ChrisSamo632 ChrisSamo632 deleted the NIFI-11483 branch May 2, 2023 16:02
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.

2 participants