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

docs(bigtable): clean up CreateTable sample #10844

Merged
merged 1 commit into from
Feb 16, 2023
Merged
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
16 changes: 8 additions & 8 deletions google/cloud/bigtable/examples/bigtable_hello_world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ void BigtableHelloWorld(std::vector<std::string> const& argv) {
using ::google::cloud::StatusOr;
//! [aliases]

// Connect to the Cloud Bigtable Admin API.
//! [connect admin] [START bigtable_hw_connect]
// Connect to the Cloud Bigtable Admin API.
cbta::BigtableTableAdminClient table_admin(
cbta::MakeBigtableTableAdminConnection());

//! [connect data]
// Create an object to access the Cloud Bigtable Data API.
cbt::Table table(cbt::MakeDataConnection(),
cbt::TableResource(project_id, instance_id, table_id));
//! [connect data]
//! [connect admin] [END bigtable_hw_connect]

//! [create table] [START bigtable_hw_create_table]
Expand All @@ -61,13 +67,7 @@ void BigtableHelloWorld(std::vector<std::string> const& argv) {
std::string instance_name = cbt::InstanceName(project_id, instance_id);
StatusOr<google::bigtable::admin::v2::Table> schema =
table_admin.CreateTable(instance_name, table_id, std::move(t));
//! [create table]

// Create an object to access the Cloud Bigtable Data API.
//! [connect data]
cbt::Table table(cbt::MakeDataConnection(),
cbt::TableResource(project_id, instance_id, table_id));
//! [connect data] [END bigtable_hw_create_table]
//! [create table] [END bigtable_hw_create_table]

// Modify (and create if necessary) a row.
//! [write rows] [START bigtable_hw_write_rows]
Expand Down