You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2014/05/16 23:13:15 UTC

[jira] [Comment Edited] (BOOKKEEPER-758) Add TryReadLastAddConfirmed API

    [ https://issues.apache.org/jira/browse/BOOKKEEPER-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000311#comment-14000311 ] 

Sijie Guo edited comment on BOOKKEEPER-758 at 5/16/14 9:12 PM:
---------------------------------------------------------------

in general, if a reader is tailing current ledger, it would use following code snippet to poll latest lac to move on. the multiple callbacks is to update the lac internally, so when the reader move on to read next entry, the getLastAddConfirmed will return updated lac.

{code}
long readEntry = xx;
lh.readEntries(readEntry, readEntry);
++readEntry;
if (readEntry > lh.getLastAddConfirmed()) {
  lh.tryReadLastAddConfirmed();
}
{code}


was (Author: hustlmsp):
in general, if a reader is tailing current ledger, it would use following code snippet to poll latest lac to move on. the multiple callbacks is to update the lac internally, so when the reader move on to read next entry, the getLastAddConfirmed will return updated lac.

{code}
long readEntry = xx;
lh.readEntries(readEntry, readEntry);
++readEntry;
if (readEntry > lh.getLastAddConfirmed()) {
  lh.readLastAddConfirmed();
}
{code}

> Add TryReadLastAddConfirmed API
> -------------------------------
>
>                 Key: BOOKKEEPER-758
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-758
>             Project: Bookkeeper
>          Issue Type: Improvement
>          Components: bookkeeper-client
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.3.0
>
>         Attachments: BOOKKEEPER-758.diff, BOOKKEEPER-758.v2.diff
>
>
> add TryReadLastConfirmed to read last confirmed without coverage checking, as for readers which polls LAC, they just need LAC.



--
This message was sent by Atlassian JIRA
(v6.2#6252)