ivankelly commented on a change in pull request #832: Issue 620: Close the 
fileChannels for read when they are idle
URL: https://github.com/apache/bookkeeper/pull/832#discussion_r170904586
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
 ##########
 @@ -1174,24 +1208,19 @@ private File findFile(long logId) throws 
FileNotFoundException {
      * @throws IOException
      */
     public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws 
IOException {
-        // Buffer where to read the entrySize (4 bytes) and the ledgerId (8 
bytes)
-        ByteBuf headerBuffer = Unpooled.buffer(4 + 8);
-        BufferedReadChannel bc;
-        // Get the BufferedChannel for the current entry log file
+        EntryLogBufferedReadChannel bc = null;
 
 Review comment:
   There's a lot of code moved around here for what seems to be just exception. 
Couldn't you have just released the bc object in the final finally block.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to