You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Dhruba Borthakur <dh...@gmail.com> on 2010/12/17 07:44:03 UTC

question about BookKeeper Ledgers

Hi folks,

I have a few questions about BookKeeper APIs:

1. is there a way to atomically check and create a ledger, something similar
to to the POSIX O_CREAT flag? I would like to create a ledger only if the
ledger does not already exist. If it exists, then the createLedger call
should fail. Is there a way to achieve this functionality?
2. Is there a way to find the current size of a ledger?

thanks,
dhruba
-- 
Connect to me at http://www.facebook.com/dhruba

Re: question about BookKeeper Ledgers

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
+1, I think we had discussed this before to provide some kind of namespace in bookkeeper so that applications do not have to worry abt remembering numbers.

Thanks
mahadev


On 12/17/10 10:28 AM, "Dhruba Borthakur" <dh...@gmail.com> wrote:

Thanks Flavio,

i will open JIRAs for these ones thanks.

thanks a bunch,
dhruba

On Fri, Dec 17, 2010 at 3:39 AM, Flavio Junqueira <fp...@yahoo-inc.com> wrote:

> Hi Dhruba, Ledgers are not named by the application currently. We simply
> assign an increasing identification number to a new ledger. Consequently, it
> is not possible to ask BK if ledger "foo" exists.
>
> I don't think it would be difficult to add this feature, though. We keep
> the ledger metadata on ZooKeeper, and we can simply name the corresponding
> znodes  using the alias the application provides. In fact, one option would
> be to implement this alias scheme directly on the application using the same
> ZooKeeper installation.
>
> Regarding the size of a ledger, we keep the entry count, but not the byte
> count currently. This is also an interesting feature we could consider
> adding.
>
> Cheers,
> -Flavio
>
> On Dec 17, 2010, at 7:44 AM, Dhruba Borthakur wrote:
>
> Hi folks,
>
> I have a few questions about BookKeeper APIs:
>
> 1. is there a way to atomically check and create a ledger, something
> similar
> to to the POSIX O_CREAT flag? I would like to create a ledger only if the
> ledger does not already exist. If it exists, then the createLedger call
> should fail. Is there a way to achieve this functionality?
> 2. Is there a way to find the current size of a ledger?
>
> thanks,
> dhruba
> --
> Connect to me at http://www.facebook.com/dhruba
>
>
> *flavio*
> *junqueira*
>
> research scientist
>
> fpj@yahoo-inc.com
> direct +34 93-183-8828
>
> avinguda diagonal 177, 8th floor, barcelona, 08018, es
> phone (408) 349 3300    fax (408) 349 3301
>
>
>


--
Connect to me at http://www.facebook.com/dhruba


Re: question about BookKeeper Ledgers

Posted by Dhruba Borthakur <dh...@gmail.com>.
Thanks Flavio,

i will open JIRAs for these ones thanks.

thanks a bunch,
dhruba

On Fri, Dec 17, 2010 at 3:39 AM, Flavio Junqueira <fp...@yahoo-inc.com> wrote:

> Hi Dhruba, Ledgers are not named by the application currently. We simply
> assign an increasing identification number to a new ledger. Consequently, it
> is not possible to ask BK if ledger "foo" exists.
>
> I don't think it would be difficult to add this feature, though. We keep
> the ledger metadata on ZooKeeper, and we can simply name the corresponding
> znodes  using the alias the application provides. In fact, one option would
> be to implement this alias scheme directly on the application using the same
> ZooKeeper installation.
>
> Regarding the size of a ledger, we keep the entry count, but not the byte
> count currently. This is also an interesting feature we could consider
> adding.
>
> Cheers,
> -Flavio
>
> On Dec 17, 2010, at 7:44 AM, Dhruba Borthakur wrote:
>
> Hi folks,
>
> I have a few questions about BookKeeper APIs:
>
> 1. is there a way to atomically check and create a ledger, something
> similar
> to to the POSIX O_CREAT flag? I would like to create a ledger only if the
> ledger does not already exist. If it exists, then the createLedger call
> should fail. Is there a way to achieve this functionality?
> 2. Is there a way to find the current size of a ledger?
>
> thanks,
> dhruba
> --
> Connect to me at http://www.facebook.com/dhruba
>
>
> *flavio*
> *junqueira*
>
> research scientist
>
> fpj@yahoo-inc.com
> direct +34 93-183-8828
>
> avinguda diagonal 177, 8th floor, barcelona, 08018, es
> phone (408) 349 3300    fax (408) 349 3301
>
>
>


-- 
Connect to me at http://www.facebook.com/dhruba

Re: question about BookKeeper Ledgers

Posted by Flavio Junqueira <fp...@yahoo-inc.com>.
Hi Dhruba, Ledgers are not named by the application currently. We  
simply assign an increasing identification number to a new ledger.  
Consequently, it is not possible to ask BK if ledger "foo" exists.

I don't think it would be difficult to add this feature, though. We  
keep the ledger metadata on ZooKeeper, and we can simply name the  
corresponding znodes  using the alias the application provides. In  
fact, one option would be to implement this alias scheme directly on  
the application using the same ZooKeeper installation.

Regarding the size of a ledger, we keep the entry count, but not the  
byte count currently. This is also an interesting feature we could  
consider adding.

Cheers,
-Flavio

On Dec 17, 2010, at 7:44 AM, Dhruba Borthakur wrote:

> Hi folks,
>
> I have a few questions about BookKeeper APIs:
>
> 1. is there a way to atomically check and create a ledger, something  
> similar
> to to the POSIX O_CREAT flag? I would like to create a ledger only  
> if the
> ledger does not already exist. If it exists, then the createLedger  
> call
> should fail. Is there a way to achieve this functionality?
> 2. Is there a way to find the current size of a ledger?
>
> thanks,
> dhruba
> -- 
> Connect to me at http://www.facebook.com/dhruba

flavio
junqueira

research scientist

fpj@yahoo-inc.com
direct +34 93-183-8828

avinguda diagonal 177, 8th floor, barcelona, 08018, es
phone (408) 349 3300    fax (408) 349 3301