[
https://issues.apache.org/jira/browse/BOOKKEEPER-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13442424#comment-13442424
]
Sijie Guo commented on BOOKKEEPER-304:
--------------------------------------
the synchronization part looks good to me.
I had some minor comments about the patch.
1) LedgerManagerFactory and LedgerManager is construct in the tests but they
aren't be closed or uninitialized. it might be not a good practice.
2)
{code}
+ List<Long> ledgerList = new ArrayList<Long>(3);
+ LedgerHandle lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
+
+ lh = createAndAddEntriesToLedger();
+ lh.close();
+ ledgerList.add(lh.getId());
{code}
It might be better to put them in a for-loop for same code.
3) About the BookieLedgerIndexer.
3.1) Do we need to put all ledger metadata in memory? Could we do it part by
part? For example, we indexed 1~K ledgers and process them. then we indexed K+1
~ M ledgers and process them. so we don't need to process all ledger metadata
in one time. It might be useful and necessary for a bookkeeper instance
contains large number of ledgers.
3.2) asyncProcessLedgers is not a good api for BookieLedgerIndexer. because
asyncProcessLedgers would read LedgerMetadata from ledger manager. but
BookieLedgerIndexer doesn't use LedgerMetadata at all. so it waste time on
reading all ledger metadata. I would suggest to add better api in LedgerManager
to fit the requirement for Auditor.
> Prepare bookie vs ledgers cache and will be used by the Auditor
> ---------------------------------------------------------------
>
> Key: BOOKKEEPER-304
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-304
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-auto-recovery
> Affects Versions: 4.2.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.2.0
>
> Attachments: BOOKKEEPER-304.1.patch, BOOKKEEPER-304.2.patch,
> BOOKKEEPER-304.2.patch, BOOKKEEPER-304.3.patch, BOOKKEEPER-304.4.patch,
> BOOKKEEPER-304.5.patch, BOOKKEEPER-304.diff
>
>
> This JIRA discusses how to build bookie -> ledgers cache and this will be
> used by the Auditor to publish the suspected ledgers of failed bookies.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira