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

Sijie Guo commented on BOOKKEEPER-203:
--------------------------------------

Ivan, thanks for reviewing.

{quote}
MetaStoreException is not used. Is in wrong patch i guess?
{quote}

I think it is introduced when I am working on BOOKKEEPER-204. would remove it 
in next patch.

{quote}
BookKeeper.java patch removed the throwing of NoSuchLedgerExistsException, 
which we added in BOOKKEEPER-273. Is this intentional?
{quote}

Actually, I put in AbstractZkLedgerManager, because NONODE is zookeeper's 
return code. You could refer it as below:
{code}
+    @Override
+    public void deleteLedger(final long ledgerId, final GenericCallback<Void> 
cb) {
+        zk.delete(getLedgerPath(ledgerId), -1, new VoidCallback() {
+            @Override
+            public void processResult(int rc, String path, Object ctx) {
+                int bkRc;
+                if (rc == KeeperException.Code.NONODE.intValue()) {
+                    LOG.warn("Ledger node does not exist in ZooKeeper: 
ledgerId={}", ledgerId);
+                    bkRc = BKException.Code.NoSuchLedgerExistsException;
+                } else if (rc == KeeperException.Code.OK.intValue()) {
+                    bkRc = BKException.Code.OK;
+                } else {
+                    bkRc = BKException.Code.ZKException;
+                }
+                cb.operationComplete(bkRc, (Void)null);
+            }
+        }, null);
+    }
{code}

{quote}
there are two overloads of getClass where only one is ever used. setClass is 
unused.
{quote}

ah, ur right. would remove unused methods.



{quote}
LedgerManagerFactory#newLedgerManagerFactory breaks getLedgerManagerType(). if 
factoryClass is null and layout is null, it should check getLedgerManagerType 
before setting factoryClass to FlatLedgerManagerType or 
HierarchicalLedgerManagerType.
{quote}
yes. ur right. would improve it.





                
> improve ledger manager interface to remove zookeeper dependency on metadata 
> operations.
> ---------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-203
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-203
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-client, bookkeeper-server
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-203.diff, BOOKKEEPER-203.diff_v2, 
> BOOKKEEPER-203.diff_v3, BOOKKEEPER-203.diff_v4
>
>
> we need to improve ledger manager interface to remove zookeeper dependency on 
> metadata operations, so it is easy for us to implement a MetaStore based 
> ledger manager.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to