Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/cloud/storage/async/bucket_name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {

Expand Down Expand Up @@ -56,6 +56,6 @@ StatusOr<BucketName> MakeBucketName(absl::string_view full_name) {
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google
4 changes: 2 additions & 2 deletions google/cloud/storage/async/bucket_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ class BucketName {
StatusOr<BucketName> MakeBucketName(absl::string_view full_name);

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google

Expand Down
4 changes: 2 additions & 2 deletions google/cloud/storage/async/bucket_name_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {

Expand Down Expand Up @@ -77,6 +77,6 @@ TEST(BucketName, MakeBucketName) {

} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google
55 changes: 28 additions & 27 deletions google/cloud/storage/async/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

using ::google::cloud::internal::MakeBackgroundThreadsFactory;
Expand All @@ -46,7 +46,8 @@ future<StatusOr<google::storage::v2::Object>> AsyncClient::InsertObject(
Options opts) {
return connection_->InsertObject(
{std::move(request), std::move(contents),
internal::MergeOptions(std::move(opts), connection_->options())});
google::cloud::internal::MergeOptions(std::move(opts),
connection_->options())});
}

future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
Expand All @@ -60,8 +61,8 @@ future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
future<StatusOr<ObjectDescriptor>> AsyncClient::Open(
google::storage::v2::BidiReadObjectSpec spec, Options opts) {
return connection_
->Open({std::move(spec),
internal::MergeOptions(std::move(opts), connection_->options())})
->Open({std::move(spec), google::cloud::internal::MergeOptions(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we writing full namespace now?

std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<ObjectDescriptor> {
auto connection = f.get();
if (!connection) return std::move(connection).status();
Expand All @@ -81,8 +82,8 @@ future<StatusOr<std::pair<AsyncReader, AsyncToken>>> AsyncClient::ReadObject(
google::storage::v2::ReadObjectRequest request, Options opts) {
return connection_
->ReadObject(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncReader, AsyncToken>> {
auto impl = f.get();
if (!impl) return std::move(impl).status();
Expand All @@ -108,8 +109,8 @@ future<StatusOr<ReadPayload>> AsyncClient::ReadObjectRange(
request.set_read_limit(limit);

return connection_->ReadObjectRange(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())});
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())});
}

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

return connection_
->ResumeAppendableObjectUpload(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
auto w = f.get();
if (!w) return std::move(w).status();
Expand All @@ -180,8 +181,8 @@ AsyncClient::StartBufferedUpload(
google::storage::v2::StartResumableWriteRequest request, Options opts) {
return connection_
->StartBufferedUpload(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
auto w = f.get();
if (!w) return std::move(w).status();
Expand All @@ -205,8 +206,8 @@ AsyncClient::ResumeBufferedUpload(
google::storage::v2::QueryWriteStatusRequest request, Options opts) {
return connection_
->ResumeBufferedUpload(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
auto w = f.get();
if (!w) return std::move(w).status();
Expand All @@ -233,8 +234,8 @@ AsyncClient::StartUnbufferedUpload(
google::storage::v2::StartResumableWriteRequest request, Options opts) {
return connection_
->StartUnbufferedUpload(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
auto w = f.get();
if (!w) return std::move(w).status();
Expand All @@ -258,8 +259,8 @@ AsyncClient::ResumeUnbufferedUpload(
google::storage::v2::QueryWriteStatusRequest request, Options opts) {
return connection_
->ResumeUnbufferedUpload(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())})
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())})
.then([](auto f) -> StatusOr<std::pair<AsyncWriter, AsyncToken>> {
auto w = f.get();
if (!w) return std::move(w).status();
Expand Down Expand Up @@ -288,8 +289,8 @@ future<StatusOr<google::storage::v2::Object>> AsyncClient::ComposeObject(
future<StatusOr<google::storage::v2::Object>> AsyncClient::ComposeObject(
google::storage::v2::ComposeObjectRequest request, Options opts) {
return connection_->ComposeObject(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())});
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())});
}

future<Status> AsyncClient::DeleteObject(BucketName const& bucket_name,
Expand All @@ -315,8 +316,8 @@ future<Status> AsyncClient::DeleteObject(BucketName const& bucket_name,
future<Status> AsyncClient::DeleteObject(
google::storage::v2::DeleteObjectRequest request, Options opts) {
return connection_->DeleteObject(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())});
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())});
}

std::pair<AsyncRewriter, AsyncToken> AsyncClient::StartRewrite(
Expand Down Expand Up @@ -353,13 +354,13 @@ std::pair<AsyncRewriter, AsyncToken> AsyncClient::ResumeRewrite(
std::pair<AsyncRewriter, AsyncToken> AsyncClient::ResumeRewrite(
google::storage::v2::RewriteObjectRequest request, Options opts) {
auto c = connection_->RewriteObject(
{std::move(request),
internal::MergeOptions(std::move(opts), connection_->options())});
{std::move(request), google::cloud::internal::MergeOptions(
std::move(opts), connection_->options())});
auto token = storage_internal::MakeAsyncToken(c.get());
return std::make_pair(AsyncRewriter(std::move(c)), std::move(token));
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google
12 changes: 2 additions & 10 deletions google/cloud/storage/async/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,12 @@

namespace google {
namespace cloud {
/**
* Contains experimental features for the GCS C++ Client Library.
*
* @warning The types, functions, aliases, and objects in this namespace are
* subject to change without notice.
*/
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/**
* A client for Google Cloud Storage offering asynchronous operations.
*
* @note This class is experimental, it is subject to change without notice.
*
* @par Example: create a client instance
* @snippet storage_async_samples.cc async-client
*
Expand Down Expand Up @@ -903,7 +895,7 @@ class AsyncClient {
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google

Expand Down
4 changes: 2 additions & 2 deletions google/cloud/storage/async/client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {

Expand Down Expand Up @@ -1399,6 +1399,6 @@ TEST(AsyncClient, ResumeRewrite2) {

} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google
27 changes: 10 additions & 17 deletions google/cloud/storage/async/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace google {
namespace cloud {
namespace storage_experimental {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
class AsyncReaderConnection;
class AsyncRewriterConnection;
Expand Down Expand Up @@ -88,9 +88,8 @@ class AsyncConnection {
};

/// Open an object to perform multiple reads.
virtual future<StatusOr<
std::shared_ptr<storage_experimental::ObjectDescriptorConnection>>>
Open(OpenParams p) = 0;
virtual future<StatusOr<std::shared_ptr<ObjectDescriptorConnection>>> Open(
OpenParams p) = 0;

/**
* A thin wrapper around the `ReadObject()` parameters.
Expand Down Expand Up @@ -128,13 +127,11 @@ class AsyncConnection {
};

/// Start an appendable upload configured for persistent sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
StartAppendableObjectUpload(AppendableUploadParams p) = 0;

/// Resume an appendable upload configured for persistent sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
ResumeAppendableObjectUpload(AppendableUploadParams p) = 0;

/**
Expand All @@ -153,13 +150,11 @@ class AsyncConnection {
};

/// Start (or resume) an upload configured for persistent sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
StartUnbufferedUpload(UploadParams p) = 0;

/// Start (or resume) an upload configured for streaming sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
StartBufferedUpload(UploadParams p) = 0;

/**
Expand All @@ -179,13 +174,11 @@ class AsyncConnection {
};

/// Resume an upload configured for persistent sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
ResumeUnbufferedUpload(ResumeUploadParams p) = 0;

/// Resume an upload configured for streaming sources.
virtual future<
StatusOr<std::unique_ptr<storage_experimental::AsyncWriterConnection>>>
virtual future<StatusOr<std::unique_ptr<AsyncWriterConnection>>>
ResumeBufferedUpload(ResumeUploadParams p) = 0;

/**
Expand Down Expand Up @@ -248,7 +241,7 @@ class AsyncConnection {
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_experimental
} // namespace storage
} // namespace cloud
} // namespace google

Expand Down
Loading
Loading