Class ChangeStreamDao
java.lang.Object
org.apache.beam.sdk.io.gcp.bigtable.changestreams.dao.ChangeStreamDao
Data access object to list and read stream partitions of a table.
-
Constructor Summary
ConstructorsConstructorDescriptionChangeStreamDao
(com.google.cloud.bigtable.data.v2.BigtableDataClient dataClient, String tableId) -
Method Summary
Modifier and TypeMethodDescriptionList
<com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange> Returns the result from GenerateInitialChangeStreamPartitions API.com.google.api.gax.rpc.ServerStream
<com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord> readChangeStreamPartition
(PartitionRecord partition, StreamProgress streamProgress, Instant endTime, Duration heartbeatDuration) Streams a partition.
-
Constructor Details
-
ChangeStreamDao
public ChangeStreamDao(com.google.cloud.bigtable.data.v2.BigtableDataClient dataClient, String tableId)
-
-
Method Details
-
generateInitialChangeStreamPartitions
public List<com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange> generateInitialChangeStreamPartitions()Returns the result from GenerateInitialChangeStreamPartitions API.- Returns:
- list of StreamPartition
-
readChangeStreamPartition
public com.google.api.gax.rpc.ServerStream<com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord> readChangeStreamPartition(PartitionRecord partition, StreamProgress streamProgress, @Nullable Instant endTime, Duration heartbeatDuration) throws IOException Streams a partition.- Parameters:
partition
- the partition to streamstreamProgress
- may contain a continuation token for the stream requestendTime
- time to end the stream, may be nullheartbeatDuration
- period between heartbeat messages- Returns:
- stream of ReadChangeStreamResponse
- Throws:
IOException
- if the stream could not be started
-