Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
|
Complete long running object rewrite operations. More...
#include <google/cloud/storage/object_rewriter.h>
Public Member Functions | |
ObjectRewriter (std::shared_ptr< internal::RawClient > client, internal::RewriteObjectRequest request) | |
StatusOr< RewriteProgress > | Iterate () |
Perform one iteration in the rewrite. More... | |
StatusOr< RewriteProgress > | CurrentProgress () const |
The current progress on the rewrite operation. More... | |
StatusOr< ObjectMetadata > | Result () |
Iterate until the operation completes using a callback to report progress. More... | |
template<typename Functor , typename std::enable_if< google::cloud::internal::is_invocable< Functor, StatusOr< RewriteProgress > >::value, int >::type = 0> | |
StatusOr< ObjectMetadata > | ResultWithProgressCallback (Functor cb) |
Iterate until the operation completes using a callback to report progress. More... | |
std::string const & | token () const |
The current rewrite token. More... | |
Complete long running object rewrite operations.
The Client::RewriteObject()
operation allows applications to copy objects across location boundaries, and to rewrite objects with different encryption keys. In some circumstances it may take multiple calls to the service to complete a rewrite, this class encapsulates the state of a partial copy.
google::cloud::storage::ObjectRewriter::ObjectRewriter | ( | std::shared_ptr< internal::RawClient > | client, |
internal::RewriteObjectRequest | request | ||
) |
|
inline |
The current progress on the rewrite operation.
StatusOr< RewriteProgress > google::cloud::storage::ObjectRewriter::Iterate | ( | ) |
Perform one iteration in the rewrite.
Result()
to examine the metadata for the newly created object.
|
inline |
Iterate until the operation completes using a callback to report progress.
std::async
, and run the copy on a separate thread.
|
inline |
Iterate until the operation completes using a callback to report progress.
std::async
, and run the copy on a separate thread.cb | the callback object. |
Functor | the type of the callback object. It must satisfy: std:is_invocable<Functor, StatusOr<RewriteProgress>>:: value == true . |
|
inline |
The current rewrite token.
Applications can save the token of partially completed rewrites, and restart those operations using Client::CopyObjectRestart
, even if the application has terminated. It is up to the application to preserve all the other information for the request, including source and destination buckets, encryption keys, and any preconditions affecting the request.
RewriteProgress
) to avoid repeating a rewrite.