CloudBigtableIO.Source (Apache Beam + Cloud Bigtable Connector 1.8.0 API)

Class CloudBigtableIO.Source

    • Field Detail

      • SOURCE_LOG

        protected static final org.slf4j.Logger SOURCE_LOG

        protected static final long SIZED_BASED_MAX_SPLIT_COUNT
        See Also:
        Constant Field Values
    • Method Detail

      • split

        public List<? extends BoundedSource<Result>> split(long desiredBundleSizeBytes,
                                                           PipelineOptions options)
                                                    throws Exception
        Splits the table based on keys that belong to tablets, known as "regions" in the HBase API. The current implementation uses the HBase RegionLocator interface, which calls BigtableDataClient.sampleRowKeys( under the covers. A CloudBigtableIO.SourceWithKeys may correspond to a single region or a portion of a region.

        If a split is smaller than a single region, the split is calculated based on the assumption that the data is distributed evenly between the region's startKey and stopKey. That assumption may not be correct for any specific start/stop key combination.

        This method is called internally by Beam. Do not call it directly.

        Specified by:
        split in class BoundedSource<Result>
        desiredBundleSizeBytes - The desired size for each bundle, in bytes.
        options - The pipeline options.
        A list of sources split into groups.
      • getEstimatedSizeBytes

        public long getEstimatedSizeBytes(PipelineOptions options)
                                   throws IOException
        Gets an estimated size based on data returned from BigtableDataClient.sampleRowKeys( The estimate will be high if a Scan is set on the CloudBigtableScanConfiguration; in such cases, the estimate will not take the Scan into account, and will return a larger estimate than what the CloudBigtableIO.Reader will actually read.
        options - The pipeline options.
        The estimated size of the data, in bytes.
      • getOutputCoder

        public Coder<Result> getOutputCoder()
      • isWithinRange

        protected static boolean isWithinRange(byte[] scanStartKey,
                                               byte[] scanEndKey,
                                               byte[] startKey,
                                               byte[] endKey)
        Checks if the range of the region is within the range of the scan.
      • getSampleRowKeys

        public List<> getSampleRowKeys()
                                                                                                           throws IOException
        Performs a call to get sample row keys from BigtableDataClient.sampleRowKeys( if they are not yet cached. The sample row keys give information about tablet key boundaries and estimated sizes.
      • validate

        public void validate()
        Validates the existence of the table in the configuration.
        validate in class Source<Result>

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Bigtable Documentation