bool AwsDoc::S3::PutObjectAsync(const Aws::S3::S3Client &s3Client,
const Aws::String &bucketName,
const Aws::String &fileName) {
// ...
const std::shared_ptr<Aws::IOStream> input_data =
Aws::MakeShared<Aws::FStream>("SampleAllocationTag",
fileName.c_str(),
std::ios_base::in | std::ios_base::binary);
if (!*input_data) {
std::cerr << "Error: unable to open file " << fileName << std::endl;
return false;
}
// ...
}
ref: https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/cpp/example_code/s3/put_object_async.cpp
I want to upload about 1000 files (14GB) on S3 using PutObjectAsync of aws-sdk-cpp(https://github.com/aws/aws-sdk-cpp).
Creating std::shared_ptr<Aws::IOStream> instance is failed when I call PutObjectAsync multiple times without waiting PutObjectAsyncFinished callback.
200 ~ 300 files is OK, but more than that is not working. Memory usage is OK.
Why is Aws::MakeShared<Aws::FStream> not working?