reddycharan commented on a change in pull request #1228: Issue #570: Move logic
of unpersistedbytes to bufferedchannel
URL: https://github.com/apache/bookkeeper/pull/1228#discussion_r172323146
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java
##########
@@ -110,11 +150,15 @@ public long getFileChannelPosition() {
* @throws IOException if the write or sync operation fails.
*/
public void flush(boolean shouldForceWrite) throws IOException {
+ flush(shouldForceWrite, false);
+ }
+
+ public void flush(boolean shouldForceWrite, boolean forceMetadata) throws
IOException {
synchronized (this) {
Review comment:
flushInternal just flushes writeBuffer to fileChannel (doesn't persists and
moreover it is private method). forceWrite just forces filechannel (persists
data written to filechannel so far, doesn't touches writeBuffer), flush calls
flushInternal and provides option to whether do forceWrite or not.
So each method has different purpose. replacing flushinternal with flush is
not correct thing to do from its expectations. And if user wants to do both
flushing writeBuffer and forcewrites the filechannel, then calling just
forceWrite is not right thing to do.
But again I don't see point in complicating things by changing the
signatures of this commonly used methods and touch all the callers of them. It
is extraneous.
----------------------------------------------------------------
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