amaliujia opened a new pull request, #11446: URL: https://github.com/apache/ozone/pull/11446
## What changes were proposed in this pull request? `Buffers.pollAll()` in the KeyValue stream write path throws `IllegalStateException` when the internal deque is empty (`Preconditions.checkState(!deque.isEmpty(), ...)`). Callers such as `KeyValueStreamDataChannel.drainBuffers()` must guard with `buffers.isEmpty()` before calling `pollAll()`, which duplicates checks and makes the API easy to misuse. This PR proposes when the deque is empty, `pollAll()` returns `ReferenceCountedObject.wrap(Unpooled.EMPTY_BUFFER)` instead of throwing. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16789 ## How was this patch tested? Unit test -- 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]
