nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zenfenan <...@git.apache.org>
Subject [GitHub] nifi pull request #2896: NIFI-5239 Made a client service an optional source ...
Date Mon, 03 Sep 2018 13:12:50 GMT
Github user zenfenan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2896#discussion_r214684778
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
---
    @@ -244,22 +266,20 @@ public final void closeClient() {
             }
         }
     
    -    protected MongoDatabase getDatabase(final ProcessContext context) {
    -        return getDatabase(context, null);
    -    }
    +//    protected MongoDatabase getDatabase(final ProcessContext context) {
    +//        return getDatabase(context, null);
    +//    }
     
         protected MongoDatabase getDatabase(final ProcessContext context, final FlowFile
flowFile) {
             final String databaseName = context.getProperty(DATABASE_NAME).evaluateAttributeExpressions(flowFile).getValue();
    -        if (StringUtils.isEmpty(databaseName)) {
    -            throw new ProcessException("Database name was empty after expression language
evaluation.");
    -        }
    -        return mongoClient.getDatabase(databaseName);
    -    }
     
    -    protected MongoCollection<Document> getCollection(final ProcessContext context)
{
    -        return getCollection(context, null);
    +        return clientService!= null ? clientService.getDatabase(databaseName) : mongoClient.getDatabase(databaseName);
         }
     
    +//    protected MongoCollection<Document> getCollection(final ProcessContext context)
{
    +//        return getCollection(context, null);
    +//    }
    +
    --- End diff --
    
    Same here.


---

Mime
View raw message