amaliujia commented on code in PR #11384:
URL: https://github.com/apache/ozone/pull/11384#discussion_r4456324610
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java:
##########
@@ -433,19 +413,36 @@ public void watchForCommit(boolean bufferFull) throws
IOException {
* @param close whether putBlock is happening as part of closing the stream
*/
public void executePutBlock(boolean sync, boolean close) throws IOException {
+ if (!pendingFlush.hasBuffersForPutBlock()) {
+ if (!close && !(sync && putBlockWithoutRaft)) {
+ return;
+ }
+ executePutBlock(null, sync, close);
+ return;
+ }
+ executePutBlock(pendingFlush.seal(), sync, close);
+ }
Review Comment:
It is fine if you want to use a dedicated class to manage the block level
parameters (e.g. writtenDataLength, totalDataFlushedLength), but naturally
those parameters are not tied with a flush thus should not be managed by a
pending flush.
--
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]