szetszwo commented on code in PR #11446:
URL: https://github.com/apache/ozone/pull/11446#discussion_r4251100310


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/Buffers.java:
##########
@@ -90,7 +90,9 @@ ReferenceCountedObject<ByteBuffer> poll() {
   }
 
   ReferenceCountedObject<ByteBuf> pollAll() {
-    Preconditions.checkState(!deque.isEmpty(), "The deque is empty");
+    if (deque.isEmpty()) {
+      return ReferenceCountedObject.wrap(Unpooled.EMPTY_BUFFER);

Review Comment:
   @amaliujia , thanks for working on this!  Some suggestions: 
   
   - Let's add a boolean allowEmpty parameter.   Set it to false for the write 
case and true for the drainBuffers.
   - When it is empty, just return null and check null in drainBuffers.



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