[
https://issues.apache.org/jira/browse/CRUNCH-604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15406549#comment-15406549
]
Nithin Asokan commented on CRUNCH-604:
--------------------------------------
[~mkwhitacre] The patch fixes the issue I was seeing. I would like to mention
that the patch did not apply well on _0.8.5_ due to some of the recent changes
in Writables.java part of CRUNCH-539. I had to apply changes from
[Writables#serializeWritableComparableCodes(Configuration)|https://github.com/apache/crunch/blob/a727606eaeaea2d78a161685d9d29217864e6846/crunch-core/src/main/java/org/apache/crunch/types/writable/Writables.java#L132-L141]
so that my job can properly identify writable codes.
Thanks for getting a patch quickly!
> Avoid expensive Writables.reloadWritableComparableCodes where possible
> ----------------------------------------------------------------------
>
> Key: CRUNCH-604
> URL: https://issues.apache.org/jira/browse/CRUNCH-604
> Project: Crunch
> Issue Type: Improvement
> Components: Core
> Affects Versions: 0.13.0
> Reporter: Steven Ruppert
> Assignee: Josh Wills
> Attachments:
> 0001-TupleWritable-only-reload-codes-once-on-setConf.patch,
> 0001-Writables-cache-reloadWritableComparables-when-it-ha.patch,
> CRUNCH-604.patch
>
>
> Every time `setConf` is called on TupleWritable,
> `Writables.reloadWritableComparableCodes(conf)` is called. Unfortunately,
> `SequenceFile$Reader.readValue` calls `setConf` every single time. This burns
> a regrettable amount of CPU time.
> Attached is a patch that prevents a given TupleWritable instance from
> reloading the code more than once, as well as a patch to cache
> (hashCode-wise) reading from the actual hadoop config, which has to run
> regexes and stuff. I can construe situations where this would break (somehow,
> you modify the configuration in between reading to two values), but nothing
> actually sane comes to mind.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)