[
https://issues.apache.org/jira/browse/HADOOP-5369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678130#action_12678130
]
Doug Cutting commented on HADOOP-5369:
--------------------------------------
Overall these look good. A few minor comments:
- Should we switch from using 'size % indexInterval' to 'entriesSinceIndex >
indexInterval'? Then we wouldn't need the indexWanted flag, since
entriesSinceIndex would only be zeroed when an index entry is added.
- data.getLength() is used three times and might thus be put it in a local
'position' variable.
- The lastIndex optimization looks good.
- Why not always trim the arrays to the exact length? We'll nearly always
need to do it when arrays are big, and, when they're small it won't matter.
Also, please add a private method to re-size the arrays to avoid repeating
those 6 lines of code.
> Small tweaks to reduce MapFile index size
> -----------------------------------------
>
> Key: HADOOP-5369
> URL: https://issues.apache.org/jira/browse/HADOOP-5369
> Project: Hadoop Core
> Issue Type: Improvement
> Reporter: Ben Maurer
> Attachments: smaller_mapfile.patch
>
>
> Two minor tweaks can help reduce the memory overhead of the MapFile index a
> bit:
> 1) Because the index file is a sequence file, it's length is not known. That
> means the index is built using the standard "mulitply the size of the buffer
> on overflow" with a factor of 3/2. With small keys, the slack in the index
> can be substantial. This patch has a constant upper bound on the amount of
> slack allowed.
> 2) In block compressed map files the index file often has entries with the
> same offset (because the compressed block had more than index interval keys).
> The entries with identical offsets do not help MapFile do random access any
> faster. This patch eliminates these types of entries from new map files, and
> ignores them while reading old map files. This patch greatly helped with
> memory usage on a compressed hbase table.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.