szetszwo commented on code in PR #8203:
URL: https://github.com/apache/ozone/pull/8203#discussion_r2047957936
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreCodecBufferIterator.java:
##########
@@ -84,38 +92,77 @@ CodecBuffer getFromDb() {
}
}
- private final Buffer keyBuffer;
- private final Buffer valueBuffer;
+ private final Stack<RawKeyValue<Buffer>> availableBufferStack;
Review Comment:
> ... LIFO is better than FIFO in such cases. ...
Why LIFO is better than FIFO?
BTW, for LIFO, we have
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/BlockingDeque.html
> ... My buffer allocation would be minimal with a stack
For any data structures, the allocation can be minimal since we can have
lazy allocation -- allocate only when it is used.
> ... We need the synchronized block only for the published subscriber
model, optmize on the wait() & notify()
It also makes the code complicated. Prone to a deadlock.
--
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]