-
I want to download some large file (10s of Gigabytes or more) from S3 in a streamed fashion. I do NOT want to store the file to disk. I want to occasionally read from it, in a way similar to how one would do when having opened a file with std::ifstream, i.e. occasionally read from it (e.g. with >>) and then do some computations. I was thinking of using a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Have you looking into using auto downloadHandle = transfer_manager->DownloadFile(BUCKET,
KEY,
[&]() { //Define a lambda expression for the callback method parameter to stream back the data.
return Aws::New<MyUnderlyingStream>("TestTag", Aws::New<Stream::PreallocatedStreamBuf>("TestTag", buffer.GetUnderlyingData(), BUFFER_SIZE));
});
downloadHandle->WaitUntilFinished();// Block calling thread until download is complete. |
Beta Was this translation helpful? Give feedback.
@github-actions proposed-answer
I don't think this sdk provides the functionality that you're looking for. It starts downloading the files to memory as soon as you send the request. You could attempt to make your own stream like functionality by using the
GetPartNumber
when making an s3 request. API docs: