Class SpannerIO.ReadChangeStream

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData
    Enclosing class:
    SpannerIO

    public abstract static class SpannerIO.ReadChangeStream
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,​org.apache.beam.sdk.values.PCollection<DataChangeRecord>>
    See Also:
    Serialized Form
    • Constructor Detail

      • ReadChangeStream

        public ReadChangeStream()
    • Method Detail

      • withProjectId

        public SpannerIO.ReadChangeStream withProjectId​(java.lang.String projectId)
        Specifies the Cloud Spanner project.
      • withProjectId

        public SpannerIO.ReadChangeStream withProjectId​(org.apache.beam.sdk.options.ValueProvider<java.lang.String> projectId)
        Specifies the Cloud Spanner project.
      • withInstanceId

        public SpannerIO.ReadChangeStream withInstanceId​(java.lang.String instanceId)
        Specifies the Cloud Spanner instance.
      • withInstanceId

        public SpannerIO.ReadChangeStream withInstanceId​(org.apache.beam.sdk.options.ValueProvider<java.lang.String> instanceId)
        Specifies the Cloud Spanner instance.
      • withDatabaseId

        public SpannerIO.ReadChangeStream withDatabaseId​(java.lang.String databaseId)
        Specifies the Cloud Spanner database.
      • withDatabaseId

        public SpannerIO.ReadChangeStream withDatabaseId​(org.apache.beam.sdk.options.ValueProvider<java.lang.String> databaseId)
        Specifies the Cloud Spanner database.
      • withChangeStreamName

        public SpannerIO.ReadChangeStream withChangeStreamName​(java.lang.String changeStreamName)
        Specifies the change stream name.
      • withTvfNameList

        public SpannerIO.ReadChangeStream withTvfNameList​(java.util.List<java.lang.String> tvfNameList)
        Specifies the list of TVF names to query and union.
      • withMetadataInstance

        public SpannerIO.ReadChangeStream withMetadataInstance​(java.lang.String metadataInstance)
        Specifies the metadata database.
      • withMetadataDatabase

        public SpannerIO.ReadChangeStream withMetadataDatabase​(java.lang.String metadataDatabase)
        Specifies the metadata database.
      • withMetadataTable

        public SpannerIO.ReadChangeStream withMetadataTable​(java.lang.String metadataTable)
        Specifies the metadata table name.
      • withInclusiveStartAt

        public SpannerIO.ReadChangeStream withInclusiveStartAt​(com.google.cloud.Timestamp timestamp)
        Specifies the time that the change stream should be read from.
      • withInclusiveEndAt

        public SpannerIO.ReadChangeStream withInclusiveEndAt​(com.google.cloud.Timestamp timestamp)
        Specifies the end time of the change stream.
      • withRpcPriority

        public SpannerIO.ReadChangeStream withRpcPriority​(com.google.cloud.spanner.Options.RpcPriority rpcPriority)
        Specifies the priority of the change stream queries.
      • withTraceSampleProbability

        @Deprecated
        public SpannerIO.ReadChangeStream withTraceSampleProbability​(java.lang.Double probability)
        Deprecated.
        This configuration has no effect, as tracing is not available.
        Specifies the sample probability of tracing requests.
      • withExperimentalHost

        public SpannerIO.ReadChangeStream withExperimentalHost​(org.apache.beam.sdk.options.ValueProvider<java.lang.String> experimentalHost)
        Specifies the experimental host to set on SpannerOptions (setExperimentalHost).
      • withExperimentalHost

        public SpannerIO.ReadChangeStream withExperimentalHost​(java.lang.String experimentalHost)
        Specifies the experimental host to set on SpannerOptions (setExperimentalHost).
      • withUsingPlainTextChannel

        public SpannerIO.ReadChangeStream withUsingPlainTextChannel​(org.apache.beam.sdk.options.ValueProvider<java.lang.Boolean> plainText)
        Specifies whether to use plaintext channel.

        Note: This parameter is only valid when using an experimental host (set via withExperimentalHost).

      • withUsingPlainTextChannel

        public SpannerIO.ReadChangeStream withUsingPlainTextChannel​(boolean plainText)
        Specifies whether to use plaintext channel.

        Note: This parameter is only valid when using an experimental host (set via withExperimentalHost).

      • withClientCert

        public SpannerIO.ReadChangeStream withClientCert​(org.apache.beam.sdk.options.ValueProvider<java.lang.String> certPath,
                                                         org.apache.beam.sdk.options.ValueProvider<java.lang.String> keyPath)
        Specifies certificate paths to use for mTLS channel.

        Note: These parameters are only valid when using Spanner Omni (set via withExperimentalHost).

        Parameters:
        certPath - Path to the client certificate file.
        keyPath - Path to the client certificate key file.
      • withClientCert

        public SpannerIO.ReadChangeStream withClientCert​(java.lang.String certPath,
                                                         java.lang.String keyPath)
        Specifies certificate paths to use for mTLS channel.

        Note: These parameters are only valid when using Spanner Omni (set via withExperimentalHost).

        Parameters:
        certPath - Path to the client certificate file.
        keyPath - Path to the client certificate key file.
      • withLowLatency

        public SpannerIO.ReadChangeStream withLowLatency()
        Configures low latency experiment for readChangeStream transform. Example usage:
        
         PCollection<Struct> rows = p.apply(
            SpannerIO.readChangeStream()
            .withSpannerConfig(
               SpannerConfig.create()
                 .withProjectId(projectId)
                 .withInstanceId(instanceId)
                 .withDatabaseId(dbId))
            .withChangeStreamName(changeStreamName)
            .withMetadataInstance(metadataInstanceId)
            .withMetadataDatabase(metadataDatabase)
            .withInclusiveStartAt(Timestamp.now()))
            .withLowLatency();
         
      • expand

        public org.apache.beam.sdk.values.PCollection<DataChangeRecord> expand​(org.apache.beam.sdk.values.PBegin input)
        Specified by:
        expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,​org.apache.beam.sdk.values.PCollection<DataChangeRecord>>