HDDS-6358. EC: Refactor ECKeyOutputStream#write()#3120
HDDS-6358. EC: Refactor ECKeyOutputStream#write()#3120umamaheswararao merged 2 commits intoapache:HDDS-3816-ecfrom
Conversation
|
Hi @kaijchen the overall patch LGTM! |
|
@guihecheng Thanks for reviewing, I have edited the PR message to include a summary of changes. |
|
Thanks for filing this @kaijchen I will review it soon and provide my feedback if any. Thanks a lot for working on this. |
umamaheswararao
left a comment
There was a problem hiding this comment.
@kaijchen, Thanks for working on this task. I have dropped few comments. Please check.
There was a problem hiding this comment.
I am wondering, whether this allocateBlockINeeded() can be under currentStreamEntry().getRemaining()>=0 condition ? That can avoid at least couple of if checks every time.
There was a problem hiding this comment.
Yes. But will there be noticeable performance difference? Because KeyOutputStream is doing the same thing.
If we need to add this check, can we add it inside allocateBlockIfNeeded()?
There was a problem hiding this comment.
Few if checks might not contribute to significant improvement, but this is key path and saving such thing also helps. But doing that checks needs to modify BlockOutputStreamEntryPool, that should be done in master I feel as that is common. So, I am ok to keep it here now as it is.
f38a03e to
03f2813
Compare
|
Hi @umamaheswararao, thanks for the explanation and the review. |
umamaheswararao
left a comment
There was a problem hiding this comment.
LGTM, pending CI
There was a problem hiding this comment.
Few if checks might not contribute to significant improvement, but this is key path and saving such thing also helps. But doing that checks needs to modify BlockOutputStreamEntryPool, that should be done in master I feel as that is common. So, I am ok to keep it here now as it is.
What changes were proposed in this pull request?
Refactor the code to make it cleaner, here is a summary of the changes.
head/middle/taildifferently, use a general way to write data into buffers.allocateBlockIfNeededparameters being passed around.IOExceptionwill be thrown.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6358
How was this patch tested?
Unit tests.