java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.ChangeStreamDao

public class ChangeStreamDao extends Object
Responsible for making change stream queries for a given partition. The result will be given back as a ResultSet, which can be consumed until the stream is finished.
  • Method Details

    • changeStreamQuery

      public ChangeStreamResultSet changeStreamQuery(String partitionToken, com.google.cloud.Timestamp startTimestamp, com.google.cloud.Timestamp endTimestamp, long heartbeatMillis)
      Performs a change stream query. If the partition token given is the initial partition null will be used in the query instead. The change stream query will be tagged as following: "job=<jobName>". The result will be given as a ChangeStreamResultSet which can be consumed as a stream, yielding records until no more are available for the query made. Note that one needs to call ChangeStreamResultSet.next() to initiate the change stream query.
      Parameters:
      partitionToken - the unique partition token to be queried. If InitialPartition.PARTITION_TOKEN is given, null will be used in the change stream query instead.
      startTimestamp - the inclusive start time for the change stream query
      endTimestamp - the inclusive end time for the change stream query
      heartbeatMillis - the number of milliseconds after the stream is idle, which a heartbeat record will be emitted in the change stream query
      Returns:
      a ChangeStreamResultSet that will produce a stream of records for the change stream query