You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/07/22 09:41:30 UTC

[GitHub] [bookkeeper] ArvinDevel commented on a diff in pull request #3194: BP-50: Add reuse journal file feature to support Intel PMem disk

ArvinDevel commented on code in PR #3194:
URL: https://github.com/apache/bookkeeper/pull/3194#discussion_r927472583


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java:
##########
@@ -177,7 +190,21 @@ private JournalChannel(File journalDirectory, long logId,
             }
             fc = channel.getFileChannel();
             formatVersion = formatVersionToWrite;
+            bc = bcBuilder.create(fc, writeBufferSize);
+        } else {  // open an existing file
+            fc = channel.getFileChannel();
+            formatVersion = formatVersionToWrite;
+        }
+        if (fRemoveFromPageCache) {
+            this.fd = NativeIO.getSysFileDescriptor(channel.getFD());
+        } else {
+            this.fd = -1;
+        }
+    }
 
+    public void writeHeader() throws IOException {
+        try {
+            bc = bcBuilder.create(fc, writeBufferSize);

Review Comment:
   the `bc` is already created at line 193, right? if so, I think this line is redundant.



-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org