You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by zh...@apache.org on 2017/08/04 04:19:57 UTC

[bookkeeper] branch master updated: ISSUE #376: Skip getSysFileDescriptor if JournalRemovePagesFromCache=false

This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a500dc  ISSUE #376: Skip getSysFileDescriptor if JournalRemovePagesFromCache=false
7a500dc is described below

commit 7a500dc8082580ad4c85c307ef073edae3ae7f7a
Author: eolivelli <eo...@apache.org>
AuthorDate: Fri Aug 4 12:19:46 2017 +0800

    ISSUE #376: Skip getSysFileDescriptor if JournalRemovePagesFromCache=false
    
    Skip illegal reflective calls if not needed, this way the Bookie will run on Java9 cleanly
    
    We need to access internals of FileDescriptor class only if JournalRemovePagesFromCache=true.
    This change will allow to run the bookie on Java9 just by using JournalRemovePagesFromCache=false.
    
    see #376
    
    Author: eolivelli <eo...@apache.org>
    
    Reviewers: Jia Zhai <None>, Matteo Merli <None>
    
    This closes #380 from eolivelli/issue-376-minimal-java9, closes #376
---
 .../src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
index 3d2c502..6d5cae0 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java
@@ -214,7 +214,11 @@ class JournalChannel implements Closeable {
                 LOG.error("Bookie journal file can seek to position :", e);
             }
         }
-        this.fd = NativeIO.getSysFileDescriptor(randomAccessFile.getFD());
+        if (fRemoveFromPageCache) {
+            this.fd = NativeIO.getSysFileDescriptor(randomAccessFile.getFD());
+        } else {
+            this.fd = -1;
+        }
     }
 
     int getFormatVersion() {

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <co...@bookkeeper.apache.org>'].