Class ReadChangeStreamResumptionStrategy<ChangeStreamRecordT>
java.lang.Object
com.google.cloud.bigtable.data.v2.stub.changestream.ReadChangeStreamResumptionStrategy<ChangeStreamRecordT>
- All Implemented Interfaces:
com.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT>
@InternalApi
public class ReadChangeStreamResumptionStrategy<ChangeStreamRecordT>
extends Object
implements com.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,ChangeStreamRecordT>
An implementation of a
StreamResumptionStrategy
for change stream records. This class
tracks the continuation token and upon retry can build a request to resume the stream from where
it left off.
This class is considered an internal implementation detail and not meant to be used by applications.
-
Constructor Summary
ConstructorDescriptionReadChangeStreamResumptionStrategy
(ChangeStreamRecordAdapter<ChangeStreamRecordT> changeStreamRecordAdapter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
com.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT> com.google.bigtable.v2.ReadChangeStreamRequest
getResumeRequest
(com.google.bigtable.v2.ReadChangeStreamRequest originalRequest) processResponse
(ChangeStreamRecordT response)
-
Constructor Details
-
ReadChangeStreamResumptionStrategy
public ReadChangeStreamResumptionStrategy(ChangeStreamRecordAdapter<ChangeStreamRecordT> changeStreamRecordAdapter)
-
-
Method Details
-
canResume
public boolean canResume()- Specified by:
canResume
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT>
-
createNew
public com.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,ChangeStreamRecordT> createNew()- Specified by:
createNew
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT>
-
processResponse
- Specified by:
processResponse
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT>
-
getResumeRequest
public com.google.bigtable.v2.ReadChangeStreamRequest getResumeRequest(com.google.bigtable.v2.ReadChangeStreamRequest originalRequest) Given a request, this implementation will narrow that request to include data changes that come after
token
.- Specified by:
getResumeRequest
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<com.google.bigtable.v2.ReadChangeStreamRequest,
ChangeStreamRecordT>
-