File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
google-cloud-datastore/src/main/java/com/google/cloud/datastore Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 19
19
import static com .google .cloud .datastore .Validator .validateNamespace ;
20
20
21
21
import com .google .api .core .BetaApi ;
22
+ import com .google .api .gax .grpc .ChannelPoolSettings ;
22
23
import com .google .api .gax .grpc .InstantiatingGrpcChannelProvider ;
23
24
import com .google .api .gax .rpc .TransportChannelProvider ;
24
25
import com .google .cloud .ServiceDefaults ;
@@ -222,7 +223,9 @@ private DatastoreOptions(Builder builder) {
222
223
builder .channelProvider != null
223
224
? builder .channelProvider
224
225
: GrpcTransportOptions .setUpChannelProvider (
225
- DatastoreSettings .defaultGrpcTransportProviderBuilder (), this );
226
+ DatastoreSettings .defaultGrpcTransportProviderBuilder ().setChannelPoolSettings (
227
+ ChannelPoolSettings .builder ().setMinChannelCount (1 ).setInitialChannelCount (4 )
228
+ .build ()), this );
226
229
}
227
230
}
228
231
Original file line number Diff line number Diff line change 24
24
import com .google .api .core .InternalApi ;
25
25
import com .google .api .gax .core .BackgroundResource ;
26
26
import com .google .api .gax .core .GaxProperties ;
27
+ import com .google .api .gax .grpc .ChannelPoolSettings ;
27
28
import com .google .api .gax .grpc .GrpcCallContext ;
28
29
import com .google .api .gax .grpc .GrpcTransportChannel ;
29
30
import com .google .api .gax .rpc .ClientContext ;
@@ -74,9 +75,16 @@ public GrpcDatastoreRpc(DatastoreOptions datastoreOptions) throws IOException {
74
75
? getClientContextForEmulator (datastoreOptions )
75
76
: getClientContext (datastoreOptions );
76
77
78
+ //
77
79
DatastoreStubSettings datastoreStubSettings =
78
80
DatastoreStubSettings .newBuilder (clientContext )
79
81
.applyToAllUnaryMethods (retrySettingSetter (datastoreOptions ))
82
+ .setTransportChannelProvider (DatastoreSettings .defaultGrpcTransportProviderBuilder ()
83
+ .setChannelPoolSettings (ChannelPoolSettings .builder ()
84
+ .setMinChannelCount (1 )
85
+ .setMaxChannelCount (4 )
86
+ .build ())
87
+ .build ())
80
88
.build ();
81
89
datastoreStub = GrpcDatastoreStub .create (datastoreStubSettings );
82
90
} catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments