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 20
20
import com .google .api .core .ApiFuture ;
21
21
import com .google .api .core .ApiFutureCallback ;
22
22
import com .google .api .core .ApiFutures ;
23
+ import com .google .api .gax .batching .FlowControlSettings ;
23
24
import com .google .api .gax .core .FixedExecutorProvider ;
24
25
import com .google .api .gax .retrying .RetrySettings ;
25
26
import com .google .cloud .bigquery .BigQuery ;
@@ -184,6 +185,9 @@ private JsonStreamWriter createStreamWriter(String tableName)
184
185
.setChannelsPerCpu (2 )
185
186
.build ())
186
187
.setEnableConnectionPool (true )
188
+ // This will allow connection pool to scale up better.
189
+ .setFlowControlSettings (
190
+ FlowControlSettings .newBuilder ().setMaxOutstandingElementCount (100L ).build ())
187
191
// If value is missing in json and there is a default value configured on bigquery
188
192
// column, apply the default value to the missing value field.
189
193
.setDefaultMissingValueInterpretation (
You can’t perform that action at this time.
0 commit comments