crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Reid (JIRA)" <>
Subject [jira] [Commented] (CRUNCH-346) Don't deep-copy immutable Writable PTypes
Date Mon, 17 Feb 2014 17:06:19 GMT


Gabriel Reid commented on CRUNCH-346:

Thanks for catching the ByteBuffer issue [~stepinto].

About the PTypes#protos, agreed that the no-op deep copier should be used. The only issue
is the API with which it should be done. Right now the NoOpDeepCopier is used for all derived
types (i.e. everything created within PTypes), but that needs to be changed.

I'm was thinking about the possibility of adding a "derivedImmutable" method (in addition
to the normal "derived") method to allow creating PTypes for derived types that are immutable.
Any thoughts on that?

> Don't deep-copy immutable Writable PTypes
> -----------------------------------------
>                 Key: CRUNCH-346
>                 URL:
>             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<init>(
> 	at<init>(
> 	at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> 	at java.lang.reflect.Constructor.newInstance(
> 	at java.lang.Class.newInstance0(
> 	at java.lang.Class.newInstance(
> 	at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(
> 	at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(
> 	at org.apache.crunch.types.writable.WritableType.getDetachedValue(
> 	at

This message was sent by Atlassian JIRA

View raw message