public class StreamConnection extends Object
StreamWriter creates a connection. Two callback functions are necessary: request_callback and done_callback. Request callback is used for every request, and done callback is used to notify the user that the connection is closed and no more callbacks will be received from this connection.
The stream writer will accept all the requests without flow control, and makes the callbacks in receiving order.
It's user's responsibility to do the flow control and maintain the lifetime of the requests.
| Modifier and Type | Class and Description |
|---|---|
static interface |
StreamConnection.DoneCallback
Invoked when server closes the connection.
|
static interface |
StreamConnection.RequestCallback
Invoked when a response is received from the server.
|
| Constructor and Description |
|---|
StreamConnection(BigQueryWriteClient client,
StreamConnection.RequestCallback requestCallback,
StreamConnection.DoneCallback doneCallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the bi-directional stream connection.
|
void |
send(AppendRowsRequest request)
Sends a request to the bi-directional stream connection.
|
public StreamConnection(BigQueryWriteClient client, StreamConnection.RequestCallback requestCallback, StreamConnection.DoneCallback doneCallback)
public void send(AppendRowsRequest request)
request - request to send.public void close()
Copyright © 2023 Google LLC. All rights reserved.