CloudBigtableIO (Google Cloud Dataflow + Cloud Bigtable Connector 0.3.0 API)

com.google.cloud.bigtable.dataflow

Class CloudBigtableIO



  • public class CloudBigtableIO
    extends Object

    Utilities to create PTransforms for reading and writing Google Cloud Bigtable entities in a Cloud Dataflow pipeline.

    Google Cloud Bigtable offers you a fast, fully managed, massively scalable NoSQL database service that's ideal for web, mobile, and Internet of Things applications requiring terabytes to petabytes of data. Unlike comparable market offerings, Cloud Bigtable doesn't require you to sacrifice speed, scale, or cost efficiency when your applications grow. Cloud Bigtable has been battle-tested at Google for more than 10 years--it's the database driving major applications such as Google Analytics and Gmail.

    To use CloudBigtableIO, users must use gcloud to get a credential for Cloud Bigtable:

     $ gcloud auth login
     

    To read a PCollection from a table, with an optional Scan, use read(CloudBigtableScanConfiguration):

     
     PipelineOptions options = PipelineOptionsFactory.fromArgs(args).create();
     Pipeline p = Pipeline.create(options);
     PCollection<Result> = p.apply(
       Read.from(CloudBigtableIO.read(
          new CloudBigtableScanConfiguration.Builder()
              .withProjectId("project-id")
              .withZoneId("zone-id")
              .withClusterId("cluster-id")
              .withTableId("table-id")
              .build())));
     
     

    To write a PCollection to a table, use writeToTable(CloudBigtableTableConfiguration):

     
     PipelineOptions options =
         PipelineOptionsFactory.fromArgs(args).create();
     Pipeline p = Pipeline.create(options);
     PCollection<Mutation> mutationCollection = ...;
     mutationCollection.apply(
       CloudBigtableIO.writeToTable(
          new CloudBigtableScanConfiguration.Builder()
              .withProjectId("project-id")
              .withZoneId("zone-id")
              .withClusterId("cluster-id")
              .withTableId("table-id")
              .build()));
     
     
    • Constructor Detail

      • CloudBigtableIO

        public CloudBigtableIO()


Send feedback about...

Cloud Bigtable Documentation