walterddr commented on code in PR #9887:
URL: https://github.com/apache/pinot/pull/9887#discussion_r1041149192


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/ChannelManager.java:
##########
@@ -41,9 +43,11 @@ public class ChannelManager {
 
   private final ConcurrentHashMap<String, ManagedChannel> _channelMap = new 
ConcurrentHashMap<>();
 
-  public ChannelManager(GrpcMailboxService mailboxService, PinotConfiguration 
extraConfig) {
+  public ChannelManager(GrpcMailboxService mailboxService, PinotConfiguration 
extraConfig,
+      Consumer<MailboxIdentifier> gotMailCallback) {
     _mailboxService = mailboxService;
-    _grpcMailboxServer = new GrpcMailboxServer(_mailboxService, 
_mailboxService.getMailboxPort(), extraConfig);
+    _grpcMailboxServer = new GrpcMailboxServer(
+        _mailboxService, _mailboxService.getMailboxPort(), extraConfig, 
gotMailCallback);

Review Comment:
   this looks like a design issue of the code structure. ChannelManager doesn't 
need to know about the mailbox callback. 
   it seems like the reason is that the member variable: `GRPCMailboxServer` 
needs to know about the gotMailCallback in order to create the StreamObserver 
correctly. 
   
   can't we add an API in the `GRPCMailboxService.getMailCallback()` it should 
be registered at the MailboxService level IMO b/c you should never have 
different gotMailCallback on the same MailboxService (or am I not correct on 
this assumption?)



-- 
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