You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by MikeThomsen <gi...@git.apache.org> on 2018/01/29 11:45:07 UTC
[GitHub] nifi pull request #2441: NIFI-4823 Made pretty printing configurable in GetM...
GitHub user MikeThomsen opened a pull request:
https://github.com/apache/nifi/pull/2441
NIFI-4823 Made pretty printing configurable in GetMongo.
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MikeThomsen/nifi NIFI-4823
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/2441.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2441
----
commit e683645db7a491b5df3f7aa4dfcb5d4cb8dbcfa3
Author: Mike Thomsen <mi...@...>
Date: 2018-01-29T11:44:14Z
NIFI-4823 Made pretty printing configurable in GetMongo.
----
---
[GitHub] nifi issue #2441: NIFI-4823 Made pretty printing configurable in GetMongo.
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:
https://github.com/apache/nifi/pull/2441
@markap14 Thanks for the feedback. I merged them into the commit and also found along the way a bug in how I was handling it. So should be good to go now once the build finishes.
---
[GitHub] nifi pull request #2441: NIFI-4823 Made pretty printing configurable in GetM...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/nifi/pull/2441
---
[GitHub] nifi pull request #2441: NIFI-4823 Made pretty printing configurable in GetM...
Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2441#discussion_r164482225
--- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java ---
@@ -126,6 +127,18 @@ public ValidationResult validate(final String subject, final String value, final
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
.build();
+ static final AllowableValue YES_PP = new AllowableValue("yes", "Yes");
--- End diff --
Would recommend we use 'true' and 'false' rather than 'yes' and 'no', just to keep consistent with the properties in most of the processors.
---
[GitHub] nifi pull request #2441: NIFI-4823 Made pretty printing configurable in GetM...
Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2441#discussion_r164482373
--- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java ---
@@ -126,6 +127,18 @@ public ValidationResult validate(final String subject, final String value, final
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
.build();
+ static final AllowableValue YES_PP = new AllowableValue("yes", "Yes");
+ static final AllowableValue NO_PP = new AllowableValue("no", "No");
+ static final PropertyDescriptor USE_PRETTY_PRINTING = new PropertyDescriptor.Builder()
+ .name("use-pretty-printing")
+ .displayName("Pretty Print Results JSON")
+ .description("Choose whether or not to pretty print the JSON from the results of the query. " +
+ "Choosing yes can greatly increase the space requirements on disk depending on the complexity of the JSON document")
+ .required(true)
+ .allowableValues(NO_PP, YES_PP)
+ .addValidator(Validator.VALID)
--- End diff --
This doesn't really hurt but just as an FYI, it's not really necessary to have a validator if allowable values are provided.
---
[GitHub] nifi issue #2441: NIFI-4823 Made pretty printing configurable in GetMongo.
Posted by jdye64 <gi...@git.apache.org>.
Github user jdye64 commented on the issue:
https://github.com/apache/nifi/pull/2441
+1 looks good to me. Will merge now
---
[GitHub] nifi pull request #2441: NIFI-4823 Made pretty printing configurable in GetM...
Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2441#discussion_r164484087
--- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java ---
@@ -126,6 +127,18 @@ public ValidationResult validate(final String subject, final String value, final
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
.build();
+ static final AllowableValue YES_PP = new AllowableValue("yes", "Yes");
+ static final AllowableValue NO_PP = new AllowableValue("no", "No");
+ static final PropertyDescriptor USE_PRETTY_PRINTING = new PropertyDescriptor.Builder()
--- End diff --
In order to avoid making existing processors invalid or change the way that they behave, we should add a default value of "true" to this property. Then the user is still able to disable the pretty-printing, but those who are satisfied with the current behavior are not affected.
---