Class ReadRowsResumptionStrategy
- java.lang.Object
-
- com.google.cloud.bigquery.storage.v1beta2.stub.readrows.ReadRowsResumptionStrategy
-
- All Implemented Interfaces:
com.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
@InternalApi public class ReadRowsResumptionStrategy extends Object implements com.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
An implementation of aStreamResumptionStrategy
for the ReadRows API. This class tracks the offset of the last row received and, upon retry, attempts to resume the stream at the next offset.This class is considered an internal implementation detail and not meant to be used by applications.
-
-
Constructor Summary
Constructors Constructor Description ReadRowsResumptionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canResume()
com.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
createNew()
ReadRowsRequest
getResumeRequest(ReadRowsRequest originalRequest)
ReadRowsResponse
processResponse(ReadRowsResponse response)
-
-
-
Method Detail
-
createNew
@Nonnull public com.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse> createNew()
- Specified by:
createNew
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
-
processResponse
@Nonnull public ReadRowsResponse processResponse(ReadRowsResponse response)
- Specified by:
processResponse
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
-
getResumeRequest
public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest)
Given the initial/original request, this implementation generates a request that will yield a new stream whose first response would come right after the last response received by processResponse. It takes into account the offset from the original request.
- Specified by:
getResumeRequest
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
-
canResume
public boolean canResume()
- Specified by:
canResume
in interfacecom.google.api.gax.retrying.StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>
-
-