Benjamin Reed commented on ZOOKEEPER-288:

looks good. i'd like to see a couple of changes before we commit it:

1) you have genSecurePadding() in two different classes. for maintainability, 
you should only have it in one place.

2) in genLedgerKey and genMacKey, why do you allocate a byte array, do the copy 
and then do the digest.update(), rather than calling digest.update() twice? i 
think it makes is simpler and more readable. 

3) MasterKeys should start with a lower case letter. you never remove from 
MasterKeys, so you should probably make that a WeakHashMap, so that it can get 

4) are the masterkeys stored with the ledger fragment? i couldn't find it.

> Cleanup and fixes to BookKeeper
> -------------------------------
>                 Key: ZOOKEEPER-288
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-288
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>    Affects Versions: 3.0.0
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>         Attachments: ZOOKEEPER-BOOKKEEPER-288.patch, 
> We observed one race condition when multiple threads try to write 
> concurrently. This patch should fix it.  I will also remove some commented 
> code.

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