Google Cloud Bigtable C++ Client  0.8.0
A C++ Client Library for Google Cloud Bigtable
Google Cloud Platform Bigtable C++ Client Library

Overview

The Google Cloud Platform Bigtable C++ Client library offers types and functions access of GCP Bigtable from C++11 applications(Read more about GCP Bigtable). It offers access to the GCP Bigtable API, including operations to list, read, write, and delete Instances and Clusters, Tables and Application Profiles.

Quick Start

Before you begin

  1. Select or create a Google Cloud Platform (GCP) project.

    GO TO THE MANAGE RESOURCES PAGE

    Make a note of the project id, you will need to use it later.

  2. Make sure that billing is enabled for your project

    LEARN HOW TO ENABLE BILLING

  3. Enable the Cloud Bigtable and Cloud Bigtable Admin APIs.

    LEARN HOW TO ENABLE THE APIS

  4. Learn about key terms and concepts for GCP Bigtable.
  5. Setup the authentication for the examples.

    LEARN HOW TO CONFIGURE A SERVICE ACCOUNT

    LEARN HOW TO LOGIN WITH YOUR PERSONAL ACCOUNT

Download and Compile C++ Client Library

The source code for the Cloud Bigtable C++ Client Library can be found on GitHub. Download or clone this repository as usual. The top-level README file in this repository includes detailed instructions on how to compile the library. The examples used in this guide should be automatically compiled when you follow said instructions.

Run the Quick Start Example

Quickstart Example

Use the library in your own project

Our continuous integration builds compile and test the code using both Bazel, and CMake. Integrating the GCP Bigtable C++ Client library should be easy if you use either.

Integrating with Bazel

In your WORKSPACE file add a dependency to download and install the library, for example:

# Change the version and SHA256 hash as needed.
http_archive(
name = "com_github_googleapis_google_cloud_cpp",
url = "http://github.com/googleapis/google-cloud-cpp/archive/v0.2.0.tar.gz",
sha256 = "5fa6577828e5f949178b13ed0411dd634527c9d2d8f00e433edbd6ef9e42a281"
)

Then load the dependencies of the library:

load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
google_cloud_cpp_deps()
# Have to manually call the corresponding function for gRPC:
# https://github.com/bazelbuild/bazel/issues/1550
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

You can now use the library as a dependency in your BUILD files, for example:

cc_binary(
name = "my_program",
srcs = [
"my_program.cc",
],
deps = [
"@com_github_googleapis_google_cloud_cpp//google/cloud/bigtable:bigtable_client",
],
)

Integrating with CMake

Note
This assumes that you have downloaded and installed the dependencies of the library. Please check the top-level README on GitHub for details.

Compile and install the library using the normal cycle:

cd google-cloud-cpp
cmake -H. -Bbuild-output
cmake --build build-output/google/cloud/bigtable -- -j $(nproc)
cmake --build build-output/google/cloud/bigtable --target install

Now that the library is installed, you can use it in your CMake list files:

find_package(bigtable_client 0.2.0 REQUIRED)
add_executable(my_program my_program.cc)
target_link_libraries(my_program bigtable_client)

Next Steps

Hello World Example

Instance Admin Example

Table Admin Example

Advanced Reading and Writing Example