Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ public GrpcDatastoreRpc(DatastoreOptions datastoreOptions) throws IOException {
? getClientContextForEmulator(datastoreOptions)
: getClientContext(datastoreOptions);

/* For grpc transport options, configure default gRPC Connection pool with minChannelCount = 1 */
DatastoreStubSettings.Builder builder =
/* For non-emulator, configure default gRPC Connection pool with minChannelCount = 1 */
DatastoreStubSettings.Builder datastoreStubSettingsBuilder =
DatastoreStubSettings.newBuilder(clientContext)
.applyToAllUnaryMethods(retrySettingSetter(datastoreOptions))
.setTransportChannelProvider(
DatastoreSettings.defaultGrpcTransportProviderBuilder()
.setChannelPoolSettings(
ChannelPoolSettings.builder()
.setInitialChannelCount(DatastoreOptions.INIT_CHANNEL_COUNT)
.setMinChannelCount(DatastoreOptions.MIN_CHANNEL_COUNT)
.build())
.build());

datastoreStub = GrpcDatastoreStub.create(builder.build());
.applyToAllUnaryMethods(retrySettingSetter(datastoreOptions));
if (!isEmulator(datastoreOptions)) {
Comment on lines +78 to +82
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment describing the connection pool configuration is misplaced and refers to a specific implementation context. In accordance with repository rules, comments that refer to stale or misplaced implementations should be removed rather than updated or moved to a different block.

      DatastoreStubSettings.Builder datastoreStubSettingsBuilder =
          DatastoreStubSettings.newBuilder(clientContext)
              .applyToAllUnaryMethods(retrySettingSetter(datastoreOptions));
      if (!isEmulator(datastoreOptions)) {
References
  1. Remove comments that refer to stale implementations instead of updating them.

datastoreStubSettingsBuilder.setTransportChannelProvider(
DatastoreSettings.defaultGrpcTransportProviderBuilder()
.setChannelPoolSettings(
ChannelPoolSettings.builder()
.setInitialChannelCount(DatastoreOptions.INIT_CHANNEL_COUNT)
.setMinChannelCount(DatastoreOptions.MIN_CHANNEL_COUNT)
.build())
.build());
}

datastoreStub = GrpcDatastoreStub.create(datastoreStubSettingsBuilder.build());
} catch (IOException e) {
throw new IOException(e);
}
Expand Down
Loading