Crie uma tabela com streams de alterações ativadas e capture alterações
Saiba como configurar uma tabela do Bigtable com um fluxo de alterações ativado, executar um pipeline de fluxo de alterações, fazer alterações à sua tabela e, em seguida, ver as alterações transmitidas.
Antes de começar
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Dataflow, Cloud Bigtable API, and Cloud Bigtable Admin API APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
In the Google Cloud console, activate Cloud Shell.
Crie uma tabela com uma stream de alterações ativada
Na Google Cloud consola, aceda à página Instances do Bigtable.
Clique no ID da instância que está a usar para este início rápido.
Se não tiver uma instância disponível, crie uma instância com as configurações predefinidas numa região perto de si.
No painel de navegação do lado esquerdo, clique em Tabelas.
Clique em Criar tabela.
Atribua um nome à tabela
change-streams-quickstart.Adicione uma família de colunas com o nome
cf.Selecione Ativar stream de alterações.
Clique em Criar.
Inicialize um pipeline de dados para capturar a stream de alterações
No Cloud Shell, execute os seguintes comandos para transferir o código e executá-lo.