Class ReadRowsResumptionStrategy (2.7.0)

public class ReadRowsResumptionStrategy implements StreamResumptionStrategy<Storage.ReadRowsRequest,Storage.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
TypeDescription
boolean

createNew()

public StreamResumptionStrategy<Storage.ReadRowsRequest,Storage.ReadRowsResponse> createNew()
Returns
TypeDescription
StreamResumptionStrategy<ReadRowsRequest,ReadRowsResponse>

getResumeRequest(Storage.ReadRowsRequest originalRequest)

public Storage.ReadRowsRequest getResumeRequest(Storage.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
NameDescription
originalRequestStorage.ReadRowsRequest
Returns
TypeDescription
Storage.ReadRowsRequest

processResponse(Storage.ReadRowsResponse response)

public Storage.ReadRowsResponse processResponse(Storage.ReadRowsResponse response)
Parameter
NameDescription
responseStorage.ReadRowsResponse
Returns
TypeDescription
Storage.ReadRowsResponse