lordgamez commented on code in PR #1586:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1586#discussion_r1273117515


##########
extensions/aws/processors/PutS3Object.cpp:
##########
@@ -29,9 +29,51 @@
 #include "core/ProcessContext.h"
 #include "core/ProcessSession.h"
 #include "core/Resource.h"
+#include "utils/ProcessorConfigUtils.h"
 
 namespace org::apache::nifi::minifi::aws::processors {
 
+namespace {
+class ReadCallback {
+ public:
+  ReadCallback(uint64_t flow_size, const 
minifi::aws::s3::PutObjectRequestParameters& options, aws::s3::S3Wrapper& 
s3_wrapper,
+        uint64_t multipart_threshold, uint64_t multipart_size, 
core::logging::Logger& logger)
+    : flow_size_(flow_size),
+      options_(options),
+      s3_wrapper_(s3_wrapper),
+      multipart_threshold_(multipart_threshold),
+      multipart_size_(multipart_size),
+      logger_(logger) {
+  }
+
+  int64_t operator()(const std::shared_ptr<io::InputStream>& stream) {
+    try {
+      if (flow_size_ <= multipart_threshold_) {

Review Comment:
   I implemented it this way because NiFi also has the [same 
implementation](https://github.com/apache/nifi/blob/d201119f0dc2b925d7a2fcc9f09ac80ef8672be8/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java#L613)
 for the threshold. I think one of the reasons for this is that the default 
value for it is 5GB which is the maximum size of a single part upload and that 
should be part of the inclusive size range.



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