davidvoit commented on a change in pull request #4175:
URL: https://github.com/apache/nifi/pull/4175#discussion_r417823639
##########
File path:
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/services/azure/storage/AzureBlobStorageUserMetadataStringLookupService.java
##########
@@ -0,0 +1,115 @@
+package org.apache.nifi.services.azure.storage;
+
+import com.microsoft.azure.storage.CloudStorageAccount;
+import com.microsoft.azure.storage.StorageException;
+import com.microsoft.azure.storage.blob.CloudBlob;
+import com.microsoft.azure.storage.blob.CloudBlobClient;
+import com.microsoft.azure.storage.blob.CloudBlobContainer;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.ValidationContext;
+import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.lookup.LookupFailureException;
+import org.apache.nifi.lookup.StringLookupService;
+import org.apache.nifi.processors.azure.AbstractAzureBlobProcessor;
+import org.apache.nifi.processors.azure.storage.utils.AzureStorageUtils;
+
+import java.net.URISyntaxException;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@Tags({"azure", "microsoft", "cloud", "storage", "blob", "lookup", "enrich",
"key", "value"})
+@CapabilityDescription("Allows users to add key/value pairs as User-defined
Properties." +
+ "Each property that is added will be looked up in the User Metadata on the
Blob")
+public class AzureBlobStorageUserMetadataStringLookupService extends
AbstractControllerService implements StringLookupService {
+
+ protected static final String KEY = "key";
+ protected static final Set<String> REQUIRED_KEYS =
Collections.unmodifiableSet(Stream.of(KEY).collect(Collectors.toSet()));
+
+ private static final List<PropertyDescriptor> PROPERTIES = Collections
Review comment:
Yeah formatting is my error. Will fix this with the correct formatting
files in my ide.
Unit Test: There is an integration test in
ITLookupAttributeAzureBlobStorage.java just like all the other azure stuff.
This should be fine wouldn't it?
If you think unit tests are needed, I think a whole new pull request is
needed as you would need to mock an whole azure blob interaction, and this
would effect all processors, not just the new lookup one
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]