sijie commented on a change in pull request #1201: ISSUE #570: Entrylog per
ledger
URL: https://github.com/apache/bookkeeper/pull/1201#discussion_r170545857
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
##########
@@ -41,20 +41,46 @@
// The buffer used to write operations.
protected final ByteBuf writeBuffer;
// The absolute position of the next write operation.
- protected volatile long position;
+ protected final AtomicLong position;
+
+ /*
+ * if unpersistedBytesBound is non-zero value, then after writing to
+ * writeBuffer, it will check if the unpersistedBytes is greater than
+ * unpersistedBytesBound and then calls flush method if it is greater.
+ *
+ * It is a best-effort feature, since 'forceWrite' method is not
+ * synchronized and unpersistedBytes is reset in 'forceWrite' method before
+ * calling fileChannel.force
+ */
+ protected final long unpersistedBytesBound;
Review comment:
can you add a test case to test the logic changes of this class?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services