You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bookkeeper.apache.org by Wei Liu <li...@gmail.com> on 2019/07/29 10:49:19 UTC

I want to know how to read the last message without close the current ledger?

Dear All :

         1) First create ledger, add msg 1, 2, 3 into the ledger
         2) Do not close the current ledger;
         3) Received the msg 1 and 2;
         4) Received the msg 3 after closed the ledger;

         I want to know how to read the last message without close the
current ledger?

        Thanks~
-- 
一个人只拥有今生今世是不够的,
他还应该拥有诗意的世界。

       liuweixh@gmail.com

Re: I want to know how to read the last message without close the current ledger?

Posted by Wei Liu <li...@gmail.com>.
Thank you very much.

Enrico Olivelli <eo...@gmail.com> 于2019年7月30日周二 下午12:56写道:

>
>
> Il mar 30 lug 2019, 04:17 Wei Liu <li...@gmail.com> ha scritto:
>
>> Thank you very much for your explanation.
>>
>> I think the current design is therefore a single writer, who writes the
>> same message to multiple bookies  in parallel(no leader) and the server
>> updates lac only rely on client submit.
>> It may result in delay in receiving the last message or in user usage
>> complexity.
>>
>
> If you have a continuous stream of data from the writer you get a great
> throughput and all of the guarantees of BK.
>
> If you have very few writes you have to do what I said before .
>
> If you are experiencing low throughput consider using the asynchronous API
> and tune you journal settings on the bookie
>
> Enrico
>
>
>
>> Enrico Olivelli <eo...@gmail.com> 于2019年7月29日周一 下午7:07写道:
>>
>>> Hello Wei Liu,
>>> This is about the core feature of BookKeeper, that is the Last
>>> AddConfirmed Protocol (LAC for friends).
>>>
>>> BookKeeper guarantees to the readers that once you read an entry you
>>> will always be able to read it.
>>> The reader is able to "see"  the entries only after it has the guarantee
>>> that the writer has received the acknowledgement of a successful write with
>>> an quorum of bookies.
>>>
>>> In order to make it possible the writer "piggy backs" the id of the
>>> LastAddConfirmed entry to the bookies and the reader then is able to use
>>> this value (by reading it with readLastAddConfirmed) in order to have this
>>> reference id.
>>>
>>> You have these ways to get your work done:
>>> 1) write no-operation entries to the ledger, this will make the LAC
>>> advance even in absence of "application" entries
>>> 2) use the "ExplicitLAC" feature, that is a background activity that
>>> sends the current LastAddConfirmed to the bookies even in absence of writes
>>> after a configurable delay (this is like option 1 but is it automatic, but
>>> it is still not available in the new API)
>>> 3) use readUnconfirmedEntries: this bypasses the LAC protocol at all, so
>>> you can read every entry, but you will need to use an out-of-band channel
>>> to pass the id of the entries to read
>>>
>>> I hope that helps
>>>
>>> Enrico
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Il giorno lun 29 lug 2019 alle ore 12:49 Wei Liu <li...@gmail.com>
>>> ha scritto:
>>>
>>>>
>>>> Dear All :
>>>>
>>>>          1) First create ledger, add msg 1, 2, 3 into the ledger
>>>>          2) Do not close the current ledger;
>>>>          3) Received the msg 1 and 2;
>>>>          4) Received the msg 3 after closed the ledger;
>>>>
>>>>          I want to know how to read the last message without close the
>>>> current ledger?
>>>>
>>>>         Thanks~
>>>> --
>>>> 一个人只拥有今生今世是不够的,
>>>> 他还应该拥有诗意的世界。
>>>>
>>>>        liuweixh@gmail.com
>>>>
>>>
>>
>> --
>> 一个人只拥有今生今世是不够的,
>> 他还应该拥有诗意的世界。
>>
>>        liuweixh@gmail.com
>>
>

-- 
一个人只拥有今生今世是不够的,
他还应该拥有诗意的世界。

       liuweixh@gmail.com

Re: I want to know how to read the last message without close the current ledger?

Posted by Enrico Olivelli <eo...@gmail.com>.
Il mar 30 lug 2019, 04:17 Wei Liu <li...@gmail.com> ha scritto:

> Thank you very much for your explanation.
>
> I think the current design is therefore a single writer, who writes the
> same message to multiple bookies  in parallel(no leader) and the server
> updates lac only rely on client submit.
> It may result in delay in receiving the last message or in user usage
> complexity.
>

If you have a continuous stream of data from the writer you get a great
throughput and all of the guarantees of BK.

If you have very few writes you have to do what I said before .

If you are experiencing low throughput consider using the asynchronous API
and tune you journal settings on the bookie

Enrico



