File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
samples/snippets/src/main/java/com/example/bigquerystorage Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 2020import com .google .api .core .ApiFuture ;
2121import com .google .api .core .ApiFutureCallback ;
2222import com .google .api .core .ApiFutures ;
23+ import com .google .api .gax .batching .FlowControlSettings ;
2324import com .google .api .gax .core .FixedExecutorProvider ;
2425import com .google .api .gax .retrying .RetrySettings ;
2526import com .google .cloud .bigquery .BigQuery ;
@@ -184,6 +185,9 @@ private JsonStreamWriter createStreamWriter(String tableName)
184185 .setChannelsPerCpu (2 )
185186 .build ())
186187 .setEnableConnectionPool (true )
188+ // This will allow connection pool to scale up better.
189+ .setFlowControlSettings (
190+ FlowControlSettings .newBuilder ().setMaxOutstandingElementCount (100L ).build ())
187191 // If value is missing in json and there is a default value configured on bigquery
188192 // column, apply the default value to the missing value field.
189193 .setDefaultMissingValueInterpretation (
You can’t perform that action at this time.
0 commit comments