bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhai...@apache.org
Subject [bookkeeper] branch master updated: ISSUE #376: Skip getSysFileDescriptor if JournalRemovePagesFromCache=false
Date Fri, 04 Aug 2017 04:19:57 GMT
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 <eolivelli@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 <eolivelli@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" <commits@bookkeeper.apache.org>'].

Mime
View raw message