public class ConnectionWorker extends Object implements AutoCloseable
TODO: Support batching.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConnectionWorker.Load
Represent the current workload for this worker.
|
| Constructor and Description |
|---|
ConnectionWorker(String streamName,
ProtoSchema writerSchema,
long maxInflightRequests,
long maxInflightBytes,
com.google.api.gax.batching.FlowController.LimitExceededBehavior limitExceededBehavior,
String traceId,
BigQueryWriteClient client,
boolean ownsBigQueryWriteClient) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.core.ApiFuture<AppendRowsResponse> |
append(ProtoRows rows)
Schedules the writing of rows at the end of current stream.
|
com.google.api.core.ApiFuture<AppendRowsResponse> |
append(ProtoRows rows,
long offset)
Schedules the writing of rows at given offset.
|
void |
close()
Close the stream writer.
|
static long |
getApiMaxRequestBytes()
The maximum size of one request.
|
long |
getInflightWaitSeconds() |
TableSchema |
getUpdatedSchema()
Thread-safe getter of updated TableSchema
|
String |
getWriterId() |
public ConnectionWorker(String streamName, ProtoSchema writerSchema, long maxInflightRequests, long maxInflightBytes, com.google.api.gax.batching.FlowController.LimitExceededBehavior limitExceededBehavior, String traceId, BigQueryWriteClient client, boolean ownsBigQueryWriteClient) throws IOException
IOExceptionpublic static long getApiMaxRequestBytes()
public com.google.api.core.ApiFuture<AppendRowsResponse> append(ProtoRows rows)
public com.google.api.core.ApiFuture<AppendRowsResponse> append(ProtoRows rows, long offset)
public long getInflightWaitSeconds()
public String getWriterId()
public void close()
close in interface AutoCloseablepublic TableSchema getUpdatedSchema()
Copyright © 2022 Google LLC. All rights reserved.