Alluxio / alluxio

Alluxio, data orchestration for analytics and machine learning in the cloud
https://www.alluxio.io
Apache License 2.0
6.87k stars 2.94k forks source link

Fix worker remote alluxio read metric in FileReadHandler #18690

Open M1eyu2018 opened 2 months ago

M1eyu2018 commented 2 months ago

What changes are proposed in this pull request?

Fix worker remote alluxio read metric in FileReadHandler

Why are the changes needed?

In worker, after reading chunk from alluxio or ufs, the chunk will be send to client and then increase remote alluxio read metric. However, the type of chunk is NettyDataBuffer. Its readIndex may be increased when sending chunk so that the chunk getLength method which actually get readableBytes is not equal to the entire chunk length. The metric is not correct.

Therefore, In this PR, to make metric correct, getLength before sending and increase metric by using length from getLength.

Does this PR introduce any user facing changes?

No

alluxio-bot commented 2 months ago

Thank you for your pull request. In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement (CLA). It's all electronic and will take just a few minutes. Please download CLA form here, sign, and e-mail back to cla@alluxio.org