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

[jira] [Commented] (BOOKKEEPER-758) Add TryReadLastAddConfirmed API

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

Flavio Junqueira commented on BOOKKEEPER-758:
---------------------------------------------

It looks good. It sounds like you want to have a weaker version of ReadLastAddConfirmed that simply returns some valid value, not necessarily the last.

It looks like the callback can be called multiple times. For example, we can return immediately here:

{noformat}
// callback immediately
cb.readLastConfirmedDataComplete(BKException.Code.OK, maxRecoveredData);
{noformat}

and later on here:

{noformat}
        if (numResponsesPending == 0 && !completed) {
            if (!hasValidResponse) {
                // no success called
                cb.readLastConfirmedDataComplete(BKException.Code.LedgerRecoveryException, maxRecoveredData);
            } else {
                // callback
                cb.readLastConfirmedDataComplete(BKException.Code.OK, maxRecoveredData);
            }
            completed = true;
        }
{noformat}

In the test cases, don't we have to wait until the bookie is down when we kill a bookie?

(typo) Also, in the last test case, it shouldn't be numEntries here:

{noformat}
       for (int i = 0; i < numEntries; i++) {
            killBookie(lh.getLedgerMetadata().currentEnsemble.get(i));
        }
{noformat}

> 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
>
>
> 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)