From bc37015693be559d6a6d533c34f8fdff4f055c6e Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Wed, 24 Jan 2018 16:15:22 +0100 Subject: [PATCH] NIFI-4814 - Add distinctive attribute to S2S reporting tasks NIFI-4814 - added UUID attribute NIFI-4814 - added type attribute Signed-off-by: Matthew Burgess This closes #2431 --- .../apache/nifi/reporting/SiteToSiteBulletinReportingTask.java | 3 +++ .../nifi/reporting/SiteToSiteProvenanceReportingTask.java | 3 +++ .../apache/nifi/reporting/SiteToSiteStatusReportingTask.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteBulletinReportingTask.java b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteBulletinReportingTask.java index 27c864906e..226e8791ea 100644 --- a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteBulletinReportingTask.java +++ b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteBulletinReportingTask.java @@ -159,6 +159,9 @@ public class SiteToSiteBulletinReportingTask extends AbstractSiteToSiteReporting final Map attributes = new HashMap<>(); final String transactionId = UUID.randomUUID().toString(); attributes.put("reporting.task.transaction.id", transactionId); + attributes.put("reporting.task.name", getName()); + attributes.put("reporting.task.uuid", getIdentifier()); + attributes.put("reporting.task.type", this.getClass().getSimpleName()); attributes.put("mime.type", "application/json"); final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8); diff --git a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java index 8331b46929..b458d737c8 100644 --- a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java +++ b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteProvenanceReportingTask.java @@ -277,6 +277,9 @@ public class SiteToSiteProvenanceReportingTask extends AbstractSiteToSiteReporti final Map attributes = new HashMap<>(); final String transactionId = UUID.randomUUID().toString(); attributes.put("reporting.task.transaction.id", transactionId); + attributes.put("reporting.task.name", getName()); + attributes.put("reporting.task.uuid", getIdentifier()); + attributes.put("reporting.task.type", this.getClass().getSimpleName()); attributes.put("mime.type", "application/json"); final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8); diff --git a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteStatusReportingTask.java b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteStatusReportingTask.java index c3d3da8308..526b5d513f 100644 --- a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteStatusReportingTask.java +++ b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteStatusReportingTask.java @@ -158,6 +158,9 @@ public class SiteToSiteStatusReportingTask extends AbstractSiteToSiteReportingTa final Map attributes = new HashMap<>(); final String transactionId = UUID.randomUUID().toString(); attributes.put("reporting.task.transaction.id", transactionId); + attributes.put("reporting.task.name", getName()); + attributes.put("reporting.task.uuid", getIdentifier()); + attributes.put("reporting.task.type", this.getClass().getSimpleName()); attributes.put("mime.type", "application/json"); JsonArrayBuilder jsonBatchArrayBuilder = factory.createArrayBuilder();