Skip to content

Latest commit

 

History

History
170 lines (121 loc) · 6.41 KB

bigtable.rst

File metadata and controls

170 lines (121 loc) · 6.41 KB

Google Cloud Bigtable Operators

All examples below rely on the following variables, which can be passed via environment variables.

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

BigtableInstanceCreateOperator

Use the ~airflow.contrib.operators.gcp_bigtable_operator.BigtableInstanceCreateOperator to create a Google Cloud Bigtable instance.

If the Cloud Bigtable instance with the given ID exists, the operator does not compare its configuration and immediately succeeds. No changes are made to the existing instance.

Using the operator

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

BigtableInstanceDeleteOperator

Use the ~airflow.contrib.operators.gcp_bigtable_operator.BigtableInstanceDeleteOperator to delete a Google Cloud Bigtable instance.

Using the operator

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

BigtableClusterUpdateOperator

Use the ~airflow.contrib.operators.gcp_bigtable_operator.BigtableClusterUpdateOperator to modify number of nodes in a Cloud Bigtable cluster.

Using the operator

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

BigtableTableCreateOperator

Creates a table in a Cloud Bigtable instance.

If the table with given ID exists in the Cloud Bigtable instance, the operator compares the Column Families. If the Column Families are identical operator succeeds. Otherwise, the operator fails with the appropriate error message.

Using the operator

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

Advanced

When creating a table, you can specify the optional initial_split_keys and column_families. Please refer to the Python Client for Google Cloud Bigtable documentation for Table and for Column Families.

BigtableTableDeleteOperator

Use the ~airflow.contrib.operators.gcp_bigtable_operator.BigtableTableDeleteOperator to delete a table in Google Cloud Bigtable.

Using the operator

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py

BigtableTableWaitForReplicationSensor

You can create the operator with or without project id. If project id is missing it will be retrieved from the GCP connection used. Both variants are shown:

Use the ~airflow.contrib.operators.gcp_bigtable_operator.BigtableTableWaitForReplicationSensor to wait for the table to replicate fully.

The same arguments apply to this sensor as the BigtableTableCreateOperator.

Note: If the table or the Cloud Bigtable instance does not exist, this sensor waits for the table until timeout hits and does not raise any exception.

Using the operator

../../../../airflow/contrib/example_dags/example_gcp_bigtable_operators.py