len548 opened a new pull request, #11384:
URL: https://github.com/apache/ozone/pull/11384

   ## What changes were proposed in this pull request?
   Move in-flight flush state out of `BlockDataStreamOutput` into a 
single-owner `PendingFlush` object.
   
   - Add package-private `PendingFlush` holding buffers pending putBlock, chunk 
`CompletableFuture`s, and flushed/written length counters.
   - Replace scattered fields (`buffersForPutBlock`, class-level chunk 
`futures`, `totalDataFlushedLength`, `writtenDataLength`) with one 
`PendingFlush` instance.
   - At flush boundaries, `seal()` produces a `FlushBatch` passed to 
`executePutBlock(FlushBatch, close, force)` so chunk futures and buffer lists 
stay paired through putBlock.
   - Keep the public 2-arg `executePutBlock(boolean, boolean)` for 
`KeyDataStreamOutput.handleException`; return early when there is no pending 
batch (after a prior seal), matching master when `buffersForPutBlock` was 
already null.
   - `handleFlush` with unflushed data uses `seal()` + 3-arg directly (same as 
`doFlushIfNeeded`), avoiding a second seal via the 2-arg overload.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-16191
   
   ## How was this patch tested?
   Current `TestBlockDataStreamOutput` and `TestKeyDataStreamOutput` are enough 
as testing.
   CI pass: https://github.com/len548/ozone/actions/runs/36838851713
   
   Generated-by: Cursor (Auto)


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

Reply via email to