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

Steve Loughran commented on YARN-5184:
--------------------------------------

The main reason that a lot of hadoop code switched from interfaces like 
{{org.apache.hadoop.mapred.Mapper}} to (abstract) classes like 
{{org.apache.hadoop.mapreduce.Mapper}} was to make it possible to add new 
methods without breaking existing code. That's created an obligation: don't 
break things wherever possible; this JIRA is essentially covering a situation 
where that wasn't quite met.

Now people seem to be arguing the other way: if we add new methods, we don't 
want to provide default implementations, in case people don't implement them. 
Maybe —but the current policy implemented on these classes broke my mocking 
test code even though I wasn't using the new methods; again: a failure. To make 
things worse, I don't think I could even implement the new method in a class 
which could then be compiled against 2.7.x, as it's parameters were new 
datatypes. A default implementation wouldn't have had this problem.

There's no easy answer here. I will note that I have found the implicit policy 
"break things on public classes as we didn't expect you to implement them" 
frustrating at times, especially in testing. 

> Fix up incompatible changes introduced on ContainerStatus and NodeReport
> ------------------------------------------------------------------------
>
>                 Key: YARN-5184
>                 URL: https://issues.apache.org/jira/browse/YARN-5184
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 2.8.0, 2.9.0
>            Reporter: Karthik Kambatla
>            Assignee: Sangjin Lee
>            Priority: Blocker
>         Attachments: YARN-5184-branch-2.8.poc.patch, 
> YARN-5184-branch-2.poc.patch
>
>
> YARN-2882 and YARN-5430 broke compatibility by adding abstract methods to 
> ContainerStatus. Since ContainerStatus is a Public-Stable class, adding 
> abstract methods to this class breaks any extensions. 
> To fix this, we should add default implementations to these new methods and 
> not leave them as abstract. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to