You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by gi...@apache.org on 2017/08/05 06:15:43 UTC

[bookkeeper] branch asf-site updated: Updated site at revision 31960b0

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

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new da47df2  Updated site at revision 31960b0
da47df2 is described below

commit da47df29fdf854f32c1d60593ec7e94f4e691a30
Author: jenkins <bu...@apache.org>
AuthorDate: Sat Aug 5 06:15:41 2017 +0000

    Updated site at revision 31960b0
---
 content/docs/api/ledger-api/index.html | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/content/docs/api/ledger-api/index.html b/content/docs/api/ledger-api/index.html
index 8005d75..8780d26 100644
--- a/content/docs/api/ledger-api/index.html
+++ b/content/docs/api/ledger-api/index.html
@@ -532,6 +532,24 @@
 </code></pre>
 </div>
 
+<h3 id="reading-entries-after-the-lastaddconfirmed-range">Reading entries after the LastAddConfirmed range</h3>
+
+<p><code class="highlighter-rouge">readUnconfirmedEntries</code> allowing to read after the LastAddConfirmed range.
+It lets the client read without checking the local value of LastAddConfirmed, so that it is possible to read entries for which the writer has not received the acknowledge yet
+For entries which are within the range 0..LastAddConfirmed BookKeeper guarantees that the writer has successfully received the acknowledge.
+For entries outside that range it is possible that the writer never received the acknowledge and so there is the risk that the reader is seeing entries before the writer and this could result in a consistency issue in some cases.
+With this method you can even read entries before the LastAddConfirmed and entries after it with one call, the expected consistency will be as described above.</p>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">Enumerator</span><span class="o">&lt;</span><span class="n">LedgerEntry</span><span class="o">&gt;</span> <span class="n">entries</span> <span class="o">=</span>
+  <span class="n">handle</span><span class="o">.</span><span class="na">readUnconfirmedEntries</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="n">lastEntryIdExpectedToRead</span><span class="o">);</span>
+
+<span class="k">while</span> <span class="o">(</span><span class="n">entries</span><span class="o">.</span><span class="na">hasNextElement</span><span class="o">())</span> <span class="o">{</span>
+    <span class="n">LedgerEntry</span> <span class="n">entry</span> <span class="o">=</span> <span class="n">entries</span><span class="o">.</span><span class="na">nextElement</span><span class="o">();</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Successfully read entry "</span> <span class="o">+</span> <span class="n">entry</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
 <h2 id="deleting-ledgers">Deleting ledgers</h2>
 
 <p><span class="pop" id="ledger-popover">Ledgers</span> can also be deleted synchronously or asynchronously.</p>
@@ -867,6 +885,7 @@ Value <span class="o">=</span> 3, isLeader <span class="o">=</span> <span class=
 <li class="toc-entry toc-h2"><a href="#adding-entries-to-ledgers">Adding entries to ledgers</a></li>
 <li class="toc-entry toc-h3"><a href="#add-entries-asynchronously">Add entries asynchronously</a></li>
 <li class="toc-entry toc-h2"><a href="#reading-entries-from-ledgers">Reading entries from ledgers</a></li>
+<li class="toc-entry toc-h3"><a href="#reading-entries-after-the-lastaddconfirmed-range">Reading entries after the LastAddConfirmed range</a></li>
 <li class="toc-entry toc-h2"><a href="#deleting-ledgers">Deleting ledgers</a></li>
 <li class="toc-entry toc-h3"><a href="#delete-entries-asynchronously">Delete entries asynchronously</a></li>
 <li class="toc-entry toc-h2"><a href="#simple-example">Simple example</a></li>

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