ChrisSamo632 commented on a change in pull request #5504:
URL: https://github.com/apache/nifi/pull/5504#discussion_r762793801



##########
File path: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java
##########
@@ -148,6 +153,37 @@
         return problems;
     }
 
+    @Override
+    public List<ConfigVerificationResult> verify(ProcessContext context, 
ComponentLog verificationLogger, Map<String, String> attributes) {
+        final List<ConfigVerificationResult> results = new 
ArrayList<>(super.verify(context, verificationLogger, attributes));
+
+        final String bucket = 
context.getProperty(BUCKET).evaluateAttributeExpressions(attributes).getValue();
+        final String key = 
context.getProperty(KEY).evaluateAttributeExpressions(attributes).getValue();
+
+        final AmazonS3 client = getConfiguration(context).getClient();
+        final GetObjectRequest request = createGetObjectRequest(context, 
attributes);
+
+        try (final S3Object s3Object = client.getObject(request)) {

Review comment:
       A quick look at the [AWS 
docs](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) 
suggests that if one can `GetObject` then they will be able to `HeadObject`
   
   Particularly as the user may need to specify a large object to be retrieved 
from S3 by the processor, doing this more times than is necessary seems like a 
waste and unnecessary extra cost. I know that my use of this Processor often 
results in pulling many objects that range from very small to much larger, I'd 
be wanting to turn this step off if it meant doubling up on pulling some of the 
larger files over the internet!




-- 
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


Reply via email to