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 48C80200B20 for ; Wed, 11 May 2016 21:54:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4737D160A18; Wed, 11 May 2016 19:54:31 +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 8DC9B160A17 for ; Wed, 11 May 2016 21:54:30 +0200 (CEST) Received: (qmail 11269 invoked by uid 500); 11 May 2016 19:54:29 -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 11257 invoked by uid 99); 11 May 2016 19:54:29 -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, 11 May 2016 19:54:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5FFEADFB79; Wed, 11 May 2016 19:54:29 +0000 (UTC) From: markap14 To: dev@nifi.apache.org Reply-To: dev@nifi.apache.org References: In-Reply-To: Subject: [GitHub] nifi pull request: NIFI-1858 Adding SiteToSiteProvenanceReportingT... Content-Type: text/plain Message-Id: <20160511195429.5FFEADFB79@git1-us-west.apache.org> Date: Wed, 11 May 2016 19:54:29 +0000 (UTC) archived-at: Wed, 11 May 2016 19:54:31 -0000 Github user markap14 commented on a diff in the pull request: https://github.com/apache/nifi/pull/419#discussion_r62914873 --- Diff: nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java --- @@ -192,13 +179,20 @@ public void onTrigger(final ReportingContext context) { final JsonBuilderFactory factory = Json.createBuilderFactory(config); final JsonObjectBuilder builder = factory.createObjectBuilder(); + final DateFormat df = new SimpleDateFormat(TIMESTAMP_FORMAT); + df.setTimeZone(TimeZone.getTimeZone("Z")); + while (events != null && !events.isEmpty()) { final long start = System.nanoTime(); // Create a JSON array of all the events in the current batch final JsonArrayBuilder arrayBuilder = factory.createArrayBuilder(); for (final ProvenanceEventRecord event : events) { - arrayBuilder.add(serialize(factory, builder, event, getComponentName(procGroupStatus, event), hostname, url, rootGroupName, platform)); + String componentName = null; + if (componentMap.containsKey(event.getComponentId())) { --- End diff -- I think we can avoid this check to see if it contains key and instead just call the get() method. If not present it will return null anyway and is a bit more efficient. --- 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. ---