From issues-return-63854-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Mon Sep 3 15:12:51 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 514C0180647 for ; Mon, 3 Sep 2018 15:12:51 +0200 (CEST) Received: (qmail 29844 invoked by uid 500); 3 Sep 2018 13:12:50 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 29835 invoked by uid 99); 3 Sep 2018 13:12:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2018 13:12:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 580BBE0054; Mon, 3 Sep 2018 13:12:50 +0000 (UTC) From: zenfenan To: issues@nifi.apache.org Reply-To: issues@nifi.apache.org References: In-Reply-To: Subject: [GitHub] nifi pull request #2896: NIFI-5239 Made a client service an optional source ... Content-Type: text/plain Message-Id: <20180903131250.580BBE0054@git1-us-west.apache.org> Date: Mon, 3 Sep 2018 13:12:50 +0000 (UTC) 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 getCollection(final ProcessContext context) { - return getCollection(context, null); + return clientService!= null ? clientService.getDatabase(databaseName) : mongoClient.getDatabase(databaseName); } +// protected MongoCollection getCollection(final ProcessContext context) { +// return getCollection(context, null); +// } + --- End diff -- Same here. ---