HenryCaiHaiying commented on code in PR #17025:
URL: https://github.com/apache/iceberg/pull/17025#discussion_r4279289500
##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/CommitState.java:
##########
@@ -102,6 +102,14 @@ void clearResponses() {
commitBuffer.clear();
}
+ int commitBufferSize() {
+ return commitBuffer.size();
Review Comment:
If you are worried about stale reads, I can add in a new volatile int
variable (commitBufferSize) to go together with commitBuffer updates. There is
some performance overhead going to be added because the memory barrier flush
each time the commit buffer is changed, but it is probably negligible. I think
volatile is a little bit faster than AtomicInteger (they both need to do a
memory barrier flush, but volatile doesn't need to do a compare-and-swap).
--
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]