Class ChangeStreamDao


  • @Internal
    public class ChangeStreamDao
    extends java.lang.Object
    Data access object to list and read stream partitions of a table.
    • Constructor Summary

      Constructors 
      Constructor Description
      ChangeStreamDao​(com.google.cloud.bigtable.data.v2.BigtableDataClient dataClient, java.lang.String tableId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange> generateInitialChangeStreamPartitions()
      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, org.joda.time.Instant endTime, org.joda.time.Duration heartbeatDuration)
      Streams a partition.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChangeStreamDao

        public ChangeStreamDao​(com.google.cloud.bigtable.data.v2.BigtableDataClient dataClient,
                               java.lang.String tableId)
    • Method Detail

      • generateInitialChangeStreamPartitions

        public java.util.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
                                                                                                                                          org.joda.time.Instant endTime,
                                                                                                                                          org.joda.time.Duration heartbeatDuration)
                                                                                                                                   throws java.io.IOException
        Streams a partition.
        Parameters:
        partition - the partition to stream
        streamProgress - may contain a continuation token for the stream request
        endTime - time to end the stream, may be null
        heartbeatDuration - period between heartbeat messages
        Returns:
        stream of ReadChangeStreamResponse
        Throws:
        java.io.IOException - if the stream could not be started