[ 
https://issues.apache.org/jira/browse/NIFI-1858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280705#comment-15280705
 ] 

ASF GitHub Bot commented on NIFI-1858:
--------------------------------------

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.


> Add ReportingTask for sending provenance events over Site-To-Site
> -----------------------------------------------------------------
>
>                 Key: NIFI-1858
>                 URL: https://issues.apache.org/jira/browse/NIFI-1858
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>            Priority: Minor
>             Fix For: 0.7.0
>
>
> Currently if someone wants to export Provenance events they can do so through 
> a ReportingTask. Rather than creating specialized ReportingTasks for 
> different destinations, another approach would be to send provenance events 
> to another NiFi instance over site-to-site and then use the standard 
> processors  in that other instance to store the events in the desired 
> destination.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to