15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_REWRITER_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_REWRITER_H
18#include "google/cloud/storage/internal/raw_client.h"
19#include "google/cloud/storage/version.h"
20#include "google/cloud/internal/invoke_result.h"
26GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
28
29
30
31
32
33
34
42
43
44
45
46
47
48
52 internal::RewriteObjectRequest request);
55
56
57
58
59
60
65 if (!last_error_
.ok()) {
72
73
74
75
76
77
78
79
80
86
87
88
89
90
91
92
93
94
95
96
97
98
99
102 typename std::enable_if<
google::
cloud::internal::is_invocable<
106 while (!progress_
.done) {
109 if (!last_error_
.ok()) {
116
117
118
119
120
121
122
123
124
125
126
127
128
129 std::string
const&
token()
const {
return request_.rewrite_token(); }
132 std::shared_ptr<internal::RawClient> client_;
133 internal::RewriteObjectRequest request_;
140GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Complete long running object rewrite operations.
Definition: object_rewriter.h:49
ObjectRewriter(std::shared_ptr< internal::RawClient > client, internal::RewriteObjectRequest request)
StatusOr< ObjectMetadata > ResultWithProgressCallback(Functor cb)
Iterate until the operation completes using a callback to report progress.
Definition: object_rewriter.h:105
StatusOr< RewriteProgress > CurrentProgress() const
The current progress on the rewrite operation.
Definition: object_rewriter.h:64
std::string const & token() const
The current rewrite token.
Definition: object_rewriter.h:129
StatusOr< RewriteProgress > Iterate()
Perform one iteration in the rewrite.
StatusOr< ObjectMetadata > Result()
Iterate until the operation completes using a callback to report progress.
Definition: object_rewriter.h:81
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
Represents the status of a rewrite operation.
Definition: object_rewriter.h:35
std::uint64_t total_bytes_rewritten
Definition: object_rewriter.h:36
std::uint64_t object_size
Definition: object_rewriter.h:37
bool done
Definition: object_rewriter.h:38