bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject [bookkeeper] branch master updated: BOOKKEEPER-1095: Long Poll - Server and Client Side Changes
Date Mon, 17 Jul 2017 21:27:20 GMT
This is an automated email from the ASF dual-hosted git repository.

sijie 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 1b79ada  BOOKKEEPER-1095: Long Poll - Server and Client Side Changes
1b79ada is described below

commit 1b79adaae7ffd4736530bd1088b45de8ac049f98
Author: Sijie Guo <sijie@apache.org>
AuthorDate: Mon Jul 17 14:27:13 2017 -0700

    BOOKKEEPER-1095: Long Poll - Server and Client Side Changes
    
    Descriptions of the changes in this PR:
    
    - changes on FileInfo to support notifications on LAC changes
    - a new ReadEntryLongPollV3 processor to process readEntry requests with long poll flags
    - a new public API for long poll: readLastConfirmedAndEntry. if it is reading beyond the
LAC, it will become a long poll request and wait for advancing LAC on bookie side; if it isn't
reading beyond the LAC it will be normal reads.
    - also have a speculative mechanism for long poll reads.
    
    Author: Sijie Guo <sijie@apache.org>
    
    Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Jia Zhai <None>
    
    This closes #220 from sijie/BOOKKEEPER-1094
---
 .../src/main/java/org/apache/bookkeeper/bookie/FileInfo.java      | 8 ++++++--
 .../java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java   | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
index 597fcd3..31c76d5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
@@ -110,7 +110,9 @@ class FileInfo extends Observable {
             }
             lacToReturn = this.lac;
         }
-        LOG.trace("Updating LAC {} , {}", lacToReturn, lac);
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Updating LAC {} , {}", lacToReturn, lac);
+        }
 
 
         notifyObservers(new LastAddConfirmedUpdateNotification(lacToReturn));
@@ -120,7 +122,9 @@ class FileInfo extends Observable {
     synchronized Observable waitForLastAddConfirmedUpdate(long previousLAC, Observer observe)
{
         if ((null != lac && lac > previousLAC)
                 || isClosed || ((stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT))
{
-            LOG.trace("Wait For LAC {} , {}", this.lac, previousLAC);
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("Wait For LAC {} , {}", this.lac, previousLAC);
+            }
             return null;
         }
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
index c48cd75..cfc1be0 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptorImpl.java
@@ -157,7 +157,7 @@ public class LedgerDescriptorImpl extends LedgerDescriptor {
     }
 
     @Override
-    Observable waitForLastAddConfirmedUpdate(long previoisLAC, Observer observer) throws
IOException {
-        return ledgerStorage.waitForLastAddConfirmedUpdate(ledgerId, previoisLAC, observer);
+    Observable waitForLastAddConfirmedUpdate(long previousLAC, Observer observer) throws
IOException {
+        return ledgerStorage.waitForLastAddConfirmedUpdate(ledgerId, previousLAC, observer);
     }
 }

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

Mime
View raw message