Skip to content

Commit 7b9ed09

Browse files
committed
feat(storage): take async client out of experimental
1 parent 859f506 commit 7b9ed09

File tree

112 files changed

+895
-1073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+895
-1073
lines changed

google/cloud/storage/async/bucket_name.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace google {
2525
namespace cloud {
26-
namespace storage_experimental {
26+
namespace storage {
2727
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828
namespace {
2929

@@ -56,6 +56,6 @@ StatusOr<BucketName> MakeBucketName(absl::string_view full_name) {
5656
}
5757

5858
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
59-
} // namespace storage_experimental
59+
} // namespace storage
6060
} // namespace cloud
6161
} // namespace google

google/cloud/storage/async/bucket_name.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace google {
2525
namespace cloud {
26-
namespace storage_experimental {
26+
namespace storage {
2727
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828

2929
/**
@@ -79,7 +79,7 @@ class BucketName {
7979
StatusOr<BucketName> MakeBucketName(absl::string_view full_name);
8080

8181
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
82-
} // namespace storage_experimental
82+
} // namespace storage
8383
} // namespace cloud
8484
} // namespace google
8585

google/cloud/storage/async/bucket_name_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace google {
2323
namespace cloud {
24-
namespace storage_experimental {
24+
namespace storage {
2525
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2626
namespace {
2727

@@ -77,6 +77,6 @@ TEST(BucketName, MakeBucketName) {
7777

7878
} // namespace
7979
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
80-
} // namespace storage_experimental
80+
} // namespace storage
8181
} // namespace cloud
8282
} // namespace google

google/cloud/storage/async/client.cc

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
namespace google {
2727
namespace cloud {
28-
namespace storage_experimental {
28+
namespace storage {
2929
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3030

3131
using ::google::cloud::internal::MakeBackgroundThreadsFactory;
@@ -46,7 +46,8 @@ future<StatusOr<google::storage::v2::Object>> AsyncClient::InsertObject(
4646
Options opts) {
4747
return connection_->InsertObject(
4848
{std::move(request), std::move(contents),
49-
internal::MergeOptions(std::move(opts), connection_->options())});
49+
google::cloud::internal::MergeOptions(std::move(opts),
50+
connection_->options())});
5051
}
5152

5253
future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
@@ -60,8 +61,8 @@ future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
6061
future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
6162
google::storage::v2::BidiReadObjectSpec spec, Options opts) {
6263
return connection_
63-
->Open({std::move(spec),
64-
internal::MergeOptions(std::move(opts), connection_->options())})
64+
->Open({std::move(spec), google::cloud::internal::MergeOptions(
65+
std::move(opts), connection_->options())})
6566
.then([](auto f) -> StatusOr<ObjectDescriptor> {
6667
auto connection = f.get();
6768
if (!connection) return std::move(connection).status();
@@ -81,8 +82,8 @@ future<StatusOr<std::pair<AsyncReader, AsyncToken>>> AsyncClient::ReadObject(
8182
google::storage::v2::ReadObjectRequest request, Options opts) {
8283
return connection_
8384
->ReadObject(
84-
{std::move(request),
85-
internal::MergeOptions(std::move(opts), connection_->options())})
85+
{std::move(request), google::cloud::internal::MergeOptions(
86+
std::move(opts), connection_->options())})
8687
.then([](auto f) -> StatusOr<std::pair<AsyncReader, AsyncToken>> {
8788
auto impl = f.get();
8889
if (!impl) return std::move(impl).status();
@@ -108,8 +109,8 @@ future<StatusOr<ReadPayload>> AsyncClient::ReadObjectRange(
108109
request.set_read_limit(limit);
109110

110111
return connection_->ReadObjectRange(
111-
{std::move(request),
112-
internal::MergeOptions(std::move(opts), connection_->options())});
112+
{std::move(request), google::cloud::internal::MergeOptions(
113+
std::move(opts), connection_->options())});
113114
}
114115

115116
future<StatusOr<std::pair<AsyncWriter, AsyncToken>>>
@@ -131,8 +132,8 @@ AsyncClient::StartAppendableObjectUpload(
131132
google::storage::v2::BidiWriteObjectRequest request, Options opts) {
132133
return connection_
133134
->StartAppendableObjectUpload(
134-
{std::move(request),
135-
internal::MergeOptions(std::move(opts), connection_->options())})
135+
{std::move(request), google::cloud::internal::MergeOptions(
136+
std::move(opts), connection_->options())})
136137
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
137138
auto w = f.get();
138139
if (!w) return std::move(w).status();
@@ -155,8 +156,8 @@ AsyncClient::ResumeAppendableObjectUpload(BucketName const& bucket_name,
155156

156157
return connection_
157158
->ResumeAppendableObjectUpload(
158-
{std::move(request),
159-
internal::MergeOptions(std::move(opts), connection_->options())})
159+
{std::move(request), google::cloud::internal::MergeOptions(
160+
std::move(opts), connection_->options())})
160161
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
161162
auto w = f.get();
162163
if (!w) return std::move(w).status();
@@ -180,8 +181,8 @@ AsyncClient::StartBufferedUpload(
180181
google::storage::v2::StartResumableWriteRequest request, Options opts) {
181182
return connection_
182183
->StartBufferedUpload(
183-
{std::move(request),
184-
internal::MergeOptions(std::move(opts), connection_->options())})
184+
{std::move(request), google::cloud::internal::MergeOptions(
185+
std::move(opts), connection_->options())})
185186
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
186187
auto w = f.get();
187188
if (!w) return std::move(w).status();
@@ -205,8 +206,8 @@ AsyncClient::ResumeBufferedUpload(
205206
google::storage::v2::QueryWriteStatusRequest request, Options opts) {
206207
return connection_
207208
->ResumeBufferedUpload(
208-
{std::move(request),
209-
internal::MergeOptions(std::move(opts), connection_->options())})
209+
{std::move(request), google::cloud::internal::MergeOptions(
210+
std::move(opts), connection_->options())})
210211
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
211212
auto w = f.get();
212213
if (!w) return std::move(w).status();
@@ -233,8 +234,8 @@ AsyncClient::StartUnbufferedUpload(
233234
google::storage::v2::StartResumableWriteRequest request, Options opts) {
234235
return connection_
235236
->StartUnbufferedUpload(
236-
{std::move(request),
237-
internal::MergeOptions(std::move(opts), connection_->options())})
237+
{std::move(request), google::cloud::internal::MergeOptions(
238+
std::move(opts), connection_->options())})
238239
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
239240
auto w = f.get();
240241
if (!w) return std::move(w).status();
@@ -258,8 +259,8 @@ AsyncClient::ResumeUnbufferedUpload(
258259
google::storage::v2::QueryWriteStatusRequest request, Options opts) {
259260
return connection_
260261
->ResumeUnbufferedUpload(
261-
{std::move(request),
262-
internal::MergeOptions(std::move(opts), connection_->options())})
262+
{std::move(request), google::cloud::internal::MergeOptions(
263+
std::move(opts), connection_->options())})
263264
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
264265
auto w = f.get();
265266
if (!w) return std::move(w).status();
@@ -288,8 +289,8 @@ future<StatusOr<google::storage::v2::Object>> AsyncClient::ComposeObject(
288289
future<StatusOr<google::storage::v2::Object>> AsyncClient::ComposeObject(
289290
google::storage::v2::ComposeObjectRequest request, Options opts) {
290291
return connection_->ComposeObject(
291-
{std::move(request),
292-
internal::MergeOptions(std::move(opts), connection_->options())});
292+
{std::move(request), google::cloud::internal::MergeOptions(
293+
std::move(opts), connection_->options())});
293294
}
294295

295296
future<Status> AsyncClient::DeleteObject(BucketName const& bucket_name,
@@ -315,8 +316,8 @@ future<Status> AsyncClient::DeleteObject(BucketName const& bucket_name,
315316
future<Status> AsyncClient::DeleteObject(
316317
google::storage::v2::DeleteObjectRequest request, Options opts) {
317318
return connection_->DeleteObject(
318-
{std::move(request),
319-
internal::MergeOptions(std::move(opts), connection_->options())});
319+
{std::move(request), google::cloud::internal::MergeOptions(
320+
std::move(opts), connection_->options())});
320321
}
321322

322323
std::pair<AsyncRewriter, AsyncToken> AsyncClient::StartRewrite(
@@ -353,13 +354,13 @@ std::pair<AsyncRewriter, AsyncToken> AsyncClient::ResumeRewrite(
353354
std::pair<AsyncRewriter, AsyncToken> AsyncClient::ResumeRewrite(
354355
google::storage::v2::RewriteObjectRequest request, Options opts) {
355356
auto c = connection_->RewriteObject(
356-
{std::move(request),
357-
internal::MergeOptions(std::move(opts), connection_->options())});
357+
{std::move(request), google::cloud::internal::MergeOptions(
358+
std::move(opts), connection_->options())});
358359
auto token = storage_internal::MakeAsyncToken(c.get());
359360
return std::make_pair(AsyncRewriter(std::move(c)), std::move(token));
360361
}
361362

362363
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
363-
} // namespace storage_experimental
364+
} // namespace storage
364365
} // namespace cloud
365366
} // namespace google

google/cloud/storage/async/client.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,12 @@
3636

3737
namespace google {
3838
namespace cloud {
39-
/**
40-
* Contains experimental features for the GCS C++ Client Library.
41-
*
42-
* @warning The types, functions, aliases, and objects in this namespace are
43-
* subject to change without notice.
44-
*/
45-
namespace storage_experimental {
39+
namespace storage {
4640
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
4741

4842
/**
4943
* A client for Google Cloud Storage offering asynchronous operations.
5044
*
51-
* @note This class is experimental, it is subject to change without notice.
52-
*
5345
* @par Example: create a client instance
5446
* @snippet storage_async_samples.cc async-client
5547
*
@@ -903,7 +895,7 @@ class AsyncClient {
903895
};
904896

905897
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
906-
} // namespace storage_experimental
898+
} // namespace storage
907899
} // namespace cloud
908900
} // namespace google
909901

google/cloud/storage/async/client_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace google {
3131
namespace cloud {
32-
namespace storage_experimental {
32+
namespace storage {
3333
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3434
namespace {
3535

@@ -1399,6 +1399,6 @@ TEST(AsyncClient, ResumeRewrite2) {
13991399

14001400
} // namespace
14011401
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1402-
} // namespace storage_experimental
1402+
} // namespace storage
14031403
} // namespace cloud
14041404
} // namespace google

google/cloud/storage/async/connection.h

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace google {
3131
namespace cloud {
32-
namespace storage_experimental {
32+
namespace storage {
3333
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3434
class AsyncReaderConnection;
3535
class AsyncRewriterConnection;
@@ -88,9 +88,8 @@ class AsyncConnection {
8888
};
8989

9090
/// Open an object to perform multiple reads.
91-
virtual future<StatusOr<
92-
std::shared_ptr<storage_experimental::ObjectDescriptorConnection>>>
93-
Open(OpenParams p) = 0;
91+
virtual future<StatusOr<std::shared_ptr<ObjectDescriptorConnection>>> Open(
92+
OpenParams p) = 0;
9493

9594
/**
9695
* A thin wrapper around the `ReadObject()` parameters.
@@ -128,13 +127,11 @@ class AsyncConnection {
128127
};
129128

130129
/// Start an appendable upload configured for persistent sources.
131-
virtual future<
132-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
130+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
133131
StartAppendableObjectUpload(AppendableUploadParams p) = 0;
134132

135133
/// Resume an appendable upload configured for persistent sources.
136-
virtual future<
137-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
134+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
138135
ResumeAppendableObjectUpload(AppendableUploadParams p) = 0;
139136

140137
/**
@@ -153,13 +150,11 @@ class AsyncConnection {
153150
};
154151

155152
/// Start (or resume) an upload configured for persistent sources.
156-
virtual future<
157-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
153+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
158154
StartUnbufferedUpload(UploadParams p) = 0;
159155

160156
/// Start (or resume) an upload configured for streaming sources.
161-
virtual future<
162-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
157+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
163158
StartBufferedUpload(UploadParams p) = 0;
164159

165160
/**
@@ -179,13 +174,11 @@ class AsyncConnection {
179174
};
180175

181176
/// Resume an upload configured for persistent sources.
182-
virtual future<
183-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
177+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
184178
ResumeUnbufferedUpload(ResumeUploadParams p) = 0;
185179

186180
/// Resume an upload configured for streaming sources.
187-
virtual future<
188-
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
181+
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
189182
ResumeBufferedUpload(ResumeUploadParams p) = 0;
190183

191184
/**
@@ -248,7 +241,7 @@ class AsyncConnection {
248241
};
249242

250243
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
251-
} // namespace storage_experimental
244+
} // namespace storage
252245
} // namespace cloud
253246
} // namespace google
254247

0 commit comments

Comments
 (0)