Class StreamWriter.Builder
java.lang.Object
com.google.cloud.bigquery.storage.v1.StreamWriter.Builder
- Enclosing class:
- StreamWriter
A builder of
StreamWriters.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theStreamWriterV2.setChannelProvider(com.google.api.gax.rpc.TransportChannelProvider channelProvider) ChannelProviderto use to create Channels, which must point at Cloud BigQuery Storage API endpoint.setCompressorName(String compressorName) setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider) CredentialsProviderto use to create Credentials to authenticate calls.setDefaultMissingValueInterpretation(AppendRowsRequest.MissingValueInterpretation defaultMissingValueInterpretation) Sets the default missing value interpretation value if the column is not presented in the missing_value_interpretations map.setEnableConnectionPool(boolean enableConnectionPool) Enables a static shared bidi-streaming connection pool that would dynamically scale up connections based on backlog within each individual connection.setEnableLatencyProfiler(boolean enableLatencyProfiler) Enable a latency profiler that would periodically generate a detailed latency report for the top latency requests.setEnableOpenTelemetry(boolean enableOpenTelemetry) Enable generation of metrics for OpenTelemetry.setEndpoint(String endpoint) Gives the ability to override the gRPC endpoint.setExecutorProvider(com.google.api.gax.core.ExecutorProvider executorProvider) ExecutorProviderto use to create Executor to run background jobs.setLimitExceededBehavior(com.google.api.gax.batching.FlowController.LimitExceededBehavior limitExceededBehavior) Sets the limit exceeded behavior.setLocation(String location) Location of the table this stream writer is targeting.setMaxInflightBytes(long value) setMaxInflightRequests(long value) setMaxRetryDuration(Duration maxRetryDuration) setMissingValueInterpretationMap(Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) Sets the missing value interpretation map for the stream writer.setRetrySettings(com.google.api.gax.retrying.RetrySettings retrySettings) Enable client lib automatic retries on request level errors.setTraceId(String traceId) Sets traceId for debuging purpose.setWriterSchema(ArrowSchema arrowSchema) Sets the user provided serialized Arrow schema of the rows.setWriterSchema(ProtoSchema protoSchema) Sets the user provided proto schema of the rows.setWriterSchema(org.apache.arrow.vector.types.pojo.Schema arrowSchema) Sets the user provided unserialized Arrow schema of the rows.
-
Method Details
-
setWriterSchema
Sets the user provided proto schema of the rows. -
setWriterSchema
Sets the user provided serialized Arrow schema of the rows. -
setWriterSchema
@CanIgnoreReturnValue public StreamWriter.Builder setWriterSchema(org.apache.arrow.vector.types.pojo.Schema arrowSchema) Sets the user provided unserialized Arrow schema of the rows. -
setMaxInflightRequests
-
setMaxInflightBytes
-
setEndpoint
Gives the ability to override the gRPC endpoint. -
setEnableConnectionPool
Enables a static shared bidi-streaming connection pool that would dynamically scale up connections based on backlog within each individual connection. A single table's traffic might be splitted into multiple connections if needed. Different tables' traffic can also be multiplexed within the same connection.Each connection pool would have a upper limit (default to 20) and lower limit (default to 2) for the number of active connections. This parameter can be tuned via a static method exposed on
ConnectionWorkerPool. Example: ConnectionWorkerPool.setOptions( Settings.builder().setMinConnectionsPerRegion(4).setMaxConnectionsPerRegion(10).build());- Parameters:
enableConnectionPool-- Returns:
- Builder
-
setChannelProvider
public StreamWriter.Builder setChannelProvider(com.google.api.gax.rpc.TransportChannelProvider channelProvider) ChannelProviderto use to create Channels, which must point at Cloud BigQuery Storage API endpoint.For performance, this client benefits from having multiple underlying connections. See
InstantiatingGrpcChannelProvider.Builder.setPoolSize(int). -
setCredentialsProvider
public StreamWriter.Builder setCredentialsProvider(com.google.api.gax.core.CredentialsProvider credentialsProvider) CredentialsProviderto use to create Credentials to authenticate calls. -
setExecutorProvider
public StreamWriter.Builder setExecutorProvider(com.google.api.gax.core.ExecutorProvider executorProvider) ExecutorProviderto use to create Executor to run background jobs. -
setTraceId
Sets traceId for debuging purpose. TraceId must follow the format of CustomerDomain:DebugString, e.g. DATAFLOW:job_id_x. -
setLocation
Location of the table this stream writer is targeting. -
setLimitExceededBehavior
public StreamWriter.Builder setLimitExceededBehavior(com.google.api.gax.batching.FlowController.LimitExceededBehavior limitExceededBehavior) throws io.grpc.StatusRuntimeException Sets the limit exceeded behavior.- Parameters:
limitExceededBehavior-- Returns:
- Throws:
io.grpc.StatusRuntimeException
-
setMaxRetryDuration
-
setCompressorName
-
setDefaultMissingValueInterpretation
public StreamWriter.Builder setDefaultMissingValueInterpretation(AppendRowsRequest.MissingValueInterpretation defaultMissingValueInterpretation) Sets the default missing value interpretation value if the column is not presented in the missing_value_interpretations map. -
setMissingValueInterpretationMap
public StreamWriter.Builder setMissingValueInterpretationMap(Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) Sets the missing value interpretation map for the stream writer. The input missingValueInterpretationMap is used for all write requests unless otherwise changed.- Parameters:
missingValueInterpretationMap- the missing value interpretation map used by stream writer.- Returns:
- Builder
-
setEnableLatencyProfiler
Enable a latency profiler that would periodically generate a detailed latency report for the top latency requests. This is currently an experimental API. -
setEnableOpenTelemetry
Enable generation of metrics for OpenTelemetry. -
setRetrySettings
public StreamWriter.Builder setRetrySettings(com.google.api.gax.retrying.RetrySettings retrySettings) Enable client lib automatic retries on request level errors.Immeidate Retry code: ABORTED, UNAVAILABLE, CANCELLED, INTERNAL, DEADLINE_EXCEEDED Backoff Retry code: RESOURCE_EXHAUSTED Example: RetrySettings retrySettings = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(500)) // applies to backoff retry .setRetryDelayMultiplier(1.1) // applies to backoff retry .setMaxAttempts(5) // applies to both retries .setMaxRetryDelay(Duration.ofMinutes(1)) // applies to backoff retry .build();- Parameters:
retrySettings-- Returns:
-
build
Builds theStreamWriterV2.- Throws:
IOException
-