exceptionfactory commented on code in PR #10911:
URL: https://github.com/apache/nifi/pull/10911#discussion_r2827481873


##########
nifi-extension-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/PutSplunkHTTP.java:
##########
@@ -174,6 +174,10 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 
                     if (successResponse.getCode() == 0) {
                         flowFile = enrichFlowFile(session, flowFile, 
successResponse.getAckId());
+                        final String scheme = 
context.getProperty(SCHEME).getValue();
+                        final String hostname = 
context.getProperty(HOSTNAME).evaluateAttributeExpressions().getValue();
+                        final int port = 
context.getProperty(PORT).evaluateAttributeExpressions().asInteger();
+                        session.getProvenanceReporter().send(flowFile, 
"%s://%s:%d%s".formatted(scheme, hostname, port, endpoint));

Review Comment:
   It looks like the base URI with scheme, hostname, and port could be 
constructed once on scheduling, probably in the base class, instead of 
resolving these property values on every invocation. With the base URI, then 
the endpoint could be added since it supports FlowFile attributes.



##########
nifi-extension-bundles/nifi-snowflake-bundle/nifi-snowflake-processors/src/main/java/org/apache/nifi/processors/snowflake/PutSnowflakeInternalStage.java:
##########
@@ -164,6 +164,7 @@ public void onTrigger(ProcessContext context, 
ProcessSession session) throws Pro
         }
 
         flowFile = session.putAttribute(flowFile, ATTRIBUTE_STAGED_FILE_PATH, 
stagedFileName);
+        session.getProvenanceReporter().send(flowFile, 
"snowflake://%s/%s".formatted(internalStageName, stagedFileName));

Review Comment:
   I considered suggesting the inclusion of account information in the URL, but 
that does not appear to be readily available. For disambiguation, it seems like 
there should be some indication of `stage` in the synthetic URL, perhaps the 
following?
   
   
   ```suggestion
           session.getProvenanceReporter().send(flowFile, 
"snowflake://stages/%s/%s".formatted(internalStageName, stagedFileName));
   ```



##########
nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/data/explorer/PutAzureDataExplorer.java:
##########
@@ -223,6 +223,7 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
             final KustoIngestionResult result = service.ingestData(request);
             if (result == KustoIngestionResult.SUCCEEDED) {
                 getLogger().info("Ingest {} for {}", result.getStatus(), 
flowFile);
+                session.getProvenanceReporter().send(flowFile, 
"azuredataexplorer://%s/%s".formatted(databaseName, tableName));

Review Comment:
   It seems better to expose the cluster URI from the ingest service to have a 
more precise base URI.



##########
nifi-extension-bundles/nifi-redis-bundle/nifi-redis-extensions/src/main/java/org/apache/nifi/redis/processor/PutRedisHashRecord.java:
##########
@@ -220,6 +220,7 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
         }
 
         flowFile = session.putAttribute(flowFile, SUCCESS_RECORD_COUNT, 
String.valueOf(count));
+        session.getProvenanceReporter().send(flowFile, "redis://hash");

Review Comment:
   It seems like the hash value should be included in the Transit URI. This 
would be more accurate if the server information were readily available, but 
might require some adjustments to the Redis Connection Pool.



##########
nifi-extension-bundles/nifi-iotdb-bundle/nifi-iotdb-processors/src/main/java/org/apache/nifi/processors/PutIoTDBRecord.java:
##########
@@ -193,6 +193,9 @@ public void onTrigger(ProcessContext processContext, 
ProcessSession processSessi
             processSession.transfer(flowFile, REL_FAILURE);
             return;
         }
+        final String host = processContext.getProperty(IOTDB_HOST).getValue();
+        final String port = processContext.getProperty(IOTDB_PORT).getValue();

Review Comment:
   The transit URI could be computed on scheduling instead of on each trigger 
invocation.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to