hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karthik Kambatla (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-4457) Cleanup unchecked types for EventHandler
Date Tue, 17 May 2016 22:25:12 GMT

    [ https://issues.apache.org/jira/browse/YARN-4457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15287757#comment-15287757
] 

Karthik Kambatla commented on YARN-4457:
----------------------------------------

Thanks for taking the time to clean these up. 

One rather high-level question: since all meaningful events have a type, shouldn't the dispatcher
itself be generic? Are there dispatchers that serve events with closest common ancestor being
only Event and no other subtype? If we do that, would we be able to typify these EventHandlers
better than just <Event>? 


> Cleanup unchecked types for EventHandler
> ----------------------------------------
>
>                 Key: YARN-4457
>                 URL: https://issues.apache.org/jira/browse/YARN-4457
>             Project: Hadoop YARN
>          Issue Type: Improvement
>    Affects Versions: 2.7.1
>            Reporter: Daniel Templeton
>            Assignee: Daniel Templeton
>         Attachments: YARN-4457.001.patch, YARN-4457.002.patch, YARN-4457.003.patch, YARN-4457.004.patch,
YARN-4457.005.patch
>
>
> The EventHandler class is often used in an untyped context resulting in a bunch of warnings
about unchecked usage.  The culprit is the {{Dispatcher.getHandler()}} method.  Fixing the
typing on the method to return {{EventHandler<Event>}} instead of {{EventHandler}} clears
up the errors and doesn't not introduce any incompatible changes.  In the case that some code
does:
> {code}
> EventHandler h = dispatcher.getHandler();
> {code}
> it will still work and will issue a compiler warning about raw types.  There are, however,
no instances of this issue in the current source base.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org


Mime
View raw message