Flavio Paiva Junqueira commented on ZOOKEEPER-358:

Thinking more carefully about this modification, I wonder if it really makes 
sense to throw an exception if you try to open a ledger that doesn't exist. 
Currently, the code of openLedger returns null if the id passed does not exist. 

I'm questioning the validity of the modification because I have been working on 
a patch to make create, open, and close operations asynchronous, and with 
asynchronous operations we cannot really throw an exception. 

In summary, I think I prefer the current approach (the one in trunk) because 
we'll have to do something similar with an asynchronous version of open. That 
is, we'll indicate that an attempt to open a non-existing ledger is invalid 
through a null ledger handle or through a return code value. 

> Throw exception when ledger does not exist
> ------------------------------------------
>                 Key: ZOOKEEPER-358
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-358
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Luca Telloli
>            Assignee: Flavio Paiva Junqueira
>            Priority: Minor
>         Attachments: ZOOKEEPER-358.patch
> Currently, openLedger() in the BookKeeper client returns null if the ledger 
> ID does not exist on ZK. Maybe it would be better to throw a specific 
> exception so it can be handled by the client side. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to