You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "greyp9 (via GitHub)" <gi...@apache.org> on 2023/04/14 13:34:29 UTC

[GitHub] [nifi] greyp9 commented on a diff in pull request #7173: NIFI-11439 - correct provenance reporting parameter

greyp9 commented on code in PR #7173:
URL: https://github.com/apache/nifi/pull/7173#discussion_r1166843465


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/storage/FetchGCSObject.java:
##########
@@ -273,7 +275,15 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
 
         final long millis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
         getLogger().info("Successfully retrieved GCS Object for {} in {} millis; routing to success", new Object[]{flowFile, millis});
-        session.getProvenanceReporter().fetch(flowFile, "https://" + bucketName + ".storage.googleapis.com/" + key, millis);
+
+        String transitUri;
+        try {
+            final URL url = new URL(storage.getOptions().getHost());
+            transitUri = String.format("%s://%s.%s/%s", url.getProtocol(), bucketName, url.getHost(), key);
+        } catch (MalformedURLException e) {
+            transitUri = e.getClass().getSimpleName();
+        }

Review Comment:
   Yep, that's better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org