> Enrico Olivelli <eo...@gmail.com> 于2019年7月29日周一 下午7:07写道:
>
>> Hello Wei Liu,
>> This is about the core feature of BookKeeper, that is the Last
>> AddConfirmed Protocol (LAC for friends).
>>
>> BookKeeper guarantees to the readers that once you read an entry you will
>> always be able to read it.
>> The reader is able to "see"  the entries only after it has the guarantee
>> that the writer has received the acknowledgement of a successful write with
>> an quorum of bookies.
>>
>> In order to make it possible the writer "piggy backs" the id of the
>> LastAddConfirmed entry to the bookies and the reader then is able to use
>> this value (by reading it with readLastAddConfirmed) in order to have this
>> reference id.
>>
>> You have these ways to get your work done:
>> 1) write no-operation entries to the ledger, this will make the LAC
>> advance even in absence of "application" entries
>> 2) use the "ExplicitLAC" feature, that is a background activity that
>> sends the current LastAddConfirmed to the bookies even in absence of writes
>> after a configurable delay (this is like option 1 but is it automatic, but
>> it is still not available in the new API)
>> 3) use readUnconfirmedEntries: this bypasses the LAC protocol at all, so
>> you can read every entry, but you will need to use an out-of-band channel
>> to pass the id of the entries to read
>>
>> I hope that helps
>>
>> Enrico
>>
>>
>>
>>
>>
>>
>>
>> Il giorno lun 29 lug 2019 alle ore 12:49 Wei Liu <li...@gmail.com> ha
>> scritto:
>>
>>>
>>> Dear All :
>>>
>>>          1) First create ledger, add msg 1, 2, 3 into the ledger
>>>          2) Do not close the current ledger;
>>>          3) Received the msg 1 and 2;
>>>          4) Received the msg 3 after closed the ledger;
>>>
>>>          I want to know how to read the last message without close the
>>> current ledger?
>>>
>>>         Thanks~
>>> --
>>> 一个人只拥有今生今世是不够的,
>>> 他还应该拥有诗意的世界。
>>>
>>>        liuweixh@gmail.com
>>>
>>
>
> --
> 一个人只拥有今生今世是不够的,
> 他还应该拥有诗意的世界。
>
>        liuweixh@gmail.com
>

Re: I want to know how to read the last message without close the current ledger?

Posted by Wei Liu <li...@gmail.com>.
Thank you very much for your explanation.

I think the current design is therefore a single writer, who writes the
same message to multiple bookies  in parallel(no leader) and the server
updates lac only rely on client submit.
It may result in delay in receiving the last message or in user usage
complexity.

Enrico Olivelli <eo...@gmail.com> 于2019年7月29日周一 下午7:07写道:

> Hello Wei Liu,
> This is about the core feature of BookKeeper, that is the Last
> AddConfirmed Protocol (LAC for friends).
>
> BookKeeper guarantees to the readers that once you read an entry you will
> always be able to read it.
> The reader is able to "see"  the entries only after it has the guarantee
> that the writer has received the acknowledgement of a successful write with
> an quorum of bookies.
>
> In order to make it possible the writer "piggy backs" the id of the
> LastAddConfirmed entry to the bookies and the reader then is able to use
> this value (by reading it with readLastAddConfirmed) in order to have this
> reference id.
>
> You have these ways to get your work done:
> 1) write no-operation entries to the ledger, this will make the LAC
> advance even in absence of "application" entries
> 2) use the "ExplicitLAC" feature, that is a background activity that sends
> the current LastAddConfirmed to the bookies even in absence of writes after
> a configurable delay (this is like option 1 but is it automatic, but it is
> still not available in the new API)
> 3) use readUnconfirmedEntries: this bypasses the LAC protocol at all, so
> you can read every entry, but you will need to use an out-of-band channel
> to pass the id of the entries to read
>
> I hope that helps
>
> Enrico
>
>
>
>
>
>
>
> Il giorno lun 29 lug 2019 alle ore 12:49 Wei Liu <li...@gmail.com> ha
> scritto:
>
>>
>> Dear All :
>>
>>          1) First create ledger, add msg 1, 2, 3 into the ledger
>>          2) Do not close the current ledger;
>>          3) Received the msg 1 and 2;
>>          4) Received the msg 3 after closed the ledger;
>>
>>          I want to know how to read the last message without close the
>> current ledger?
>>
>>         Thanks~
>> --
>> 一个人只拥有今生今世是不够的,
>> 他还应该拥有诗意的世界。
>>
>>        liuweixh@gmail.com
>>
>

-- 
一个人只拥有今生今世是不够的,
他还应该拥有诗意的世界。

       liuweixh@gmail.com

Re: I want to know how to read the last message without close the current ledger?

Posted by Enrico Olivelli <eo...@gmail.com>.
Hello Wei Liu,
This is about the core feature of BookKeeper, that is the Last AddConfirmed
Protocol (LAC for friends).

BookKeeper guarantees to the readers that once you read an entry you will
always be able to read it.
The reader is able to "see"  the entries only after it has the guarantee
that the writer has received the acknowledgement of a successful write with
an quorum of bookies.

In order to make it possible the writer "piggy backs" the id of the
LastAddConfirmed entry to the bookies and the reader then is able to use
this value (by reading it with readLastAddConfirmed) in order to have this
reference id.

You have these ways to get your work done:
1) write no-operation entries to the ledger, this will make the LAC advance
even in absence of "application" entries
2) use the "ExplicitLAC" feature, that is a background activity that sends
the current LastAddConfirmed to the bookies even in absence of writes after
a configurable delay (this is like option 1 but is it automatic, but it is
still not available in the new API)
3) use readUnconfirmedEntries: this bypasses the LAC protocol at all, so
you can read every entry, but you will need to use an out-of-band channel
to pass the id of the entries to read

I hope that helps

Enrico







Il giorno lun 29 lug 2019 alle ore 12:49 Wei Liu <li...@gmail.com> ha
scritto:

>
> Dear All :
>
>          1) First create ledger, add msg 1, 2, 3 into the ledger
>          2) Do not close the current ledger;
>          3) Received the msg 1 and 2;
>          4) Received the msg 3 after closed the ledger;
>
>          I want to know how to read the last message without close the
> current ledger?
>
>         Thanks~
> --
> 一个人只拥有今生今世是不够的,
> 他还应该拥有诗意的世界。
>
>        liuweixh@gmail.com
>