Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bigquery): add BigLake API #11882

Merged
merged 5 commits into from
Jun 14, 2023
Merged
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
Binary file modified ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions ci/etc/expected_install_directories
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
./include/google/cloud/bigquery/analyticshub/v1
./include/google/cloud/bigquery/analyticshub/v1/internal
./include/google/cloud/bigquery/analyticshub/v1/mocks
./include/google/cloud/bigquery/biglake
./include/google/cloud/bigquery/biglake/v1
./include/google/cloud/bigquery/biglake/v1/internal
./include/google/cloud/bigquery/biglake/v1/mocks
./include/google/cloud/bigquery/connection
./include/google/cloud/bigquery/connection/v1
./include/google/cloud/bigquery/connection/v1/internal
Expand Down
1 change: 1 addition & 0 deletions external/googleapis/protolists/bigquery.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub.proto
@com_google_googleapis//google/cloud/bigquery/biglake/v1:metastore.proto
@com_google_googleapis//google/cloud/bigquery/connection/v1:connection.proto
@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicy.proto
@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer.proto
Expand Down
1 change: 1 addition & 0 deletions external/googleapis/update_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ declare -A -r LIBRARIES=(
# This is long enough that it needs to be kept in alphabetical order
printf ",%s" \
"@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc" \
"@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc" \
"@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc" \
"@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc" \
"@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc" \
Expand Down
7 changes: 7 additions & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ service {
retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/bigquery/biglake/v1/metastore.proto"
product_path: "google/cloud/bigquery/biglake/v1"
initial_copyright_year: "2023"
retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/bigquery/connection/v1/connection.proto"
product_path: "google/cloud/bigquery/connection/v1"
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigquery/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ licenses(["notice"]) # Apache 2.0

service_dirs = [
"",
"biglake/v1/",
"analyticshub/v1/",
"connection/v1/",
"datapolicies/v1/",
Expand Down Expand Up @@ -53,6 +54,7 @@ cc_library(
"//:common",
"//:grpc_utils",
"@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc",
"@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc",
"@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc",
"@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc",
"@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc",
Expand Down
14 changes: 14 additions & 0 deletions google/cloud/bigquery/biglake/v1/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"api_id": "biglake.googleapis.com",
"api_shortname": "biglake",
"client_documentation": "https://cloud.google.com/cpp/docs/reference/bigquery/latest",
"distribution_name": "google-cloud-cpp",
"issue_tracker": "https://issuetracker.google.com/issues?q=componentid:187149%20status=open",
"language": "cpp",
"library_type": "GAPIC_AUTO",
"name_pretty": "BigLake API",
"product_documentation": "https://cloud.google.com/bigquery/docs/iceberg-tables#create-using-biglake-metastore",
"release_level": "stable",
"repo": "googleapis/google-cloud-cpp",
"requires_billing": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/bigquery/biglake/v1/metastore.proto

#include "google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h"
#include <google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h>
#include <memory>

namespace google {
namespace cloud {
namespace bigquery_biglake_v1_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

MetastoreServiceAuth::MetastoreServiceAuth(
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
std::shared_ptr<MetastoreServiceStub> child)
: auth_(std::move(auth)), child_(std::move(child)) {}

StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
MetastoreServiceAuth::CreateCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->CreateCatalog(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
MetastoreServiceAuth::DeleteCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->DeleteCatalog(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
MetastoreServiceAuth::GetCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->GetCatalog(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::ListCatalogsResponse>
MetastoreServiceAuth::ListCatalogs(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListCatalogsRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->ListCatalogs(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Database>
MetastoreServiceAuth::CreateDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const&
request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->CreateDatabase(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Database>
MetastoreServiceAuth::DeleteDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const&
request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->DeleteDatabase(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Database>
MetastoreServiceAuth::UpdateDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const&
request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->UpdateDatabase(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Database>
MetastoreServiceAuth::GetDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->GetDatabase(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::ListDatabasesResponse>
MetastoreServiceAuth::ListDatabases(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->ListDatabases(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Table>
MetastoreServiceAuth::CreateTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateTableRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->CreateTable(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Table>
MetastoreServiceAuth::DeleteTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->DeleteTable(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Table>
MetastoreServiceAuth::UpdateTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->UpdateTable(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Table>
MetastoreServiceAuth::RenameTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::RenameTableRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->RenameTable(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::Table>
MetastoreServiceAuth::GetTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetTableRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->GetTable(context, request);
}

StatusOr<google::cloud::bigquery::biglake::v1::ListTablesResponse>
MetastoreServiceAuth::ListTables(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListTablesRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->ListTables(context, request);
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace bigquery_biglake_v1_internal
} // namespace cloud
} // namespace google
127 changes: 127 additions & 0 deletions google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/bigquery/biglake/v1/metastore.proto

#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H

#include "google/cloud/bigquery/biglake/v1/internal/metastore_stub.h"
#include "google/cloud/internal/unified_grpc_credentials.h"
#include "google/cloud/version.h"
#include <memory>
#include <set>
#include <string>

namespace google {
namespace cloud {
namespace bigquery_biglake_v1_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

class MetastoreServiceAuth : public MetastoreServiceStub {
public:
~MetastoreServiceAuth() override = default;
MetastoreServiceAuth(
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
std::shared_ptr<MetastoreServiceStub> child);

StatusOr<google::cloud::bigquery::biglake::v1::Catalog> CreateCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Catalog> DeleteCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Catalog> GetCatalog(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::ListCatalogsResponse>
ListCatalogs(grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListCatalogsRequest const&
request) override;

StatusOr<google::cloud::bigquery::biglake::v1::Database> CreateDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const&
request) override;

StatusOr<google::cloud::bigquery::biglake::v1::Database> DeleteDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const&
request) override;

StatusOr<google::cloud::bigquery::biglake::v1::Database> UpdateDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const&
request) override;

StatusOr<google::cloud::bigquery::biglake::v1::Database> GetDatabase(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::ListDatabasesResponse>
ListDatabases(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Table> CreateTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::CreateTableRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Table> DeleteTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Table> UpdateTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Table> RenameTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::RenameTableRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::Table> GetTable(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::GetTableRequest const& request)
override;

StatusOr<google::cloud::bigquery::biglake::v1::ListTablesResponse> ListTables(
grpc::ClientContext& context,
google::cloud::bigquery::biglake::v1::ListTablesRequest const& request)
override;

private:
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth_;
std::shared_ptr<MetastoreServiceStub> child_;
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace bigquery_biglake_v1_internal
} // namespace cloud
} // namespace google

#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H
Loading