zookeeper-bookkeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Junqueira <...@yahoo-inc.com>
Subject Re: Is there any way to set a string name for a ledger and how to do checkpoint ?
Date Wed, 30 May 2012 12:32:52 GMT

On May 30, 2012, at 2:08 PM, Stone wrote:

> Thanks for your reply Flavio. 
> 
> So if I want to use it like log file. I have to maintain a  (name -> ledger_id) mapping
in zookeeper in case restart or program crash ? 

This feature has to be implemented on top of the bookkeeper api, so either you implement it
directly or reuse, for example, the code that Ivan has mentioned in his message. There is
also another proposal in progress to implement managed ledgers that might suit your needs.
Check it here if you're interested:

https://issues.apache.org/jira/browse/BOOKKEEPER-220

> 
> BTW: Is BookKeeper production ready ? 
> 

Afaict, yes.

-Flavio
> 
> 
> 
> On Wed, May 30, 2012 at 6:03 PM, Flavio Junqueira <fpj@yahoo-inc.com> wrote:
> Hi Stone, You can't set the name of a ledger directly through bookkeeper at the moment.
One option to consider is creating a map in zookeeper from name to id.
> 
> On your checkpoint question, I think you're asking how to selectively delete entries
from a ledger. We currently only delete at the granularity of ledgers.
> 
> -Flavio
> 
> On May 30, 2012, at 10:05 AM, Stone wrote:
> 
>> Hello, 
>> 
>> I am new to BookKeeper. Played with the BookKeeper API, I can create a ledger  like
the following: 
>> 
>>   val lh = client.createLedger(3, 2, BookKeeper.DigestType.CRC32, "foobar".getBytes);
>> 
>> and open an existing one with : 
>> 
>> val lh2 = client.openLedger(ledgerId, BookKeeper.DigestType.CRC32, "foobar".getBytes);
>> 
>> 
>> 
>> 
>> but it seems there's no way to give ledger a string name (or ledger id manually)
like a name for a log file.  
>> 
>> Another the question is how can I do checkpointing using BookKeeper ?  What I need
is like write WAL to ledger when the old changes applied I can call 
>>   
>>   ledger.checkPoint()  // which can delete old log entries in a certain ledger. 
>> 
>> 
>> Any suggestions ? 
>> 
>> Thanks & Best Regards,
>> Stone
>> 
> 
> 
> 

flavio
junqueira
senior 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


Mime
View raw message