Class ReadRowsResumptionStrategy (3.8.0)

public class ReadRowsResumptionStrategy implements StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>

An implementation of a StreamResumptionStrategy 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.

Inheritance

java.lang.Object > ReadRowsResumptionStrategy

Constructors

ReadRowsResumptionStrategy()

public ReadRowsResumptionStrategy()

Methods

canResume()

public boolean canResume()
Returns
Type Description
boolean

createNew()

public StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse> createNew()
Returns
Type Description
StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>

getResumeRequest(ReadRowsRequest originalRequest)

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.

Parameter
Name Description
originalRequest ReadRowsRequest
Returns
Type Description
ReadRowsRequest

processResponse(ReadRowsResponse response)

public ReadRowsResponse processResponse(ReadRowsResponse response)
Parameter
Name Description
response ReadRowsResponse
Returns
Type Description
ReadRowsResponse