You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Bill Graham (JIRA)" <ji...@apache.org> on 2012/04/24 08:31:43 UTC

[jira] [Created] (PIG-2663) Expose helpful ScriptState methods

Bill Graham created PIG-2663:
--------------------------------

             Summary: Expose helpful ScriptState methods
                 Key: PIG-2663
                 URL: https://issues.apache.org/jira/browse/PIG-2663
             Project: Pig
          Issue Type: Improvement
            Reporter: Bill Graham
            Assignee: Bill Graham


The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2663) Expose helpful ScriptState methods

Posted by "Bill Graham (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Graham updated PIG-2663:
-----------------------------

    Attachment: PIG-2663.1.patch

Initial patch for review.
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2663) Expose helpful ScriptState methods

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263231#comment-13263231 ] 

Alan Gates commented on PIG-2663:
---------------------------------

+1
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2663) Expose helpful ScriptState methods

Posted by "Bill Graham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264221#comment-13264221 ] 

Bill Graham commented on PIG-2663:
----------------------------------

That seems reasonable. So we'd also then move AliasVisitor and FeatureVisitor to MapReduceOper too.

What about the local cache of MapReduceOper to Aliases and Features that ScriptState holds on to? That would need to stay in ScriptState since that class has the entire plan in scope. Calling those methods would be more efficient then repeatedly calling MapReduceOper.getAlias() since you don't need to re-walk each time. Maybe that's ok.

Ideally MapReduceOper could lazy load a reference to it's alias and feature when its methods are first called, but that class isn't immutable so I don't think that would fly.
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2663) Expose helpful ScriptState methods

Posted by "Bill Graham (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Graham updated PIG-2663:
-----------------------------

       Resolution: Fixed
    Fix Version/s: 0.11
           Status: Resolved  (was: Patch Available)

Committed
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>             Fix For: 0.11
>
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2663) Expose helpful ScriptState methods

Posted by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265925#comment-13265925 ] 

Dmitriy V. Ryaboy commented on PIG-2663:
----------------------------------------

Sounds like a bigger refactor than we bargained for here.
I think initial patch is ok. We can do a separate refactoring pass separately.
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2663) Expose helpful ScriptState methods

Posted by "Bill Graham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265597#comment-13265597 ] 

Bill Graham commented on PIG-2663:
----------------------------------

@Julien I looked some more into moving those methods to MapReduceOper and getAlias is pretty straightforward but getPigFeature poses more issues.

Currently MapReduceOper has a private OPER_FEATURE enum that it sets internally and uses to answer a dozen or so isFoo methods (i.e. isSampler isGroupBy). ScriptState.getPigFeature calls those MapReduceOper.isFoo methods to then map to a package-private PIG_FEATURE enum.

If we moved getPigFeature into MapReduceOper we'd probably want to move PIG_FEATURE with it and we'd need to make it public. We'd then have a private OPER_FEATURE and a *public* PIG_FEATURE in the same class, along with a getPigFeature method and a bunch of isFoo methods. I worry we'd make the MapReduceOper API and it's implementation more confusing, without a significant refactoring. (Or a counter-argument could be made that it's simplifying because we won't have feature logic in two class in two packages. Once class gets more confusing, but logic gets centralized.)

Thoughts?
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2663) Expose helpful ScriptState methods

Posted by "Bill Graham (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Graham updated PIG-2663:
-----------------------------

    Status: Patch Available  (was: Open)
    
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2663) Expose helpful ScriptState methods

Posted by "Julien Le Dem (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263252#comment-13263252 ] 

Julien Le Dem commented on PIG-2663:
------------------------------------

What about moving getAlias() and getFeature() to instance methods MapReduceOper ?
those methods do not really belong to ScriptState.
related: https://issues.apache.org/jira/browse/PIG-2659
                
> Expose helpful ScriptState methods
> ----------------------------------
>
>                 Key: PIG-2663
>                 URL: https://issues.apache.org/jira/browse/PIG-2663
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Bill Graham
>         Attachments: PIG-2663.1.patch
>
>
> The {{ScriptState.getAlias(MapReduceOper mro)}} and {{ScriptState.getFeature(MapReduceOper mro)}} methods are useful in implementations of {{PigProgressNotificationListener}}. I'd like to make them public.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira