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

Cheolsoo Park commented on PIG-3457:
------------------------------------

[~daijy], I have been thinking about this over the weekend. Your patch totally 
fixes backward incompatibility, but I don't think it solves the fundamental 
issue though. Like [~jeremykarn] says, we need to provide a depreciation path. 
If we don't provide new methods with new types, users cannot upgrade their 
code, so it will be broken again when we remove deprecated types in the future.

But the problem is that we cannot do what [~jeremykarn] suggests in PigRunner 
because PigStats is the return type of PigRunner.run(), and we cannot overload 
a method with different return type. We can either use different method names 
or different java packages. If we do the latter, we can keep two versions of 
classes for JobStats, PigStats, PigRunner, PigServer, etc in 0.12/0.13 and 
retire deprecated ones in 0.14.

I briefly experimented with java packages. Basically, I brought back all the 
old classes (JobStats, PigStats, ScriptState, etc) to "org.apache.pig" and 
moved everything else to a new package called "org.apache.pig.v1". The downside 
of this is that we will end up with a lot of duplicate code (even though it's 
temporary). The upside is that all the deprecated classes will be isolated 
under separate packages and deleted all together in the future. I am not sure 
whether this is a good idea or not.

> Provide backward compatibility for PigStatsUtil and JobStats
> ------------------------------------------------------------
>
>                 Key: PIG-3457
>                 URL: https://issues.apache.org/jira/browse/PIG-3457
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.12.0
>
>         Attachments: PIG-3457-1.patch, PIG-3457-2.patch, PIG-3457-3.patch, 
> PIG-3457-4.patch, PIG-3457-5.patch
>
>
> PIG-3419 restructured PigStatsUtil which break downstream projects such as 
> Oozie. Oozie uses PigStatsUtil.{HDFS_BYTES_WRITTEN, MAP_INPUT_RECORDS, 
> MAP_OUTPUT_RECORDS, REDUCE_INPUT_RECORDS, REDUCE_OUTPUT_RECORDS}. We need to 
> provide a backward compatible way.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to