aswinshakil commented on code in PR #3977:
URL: https://github.com/apache/ozone/pull/3977#discussion_r1026756781


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/ECXceiverClientGrpc.java:
##########
@@ -57,4 +79,59 @@ protected boolean shouldBlockAndWaitAsyncReply(
       ContainerProtos.ContainerCommandRequestProto request) {
     return false;
   }
+
+  @Override
+  protected ManagedChannel createChannel(DatanodeDetails dn, int port)
+      throws IOException {
+    NettyChannelBuilder channelBuilder =
+        NettyChannelBuilder.forAddress(dn.getIpAddress(), port).usePlaintext()
+            .maxInboundMessageSize(OzoneConsts.OZONE_SCM_CHUNK_MAX_SIZE)
+            .intercept(new GrpcClientInterceptor());
+    if (getSecConfig().isGrpcTlsEnabled()) {
+      SslContextBuilder sslContextBuilder = GrpcSslContexts.forClient();
+      if (getCaCerts() != null) {
+        sslContextBuilder.trustManager(getCaCerts());
+      }
+      if (getSecConfig().useTestCert()) {
+        channelBuilder.overrideAuthority("localhost");
+      }
+      channelBuilder.useTransportSecurity().
+          sslContext(sslContextBuilder.build());
+    } else {
+      channelBuilder.usePlaintext();
+    }
+    if (enableRetries) {
+      double maxAttempts = getConfig().getInt(OZONE_CLIENT_EC_GRPC_MAX_RETRIES,
+          OZONE_CLIENT_EC_GRPC_MAX_RETRIES_DEFAULT);
+
+      
channelBuilder.defaultServiceConfig(createRetryServiceConfig(maxAttempts))
+          .maxRetryAttempts((int) maxAttempts).enableRetry();
+    }
+    return channelBuilder.build();

Review Comment:
   Thanks for pointing it out. Updating the PR with suggestions. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to