Copilot commented on code in PR #17358:
URL: https://github.com/apache/pinot/pull/17358#discussion_r2677490405
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/MailboxService.java:
##########
@@ -192,4 +203,52 @@ private static Duration getIdleTimeout(PinotConfiguration
config) {
// Use a reasonable maximum idle timeout (1 year) to avoid overflow.
return Duration.ofDays(365);
}
+
+ @Nullable
+ private static SslContext resolveClientSslContext(InstanceType instanceType,
@Nullable TlsConfig tlsConfig) {
+ if (tlsConfig == null) {
+ return null;
+ }
+ switch (instanceType) {
+ case BROKER:
+ case SERVER:
+ case CONTROLLER:
+ return getOrBuildClientSslContext(instanceType, tlsConfig);
+ default:
+ return ServerGrpcQueryClient.buildSslContext(tlsConfig);
+ }
+ }
+
+ @Nullable
+ private static SslContext resolveServerSslContext(InstanceType instanceType,
@Nullable TlsConfig tlsConfig) {
+ if (tlsConfig == null) {
+ return null;
+ }
+ switch (instanceType) {
+ case BROKER:
+ case SERVER:
+ case CONTROLLER:
+ return getOrBuildServerSslContext(instanceType, tlsConfig);
+ default:
+ return GrpcQueryServer.buildGrpcSslContext(tlsConfig);
+ }
Review Comment:
The switch statements in both `resolveClientSslContext` and
`resolveServerSslContext` treat BROKER, SERVER, and CONTROLLER identically.
Consider extracting these three instance types into a constant set or method
like `isCachingSupportedInstanceType(instanceType)` to avoid duplicating the
case logic and make future instance type additions clearer.
--
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]