Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1ADAE200B4B for ; Thu, 7 Jul 2016 01:10:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 195A7160A73; Wed, 6 Jul 2016 23:10:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8A9E8160A64 for ; Thu, 7 Jul 2016 01:10:10 +0200 (CEST) Received: (qmail 22779 invoked by uid 500); 6 Jul 2016 23:10:09 -0000 Mailing-List: contact dev-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 dev@nifi.apache.org Received: (qmail 22768 invoked by uid 99); 6 Jul 2016 23:10:09 -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; Wed, 06 Jul 2016 23:10:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0A674E0B66; Wed, 6 Jul 2016 23:10:09 +0000 (UTC) From: olegz To: dev@nifi.apache.org Reply-To: dev@nifi.apache.org References: In-Reply-To: Subject: [GitHub] nifi pull request #563: NIFI-2078: External state management. Content-Type: text/plain Message-Id: <20160706231009.0A674E0B66@git1-us-west.apache.org> Date: Wed, 6 Jul 2016 23:10:09 +0000 (UTC) archived-at: Wed, 06 Jul 2016 23:10:11 -0000 Github user olegz commented on a diff in the pull request: https://github.com/apache/nifi/pull/563#discussion_r69828024 --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/GetKafka.java --- @@ -481,4 +496,51 @@ private void releaseFlowFile(FlowFile flowFile, ProcessSession session, Map partitionOffsets = KafkaUtils.retrievePartitionOffsets(zookeeperConnectionString, topic, groupId); + + return new StandardStateMap(partitionOffsets, System.currentTimeMillis()); + } + + private boolean isReadyToAccessState() { + if(StringUtils.isEmpty(zookeeperConnectionString) + || StringUtils.isEmpty(topic) + || StringUtils.isEmpty(groupId)) { + return false; + } + return true; --- End diff -- Wouldn't it be simpler to do: ```java return !StringUtils.isEmpty(zookeeperConnectionString) && !StringUtils.isEmpty(topic) && StringUtils.isEmpty(groupId); ``` --- 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. ---