hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo (Nicholas), SZE (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-3048) Stringifier
Date Thu, 20 Mar 2008 20:37:24 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580916#action_12580916

Tsz Wo (Nicholas), SZE commented on HADOOP-3048:

> Well i guess not. The warnings result from obj.getClass() function returning Class<?
extends X>} where X is the erasure of the static type of the expression on which getClass
is called. If you can find a better way of not causing warnings i would gladly accept that.

It seems to me that there is no way to do t.getClass() for generic t without a unchecked warning.
T t = ...;
Class<XXX> c = t.getClass(); //there will be a unchecked warning, no matter XXX is (or
it dose not compile).

I have the following suggestions:
- Only add @SuppressWarnings("unchecked") right behind the required statements but not behind
the entire method.

- Create a static getClass(T) as following:
static public <T> Class<T> getClass(T t) {
    Class<T> clazz = (Class<T>)t.getClass();
    return clazz;
Use getClass(t) instead of t.getClass().  Then, I guess we only need to add one @SuppressWarnings("unchecked")

> Stringifier
> -----------
>                 Key: HADOOP-3048
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3048
>             Project: Hadoop Core
>          Issue Type: New Feature
>    Affects Versions: 0.17.0
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>             Fix For: 0.17.0
>         Attachments: stringifier_v1.patch, stringifier_v2.patch, stringifier_v3.patch
> Storing arbitrary objects in the configuration has been discussed before in HADOOP-449
and HADOOP-1873. Although enabling such functionality has the risk of encouraging people to
put big binary objects in the configuration, for some use cases passing objects to tasks is
absolutely necessary. 
> This issue will track the implementation of a Stringifier interface which stringifies
and destringifies objects. Using this implementation, developers can store objects in the
configuration and restore them later. 
> Any thoughts ?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message