[GitHub] [nifi] malthe commented on a diff in pull request #6730: NIFI-10721 No querying for props after successful blob upload

2023-01-25 Thread via GitHub


malthe commented on code in PR #6730:
URL: https://github.com/apache/nifi/pull/6730#discussion_r1087452549


##
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java:
##
@@ -191,4 +198,13 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 session.transfer(flowFile, REL_FAILURE);
 }
 }
+
+private static void applyUploadResultAttributes(final Map 
attributes, final BlockBlobItem blob, final BlobType blobType, final long 
length) {
+attributes.put(ATTR_NAME_BLOBTYPE, blobType.toString());
+attributes.put(ATTR_NAME_ETAG, blob.getETag());
+attributes.put(ATTR_NAME_LENGTH, String.valueOf(length));
+attributes.put(ATTR_NAME_TIMESTAMP, 
String.valueOf(blob.getLastModified()));
+attributes.put(ATTR_NAME_LANG, null);
+attributes.put(ATTR_NAME_MIME_TYPE, APPLICATION_OCTET_STREAM);

Review Comment:
   If we want to retain the current behavior, then no – but it's perhaps a good 
improvement/change for the future. It certainly would make sense.



-- 
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-unsubscr...@nifi.apache.org

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



[GitHub] [nifi] malthe commented on a diff in pull request #6730: NIFI-10721 No querying for props after successful blob upload

2023-01-25 Thread via GitHub


malthe commented on code in PR #6730:
URL: https://github.com/apache/nifi/pull/6730#discussion_r1087452056


##
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java:
##
@@ -191,4 +198,13 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 session.transfer(flowFile, REL_FAILURE);
 }
 }
+
+private static void applyUploadResultAttributes(final Map 
attributes, final BlockBlobItem blob, final BlobType blobType, final long 
length) {
+attributes.put(ATTR_NAME_BLOBTYPE, blobType.toString());
+attributes.put(ATTR_NAME_ETAG, blob.getETag());
+attributes.put(ATTR_NAME_LENGTH, String.valueOf(length));
+attributes.put(ATTR_NAME_TIMESTAMP, 
String.valueOf(blob.getLastModified()));
+attributes.put(ATTR_NAME_LANG, null);

Review Comment:
   Nice catch, I have made a special case out of it in 
c5fa8a619a0ab41524daf83eededa7bdcea388fe.



-- 
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-unsubscr...@nifi.apache.org

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



[GitHub] [nifi] malthe commented on a diff in pull request #6730: NIFI-10721 No querying for props after successful blob upload

2023-01-25 Thread via GitHub


malthe commented on code in PR #6730:
URL: https://github.com/apache/nifi/pull/6730#discussion_r1087100485


##
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/test/java/org/apache/nifi/processors/azure/storage/ITPutAzureBlobStorage_v12.java:
##
@@ -57,6 +66,14 @@ public void testPutBlobWithSimpleName() throws Exception {
 assertSuccess(getContainerName(), BLOB_NAME, BLOB_DATA);
 }
 
+@Test
+public void testPutBlobApplyBlobMetadata() throws Exception {
+runProcessor(BLOB_DATA);
+
+assertSuccess(getContainerName(), BLOB_NAME, BLOB_DATA);
+assert ((ITProcessor) runner.getProcessor()).blobMetadataApplied;

Review Comment:
   Thanks – fixed in 2d80fa23f2bf1310d6bbaff5baf8ba66fd6d9946.



-- 
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-unsubscr...@nifi.apache.org

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