You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crunch.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2014/02/16 22:53:19 UTC

[jira] [Updated] (CRUNCH-346) Don't deep-copy immutable Writable PTypes

     [ https://issues.apache.org/jira/browse/CRUNCH-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid updated CRUNCH-346:
--------------------------------

    Attachment: CRUNCH-346.patch

Patch which disables deep-copying on Writable-based primitives, strings, and derived types (in line with how these types are handled in Avro).

> Don't deep-copy immutable Writable PTypes
> -----------------------------------------
>
>                 Key: CRUNCH-346
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-346
>             Project: Crunch
>          Issue Type: Improvement
>            Reporter: Chao Shi
>         Attachments: CRUNCH-346.patch
>
>
> I found getDetachedValue() appears quite often when jstack on one of my pipeline. A piece of stacktrace is shown below. In the pipeline, most of types we used are immutable (e.g. java primitives, strings, protobuf). I think we can avoid deep-copy overhead here.
> "main" prio=10 tid=0x00007f0de801d800 nid=0x7ef runnable [0x00007f0dee66c000]
>    java.lang.Thread.State: RUNNABLE
> 	at org.apache.hadoop.io.BytesWritable.<init>(BytesWritable.java:52)
> 	at org.apache.hadoop.io.BytesWritable.<init>(BytesWritable.java:46)
> 	at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at java.lang.Class.newInstance0(Class.java:355)
> 	at java.lang.Class.newInstance(Class.java:308)
> 	at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(WritableDeepCopier.java:63)
> 	at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(WritableDeepCopier.java:36)
> 	at org.apache.crunch.types.writable.WritableType.getDetachedValue(WritableType.java:125)
> 	at org.apache.crunch.impl.mr.emit.IntermediateEmitter.emit(IntermediateEmitter.java:54)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)