Using the Cloud Bigtable Emulator

The Cloud SDK provides a local, in-memory emulator for Cloud Bigtable, which you can use to test your application. Since the emulator stores data only in memory, it will not persist data across runs. Thus, it is intended for getting familiar with the Cloud Bigtable API during local development and testing scenarios, and not for production deployments.

You can use the emulator with the HBase client for Java, Go client, or Python client.

Note that the emulator does not provide administrative APIs to create or manage instances and clusters. After the emulator starts up, you can connect to it using any project and instance name to create tables and read or write data.

Installing the emulator

To install the Cloud Bigtable emulator:

  1. Install the Cloud SDK.

  2. Update your gcloud installation to get the latest features:

    gcloud components update beta
    
  3. Run the following command to start the emulator:

    gcloud beta emulators bigtable start
    

    If the emulator is not installed already, you will be prompted to download and install the binary for the emulator.

  4. Type Control-C to stop the emulator.

Using the emulator

To use the Cloud Bigtable emulator:

  1. Run the following command to start the Cloud Bigtable emulator:

    gcloud beta emulators bigtable start
    

    The emulator prints the host and port number where it is running.

  2. In the environment for your application, set the BIGTABLE_EMULATOR_HOST environment variable to the host and port where the Cloud Bigtable emulator is running (for example, myhost.example.com:8010).

    If you are running the emulator on the same machine as your application, you can use the following command to set this environment variable automatically:

    $(gcloud beta emulators bigtable env-init)
    
  3. Run your application.

  4. When you are done using the emulator, type Control-C to stop the emulator.

Filters

The following table shows which filters are currently supported.

Supported Not supported
chain
interleave
family_name_regex
column_qualifier_regex
value_regex
column_range
cells_per_column_limit
condition
sink
pass_all
block_all
row_key_regex
row_sample
timestamp_range
value_range_filter
cells_per_row_offset_filter
cells_per_row_limit_filter
strip_value_transformer

Issues related to Cloud Bigtable emulator development are tracked in the google-cloud-go GitHub repository, where you can file feature requests or comment on existing requests.

Send feedback about...

Cloud Bigtable Documentation