dawidwys commented on pull request #17440:
URL: https://github.com/apache/flink/pull/17440#issuecomment-945629976


   Another idea to throw into the mix:
   
   Why do we even have the methods like: `notifyCreditAvailable`, 
`notifyNewBufferSize`, `resumeConsumption` and `acknowledgeAllRecordsProcessed` 
in the `NetworkClientHandler`. It seems to me those methods go against the 
purpose of `ChannelHandler` in netty. As far as I understand them, they are 
supposed to be reactive components that act on a certain event happening in the 
network stack. That is not the case with the aforementioned methods.
   
   On the other hand we have the `NettyPartitionRequestClient`, which is an 
active client of the network stack, we can e.g. `requestSubpartition` or 
`sendTaskEvent`. I am wondering why don't we implement the methods like 
`notifyNewBufferSize` there?
   Something like:
   ```
       @Override
       public void notifyNewBufferSize(RemoteInputChannel inputChannel, int 
bufferSize) {
           tcpChannel
                   .pipeline()
                   .fireUserEventTriggered(
                           new CreditBasedPartitionRequestClientHandler
                                   .NewBufferSizeMessage(inputChannel, 
bufferSize));
       }
   ```
   or (I am not sure about the threading model)
   
   ```
           tcpChannel
                   .eventLoop()
                   .execute(
                           () -> {
                               tcpChannel
                                       .pipeline()
                                       .fireUserEventTriggered(
                                               new 
CreditBasedPartitionRequestClientHandler
                                                       .NewBufferSizeMessage(
                                                       inputChannel, 
bufferSize));
                           });
   ```
   I am sorry, I do not have much expertise on netty, so would be really nice 
to hear from @pnowojski on the idea above.


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to