AWS SDK for C++AWS SDK for C++ Version 1.11.440 |
#include <TransferManager.h>
This is a utility around Amazon Simple Storage Service. It can Upload large files via parts in parallel, Upload files less than 5MB in single PutObject, and download files via GetObject, If a transfer fails, it can be retried for an upload. For a download, there is nothing to retry in case of failure. Just download it again. You can also abort any in progress transfers. The key interface for controlling and knowing the status of your upload is the TransferHandle. An instance of TransferHandle is returned from each of the public functions in this interface. Keep a reference to the pointer. Each of the callbacks will also pass the handle that has received an update. None of the public methods in this interface block.
Definition at line 157 of file TransferManager.h.
By default, multi-part uploads will remain in a FAILED state if they fail, or a CANCELED state if they were canceled. Leaving failed uploads around still costs the owner of the bucket money. If you know you will not be retrying the request, abort the request after canceling it or if it fails and you don't intend to retry it.
Cancels all TransferManager operations in the current context of the TransferManager. Non-blocking, please call WaitUntilAllFinished
method if ShutdownAPI() is going to follow.
Create a new TransferManager instance initialized with config.
DownloadConfiguration()
,
nullptr
Downloads the contents of bucketName/keyName in S3 to the file specified by writeToFile. This will perform a GetObject operation.
DownloadConfiguration()
,
""
,
nullptr
Downloads the contents of bucketName/keyName in S3 and writes it to writeToStream. This will perform a GetObject operation.
DownloadConfiguration()
,
""
,
nullptr
Downloads the contents of bucketName/keyName in S3 and writes it to writeToStream. This will perform a GetObject operation for the given range.
Downloads entire contents of an Amazon S3 bucket starting at prefix stores them in a directory (not including the prefix). This is an asynchronous method. You will receive notifications that a download has started via the transferInitiatedCallback callback function in your configuration. If you do not set this callback, then you will not be able to handle the file transfers. If an error occurs prior to the transfer being initiated (e.g. list objects fails, then an error will be passed through the errorCallback).
directory: the absolute directory on disk to download to bucketName: the name of the S3 bucket to download from prefix: the prefix in the bucket to use as the root directory (e.g. download all objects at x prefix in S3 and then store them starting in directory with the prefix stripped out).
Retry an download that failed from a previous DownloadFile operation. If a multi-part download was used, only the failed parts will be re-fetched.
Retry an upload that failed from a previous UploadFile operation. If a multi-part upload was used, only the failed parts will be re-sent.
Retry an upload that failed from a previous UploadFile operation. If a multi-part upload was used, only the failed parts will be re-sent.
Uploads entire contents of directory to Amazon S3 bucket and stores them in a directory starting at prefix. This is an asynchronous method. You will receive notifications that an upload has started via the transferInitiatedCallback callback function in your configuration. If you do not set this callback, then you will not be able to handle the file transfers.
directory: the absolute directory on disk to upload bucketName: the name of the S3 bucket to upload to prefix: the prefix to put on all objects uploaded (e.g. put them in x directory in the bucket).
nullptr
Uploads a file via filename, to bucketName/keyName in S3. contentType and metadata will be added to the object. If the object is larger than the configured bufferSize, then a multi-part upload will be performed. Keeps file to be unopened until doing actual upload, this is useful for uploading directories with many small files (avoid having too many open files, which may exceed system limit)
nullptr
Uploads the contents of stream, to bucketName/keyName in S3. contentType and metadata will be added to the object. If the object is larger than the configured bufferSize, then a multi-part upload will be performed.
std::numeric_limits< int64_t >::max()
)
Blocks the calling thread until all this instance TransferManager operations have finished.
TransferManager API may outlive InitAPI{...}ShutdownAPI scope if TransferHandle status were not completed. Use this method before ShutdownAPI call if individual TransferHandles are not verified for completion.
timeoutMs,how | many milliseconds to block wait |