@InternalApi(value="For internal usage only") public class ResponseQueueReader extends Object implements io.grpc.stub.StreamObserver<FlatRow>, io.grpc.stub.ClientResponseObserver<com.google.bigtable.v2.ReadRowsRequest,FlatRow>
ResultQueueEntry
s of FlatRow
.
For internal use only - public for technical reasons.
Constructor and Description |
---|
ResponseQueueReader()
Constructor for ResponseQueueReader.
|
Modifier and Type | Method and Description |
---|---|
void |
addRequestResultMarker()
This marker notifies
getNextMergedRow() to request more results and allows for flow
control based on the state of the resultQueue . |
int |
available()
available.
|
void |
beforeStart(io.grpc.stub.ClientCallStreamObserver<com.google.bigtable.v2.ReadRowsRequest> requestStream) |
void |
close() |
protected com.google.cloud.bigtable.grpc.scanner.ResultQueueEntry<FlatRow> |
getNext()
getNext.
|
FlatRow |
getNextMergedRow()
Get the next complete
FlatRow object from the response queue. |
void |
onCompleted() |
void |
onError(Throwable t) |
void |
onNext(FlatRow row) |
public ResponseQueueReader()
public void beforeStart(io.grpc.stub.ClientCallStreamObserver<com.google.bigtable.v2.ReadRowsRequest> requestStream)
beforeStart
in interface io.grpc.stub.ClientResponseObserver<com.google.bigtable.v2.ReadRowsRequest,FlatRow>
public void close()
public FlatRow getNextMergedRow() throws IOException
FlatRow
object from the response queue.FlatRow
.IOException
- On errors.protected com.google.cloud.bigtable.grpc.scanner.ResultQueueEntry<FlatRow> getNext() throws IOException
ResultQueueEntry
object.IOException
- if any.public int available()
public void onNext(FlatRow row)
onNext
in interface io.grpc.stub.StreamObserver<FlatRow>
public void onError(Throwable t)
onError
in interface io.grpc.stub.StreamObserver<FlatRow>
public void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<FlatRow>
public void addRequestResultMarker()
getNextMergedRow()
to request more results and allows for flow
control based on the state of the resultQueue
. If rows are removed from the queue
quickly, getNextMergedRow()
will request more results. If rows are not read fast
enough, then gRPC will stop fetching rows, and will wait until more rows are requested. This
marker tells getNextMergedRow()
to read more rows.