You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by pvillard31 <gi...@git.apache.org> on 2017/07/02 15:20:10 UTC

[GitHub] nifi pull request #1969: NIFI-4082 - Added EL on GetMongo properties

GitHub user pvillard31 opened a pull request:

    https://github.com/apache/nifi/pull/1969

    NIFI-4082 - Added EL on GetMongo properties

    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/pvillard31/nifi NIFI-4082

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1969.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 #1969
    
----
commit 89c2a35886b5d7f622fbe552c53e235c9b96f32b
Author: Pierre Villard <pi...@gmail.com>
Date:   2017-06-30T18:43:50Z

    NIFI-4082 - Added EL on GetMongo properties

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    +1 LGTM, ran builds/tests and tested GetMongo and PutMongo with EL for all fields, talked to Joey and he's cool with me merging too. Thanks for the improvements! Merging to master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @pvillard31 I think we can add EL to collection without having to do anything fancy since getCollection() in AbstractMongoProcessor re-uses the mongoClient already.
    
    That said, is it worth also adding EL support for URI and DB in this PR? The simple case will mean it'll get eval'd against the variable registry, which is definitely useful for migrating from env to env.
    
    There's another case though in being able to eval against a FlowFile for PutMongo so you can route to different DBs if you're doing some application-level sharding. But that would mean we'd have to manage a pool/map of connections since the mongoClient currently is set with @OnScheduled. Makes sense if you think that's for another PR though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1969


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1969#discussion_r127808068
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java ---
    @@ -59,14 +59,21 @@
         public static final Validator DOCUMENT_VALIDATOR = new Validator() {
             @Override
             public ValidationResult validate(final String subject, final String value, final ValidationContext context) {
    +            final ValidationResult.Builder builder = new ValidationResult.Builder();
    +            builder.subject(subject).input(value);
    +
    +            if (context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(value)) {
    +                return builder.valid(true).explanation("Contains Expression Language").build();
    +            }
    +
                 String reason = null;
                 try {
                     Document.parse(value);
                 } catch (final RuntimeException e) {
                     reason = e.getClass().getName();
    --- End diff --
    
    Seems like this should be `e.getMessage()` or `get.getClass().getName() + ": " + e.getMessage()` if you want the underlying exception class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @jfrazee just pushed a commit to address your last comment: changed the exception message for the custom document validator, and added unit tests for the expression language evaluation on URI, database name and collection name properties.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @pvillard31 I think this needs more updates to the tests. Since you've added URI, collection, and DB, we should probably add that to the Get test. And, I think there are similar changes that make sense for the Put and Abstract processor.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by jfrazee <gi...@git.apache.org>.
Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @pvillard31 I left some comments on [NIFI-4149](https://issues.apache.org/jira/browse/NIFI-4149). I think it'd be a step in the right direction.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @jfrazee - I just pushed a new commit and added support for expression language with FFs evaluation on DB and Collection name, and without FFs evaluation on URI. Regarding this very subject, what are your thoughts about NIFI-4149 and how this could solve this kind of need?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1969: NIFI-4082 - Added EL on GetMongo properties

Posted by nicholasmhughes <gi...@git.apache.org>.
Github user nicholasmhughes commented on the issue:

    https://github.com/apache/nifi/pull/1969
  
    @pvillard31 @jfrazee I'm very interested in this functionality. The Jira for this issue doesn't have a fix version identified. Do you think it will make it into 1.4.0 (or the next formal release)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---