chia7712 commented on pull request #9516:
URL: https://github.com/apache/kafka/pull/9516#issuecomment-757434663


   hi @dengziming 
   
   > I have a question, why not also replace ScatteringByteChannel in Receive 
with a similar class?
   
   ```TransportLayer``` is a heavy interface so it may causes trouble in 
testing if we replace ```ScatteringByteChannel ``` by ```TransportLayer``` for 
```Receive```. By contrast, ```GatheringByteChannel``` lacks some methods from 
```TransportLayer```  so we used to cast the ```GatheringByteChannel``` to 
```TransportLayer ``` before. In this PR, we introduced a new interface 
```TransferableChannel``` which is a subclass of ```GatheringByteChannel``` and 
have some methods from ```TransferableChannel```. Through 
```TransferableChannel```, we can remove all casting code. 


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

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


Reply via email to