Class ChangeStreamDao
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.ChangeStreamDao
-
public class ChangeStreamDao extends java.lang.Object
Responsible for making change stream queries for a given partition. The result will be given back as aResultSet
, which can be consumed until the stream is finished.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeStreamResultSet
changeStreamQuery(java.lang.String partitionToken, com.google.cloud.Timestamp startTimestamp, com.google.cloud.Timestamp endTimestamp, long heartbeatMillis)
Performs a change stream query.
-
-
-
Method Detail
-
changeStreamQuery
public ChangeStreamResultSet changeStreamQuery(java.lang.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 aChangeStreamResultSet
which can be consumed as a stream, yielding records until no more are available for the query made. Note that one needs to callChangeStreamResultSet.next()
to initiate the change stream query.- Parameters:
partitionToken
- the unique partition token to be queried. IfInitialPartition.PARTITION_TOKEN
is given, null will be used in the change stream query instead.startTimestamp
- the inclusive start time for the change stream queryendTimestamp
- the inclusive end time for the change stream queryheartbeatMillis
- 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
-
-