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

  1. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. 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 the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  4. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    Crie uma tabela com uma stream de alterações ativada

    1. Na Google Cloud consola, aceda à página Instances do Bigtable.

      Aceda a Instâncias

    2. 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.

    3. No painel de navegação do lado esquerdo, clique em Tabelas.

    4. Clique em Criar tabela.

    5. Atribua um nome à tabela change-streams-quickstart.

    6. Adicione uma família de colunas com o nome cf.

    7. Selecione Ativar stream de alterações.

    8. Clique em Criar.

    Inicialize um pipeline de dados para capturar a stream de alterações

    1. No Cloud Shell, execute os seguintes comandos para transferir o código e executá-lo.