Class JsonStreamWriter.Builder (3.6.0)

public static final class JsonStreamWriter.Builder

Inheritance

Object > JsonStreamWriter.Builder

Methods

build()

public JsonStreamWriter build()

Builds JsonStreamWriter

Returns
Type Description
JsonStreamWriter

JsonStreamWriter

Exceptions
Type Description
DescriptorValidationException
IllegalArgumentException
IOException
InterruptedException

getStreamName()

public String getStreamName()

Stream name on the builder.

Returns
Type Description
String

Builder

setChannelProvider(TransportChannelProvider channelProvider)

public JsonStreamWriter.Builder setChannelProvider(TransportChannelProvider channelProvider)

Setter for the underlying StreamWriter's TransportChannelProvider.

Parameter
Name Description
channelProvider TransportChannelProvider
Returns
Type Description
JsonStreamWriter.Builder

Builder

setCompressorName(String compressorName)

public JsonStreamWriter.Builder setCompressorName(String compressorName)

Sets the compression to use for the calls. The compressor must be of type gzip.

Parameter
Name Description
compressorName String
Returns
Type Description
JsonStreamWriter.Builder

Builder

setCredentialsProvider(CredentialsProvider credentialsProvider)

public JsonStreamWriter.Builder setCredentialsProvider(CredentialsProvider credentialsProvider)

Setter for the underlying StreamWriter's CredentialsProvider.

Parameter
Name Description
credentialsProvider CredentialsProvider
Returns
Type Description
JsonStreamWriter.Builder

Builder

setDefaultMissingValueInterpretation(AppendRowsRequest.MissingValueInterpretation defaultMissingValueInterpretation)

public JsonStreamWriter.Builder setDefaultMissingValueInterpretation(AppendRowsRequest.MissingValueInterpretation defaultMissingValueInterpretation)

Sets the default missing value interpretation value if the column is not presented in the missing_value_interpretations map.

If this value is set to DEFAULT_VALUE, we will always populate default value if the field is missing from json and default value is defined in the column.

If this value is set to NULL_VALUE, we will always not populate default value.

Parameter
Name Description
defaultMissingValueInterpretation AppendRowsRequest.MissingValueInterpretation
Returns
Type Description
JsonStreamWriter.Builder

setEnableConnectionPool(boolean enableConnectionPool)

public JsonStreamWriter.Builder setEnableConnectionPool(boolean enableConnectionPool)

Enable multiplexing for this writer. In multiplexing mode tables will share the same connection if possible until the connection is overwhelmed.

Parameter
Name Description
enableConnectionPool boolean
Returns
Type Description
JsonStreamWriter.Builder

Builder

setEndpoint(String endpoint)

public JsonStreamWriter.Builder setEndpoint(String endpoint)

Setter for the underlying StreamWriter's Endpoint.

Parameter
Name Description
endpoint String
Returns
Type Description
JsonStreamWriter.Builder

Builder

setExecutorProvider(ExecutorProvider executorProvider)

public JsonStreamWriter.Builder setExecutorProvider(ExecutorProvider executorProvider)

Setter for the underlying StreamWriter's ExecutorProvider.

Parameter
Name Description
executorProvider ExecutorProvider
Returns
Type Description
JsonStreamWriter.Builder

setFlowControlSettings(FlowControlSettings flowControlSettings)

public JsonStreamWriter.Builder setFlowControlSettings(FlowControlSettings flowControlSettings)

Setter for the underlying StreamWriter's FlowControlSettings.

Parameter
Name Description
flowControlSettings FlowControlSettings
Returns
Type Description
JsonStreamWriter.Builder

Builder

setIgnoreUnknownFields(boolean ignoreUnknownFields)

public JsonStreamWriter.Builder setIgnoreUnknownFields(boolean ignoreUnknownFields)

Setter for a ignoreUnkownFields, if true, unknown Json fields to BigQuery will be ignored instead of error out.

Parameter
Name Description
ignoreUnknownFields boolean
Returns
Type Description
JsonStreamWriter.Builder

Builder

setLocation(String location)

public JsonStreamWriter.Builder setLocation(String location)

Location of the table this stream writer is targeting. Connection pools are shared by location.

Parameter
Name Description
location String
Returns
Type Description
JsonStreamWriter.Builder

Builder

setReconnectAfter10M(boolean reconnectAfter10M)

public JsonStreamWriter.Builder setReconnectAfter10M(boolean reconnectAfter10M)

This parameter is not used. It will be removed soon.

Parameter
Name Description
reconnectAfter10M boolean
Returns
Type Description
JsonStreamWriter.Builder

setRetrySettings(RetrySettings retrySettings)

public JsonStreamWriter.Builder setRetrySettings(RetrySettings retrySettings)

Enable client lib automatic retries on request level errors.

Immediate 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();

Parameter
Name Description
retrySettings RetrySettings
Returns
Type Description
JsonStreamWriter.Builder

setTraceId(String traceId)

public JsonStreamWriter.Builder setTraceId(String traceId)

Setter for a traceId to help identify traffic origin.

Parameter
Name Description
traceId String
Returns
Type Description
JsonStreamWriter.Builder

Builder