You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@giraph.apache.org by "Jakob Homan (Created) (JIRA)" <ji...@apache.org> on 2011/11/15 02:07:52 UTC

[jira] [Created] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Simplify return expression in RPCCommunications::getRPCProxy
------------------------------------------------------------

                 Key: GIRAPH-85
                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
             Project: Giraph
          Issue Type: Improvement
            Reporter: Jakob Homan


Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Eli Reisman (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216292#comment-13216292 ] 

Eli Reisman commented on GIRAPH-85:
-----------------------------------

Hi Avery,

It passed "mvn verify" also, just ran it. Thanks!
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237139#comment-13237139 ] 

Jakob Homan commented on GIRAPH-85:
-----------------------------------

Let's go ahead and the suppresswarnings.  Eli, can you update the patch and re-upload? Thanks.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Avery Ching (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217096#comment-13217096 ] 

Avery Ching commented on GIRAPH-85:
-----------------------------------

I just looked at your patch in Eclipse and see that there is now a warning due to 

Type safety: Unchecked cast from VersionedProtocol to CommunicationsInterface<I,V,E,M>.

We can either keep this the way it was before, or add @SuppressWarnings("unchecked") to the method.  I don't have a strong opinion here.  Anyone else care to comment?

                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249999#comment-13249999 ] 

Jakob Homan commented on GIRAPH-85:
-----------------------------------

+1. I've committed this.  Thanks, Eli!

                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250004#comment-13250004 ] 

Hudson commented on GIRAPH-85:
------------------------------

Integrated in Giraph-trunk-Commit #98 (See [https://builds.apache.org/job/Giraph-trunk-Commit/98/])
    GIRAPH-85: Simplify return expression in RPCCommunications::getRPCProxy. Contributed by Eli Reisman. (Revision 1311355)

     Result = SUCCESS
jghoman : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1311355
Files : 
* /incubator/giraph/trunk/CHANGELOG
* /incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/RPCCommunications.java

                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Avery Ching (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216047#comment-13216047 ] 

Avery Ching commented on GIRAPH-85:
-----------------------------------

please make sure it passes 'mvn verify' as well.  That will check rat and checkstyle.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] [Resolved] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Homan resolved GIRAPH-85.
-------------------------------

    Resolution: Fixed
    
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Eli Reisman (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Reisman updated GIRAPH-85:
------------------------------

    Attachment: GIRAPH-85.patch

Simplifies 2 return statements without changing program logic or flow. Passes "mvn test" but not tested on cluster.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Eli Reisman (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Reisman updated GIRAPH-85:
------------------------------

    Attachment: GIRAPH-85-3.patch

This adds the SupressWarnings("unchecked") annotation to several methods that seem to need it for mvn verify to run successfully. It also simplifies one more spot in RPCCommunications.java where variables are used to temporarily hold a return value, but nothing is done with that value before returning it. This brings the grand total to 3 places where this change was made.

I would like to throw the idea out there that assigning to the "proxy" and other variables for a moment DOES have a clarity benefit that I would hate to prune out of the codebase just to help me practice uploading patches, which I have done on GIRAPH-87 and GIRAPH-157. If someone else wants to take a crack at this or if you guys just want to leave it the way already is to forego this extra practice, I will not be upset!

If not, I think this patch will work.

                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249339#comment-13249339 ] 

Jakob Homan commented on GIRAPH-85:
-----------------------------------

bq. I would like to throw the idea out there that assigning to the "proxy" and other variables for a moment DOES have a clarity benefit
Generally, I agree with you in all cases except for
{noformat}X x = z.getX()
return x;{noformat}
which is what we've got here.  Anything more complicated like
{noformat}X x = z.getFoo(){noformat}
or
{noformat}X x = z.getX()/2{noformat}
is probably worth keeping by itself.  The patch looks good, but we need to have you bless its inclusion into Apache. Can you re-upload #3, with the Apache button checked?  Thanks.  I'll commit it thereafter.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] [Assigned] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Homan reassigned GIRAPH-85:
---------------------------------

    Assignee: Eli Reisman
    
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Eli Reisman (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Reisman updated GIRAPH-85:
------------------------------

    Attachment: GIRAPH-85-3.patch

re-uploading this 85-3 patch while remembering to set Grant license button to 'on' !!!

                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>            Assignee: Eli Reisman
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85-3.patch, GIRAPH-85-3.patch, GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Arun Suresh (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150305#comment-13150305 ] 

Arun Suresh commented on GIRAPH-85:
-----------------------------------

Both the proxy objects look different though. But yes, we can create a final local CommunicationInterface<I, V, E, M> proxy object. return that in the first case and in the second case pass it to the run() method of the anonymous inner class inheriting from PrivilegedExceptionAction<CommunicationInterface<I, V, E, M>> 
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>            Reporter: Jakob Homan
>              Labels: newbie
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Eli Reisman (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eli Reisman updated GIRAPH-85:
------------------------------

    Attachment: GIRAPH-85.patch

This is an improved version of GIRAPH-85.patch done in redone in git and meeting the "mvn test" and "mvn checkstyle:check" guidelines. Not tested on cluster setup.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.2.0
>            Reporter: Jakob Homan
>              Labels: newbie
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-85.patch, GIRAPH-85.patch
>
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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] (GIRAPH-85) Simplify return expression in RPCCommunications::getRPCProxy

Posted by "Jakob Homan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GIRAPH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150683#comment-13150683 ] 

Jakob Homan commented on GIRAPH-85:
-----------------------------------

For this newbie issue the idea is just to simplify the repeated pattern 
{noformat}CommunicationsInterface proxy = <code to get proxy>;
return proxy;{noformat}
to the equivalent
{noformat}return <code to get proxy>;{noformat}, removing the temporary variable.
                
> Simplify return expression in RPCCommunications::getRPCProxy
> ------------------------------------------------------------
>
>                 Key: GIRAPH-85
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-85
>             Project: Giraph
>          Issue Type: Improvement
>            Reporter: Jakob Homan
>              Labels: newbie
>
> Twice in RPCCommunications::getRPCProxy a local variable, proxy, is created and immediately returned.  We can simplify this to just return the value.

--
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