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

Sijie Guo commented on BOOKKEEPER-841:
--------------------------------------

[~merlimat] awesome. I will take a look at BOOKKEEPER-695.

the overall patch looks good to me. I just have a few comments.

- for the EntryId used to wrap ledgers map, I would suggest using a negative 
value, so we could differentiate the 'metadata' entry from a 'data' entry. And 
maybe define that entry id as a CONSTANT like METADATA_LEDGERMAP_ENTRY.
- for all header lengths, it might be good to define them as CONSTANTS
- for ledgers map, it would be good to limit the size of 'metadata entry', just 
in case if a ledgers map is large. so a ledgers map entry, would be like:

{code}
length: 0-3
ledger id (-1): 4 - 11
entry id (actually metadata entry type): 12-19
num ledgers stored in current metadata entry: 20 - 23
ledger entries: <ledgerid, size> mapping
{code}

and store the start offset of first ledgers map entry and total number of 
ledgers in the header.

it would make the format itself more extendible 

> Bookie should calculate ledgers map writing a new entry log file
> ----------------------------------------------------------------
>
>                 Key: BOOKKEEPER-841
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-841
>             Project: Bookkeeper
>          Issue Type: Improvement
>          Components: bookkeeper-server
>            Reporter: Sijie Guo
>            Assignee: Matteo Merli
>             Fix For: 4.4.0
>
>         Attachments: 
> 0001-BOOKKEEPER-841-Bookie-should-calculate-ledgers-map-w.patch
>
>
> Bookie should calculate ledgers map when writing a new entry log file. so the 
> bookie doesn't need to scan that entry log file again, which it would improve 
> garbage collection efficiency 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to