public class ConnectionWorker implements AutoCloseable
A BigQuery Stream Writer that can be used to write data into BigQuery Table.
TODO: Support batching.
Implements
AutoCloseableStatic Methods
getApiMaxRequestBytes()
public static long getApiMaxRequestBytes()
The maximum size of one request. Defined by the API.
Type | Description |
long |
Constructors
ConnectionWorker(String streamName, ProtoSchema writerSchema, long maxInflightRequests, long maxInflightBytes, FlowController.LimitExceededBehavior limitExceededBehavior, String traceId, BigQueryWriteClient client, boolean ownsBigQueryWriteClient)
public ConnectionWorker(String streamName, ProtoSchema writerSchema, long maxInflightRequests, long maxInflightBytes, FlowController.LimitExceededBehavior limitExceededBehavior, String traceId, BigQueryWriteClient client, boolean ownsBigQueryWriteClient)
Name | Description |
streamName | String |
writerSchema | ProtoSchema |
maxInflightRequests | long |
maxInflightBytes | long |
limitExceededBehavior | LimitExceededBehavior |
traceId | String |
client | BigQueryWriteClient |
ownsBigQueryWriteClient | boolean |
Methods
append(ProtoRows rows)
public ApiFuture<AppendRowsResponse> append(ProtoRows rows)
Schedules the writing of rows at the end of current stream.
Name | Description |
rows | ProtoRows |
Type | Description |
ApiFuture<AppendRowsResponse> |
append(ProtoRows rows, long offset)
public ApiFuture<AppendRowsResponse> append(ProtoRows rows, long offset)
Schedules the writing of rows at given offset.
Name | Description |
rows | ProtoRows |
offset | long |
Type | Description |
ApiFuture<AppendRowsResponse> |
close()
public void close()
Close the stream writer. Shut down all resources.
getInflightWaitSeconds()
public long getInflightWaitSeconds()
Type | Description |
long |
getUpdatedSchema()
public synchronized TableSchema getUpdatedSchema()
Thread-safe getter of updated TableSchema
Type | Description |
TableSchema |
getWriterId()
public String getWriterId()
Type | Description |
String | a unique Id for the writer. |