You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Stefan Groschupf (JIRA)" <ji...@apache.org> on 2006/04/26 01:14:02 UTC

[jira] Created: (HADOOP-166) IPC is unable to invoke methods that use interfaces as parameter

IPC is unable to invoke methods that use interfaces as parameter
----------------------------------------------------------------

         Key: HADOOP-166
         URL: http://issues.apache.org/jira/browse/HADOOP-166
     Project: Hadoop
        Type: Improvement

  Components: ipc  
    Reporter: Stefan Groschupf
    Priority: Minor
 Attachments: RPC_interface_supportV1.patch

Methods of the implementation class are searched via method name and call parameters that can be implementations of the interfaces defined in the method signature.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-166) IPC is unable to invoke methods that use interfaces as parameter

Posted by "Stefan Groschupf (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-166?page=all ]

Stefan Groschupf updated HADOOP-166:
------------------------------------

    Attachment: RPC_interface_supportV2.patch

Make sense.
Here an update as you suggested.
I renamed the declaredClass into instanceClass in the readObject method, so the change looks much larger as it is, but I found using two variables with the same name not that senseful. 

Looks that overall better?


> IPC is unable to invoke methods that use interfaces as parameter
> ----------------------------------------------------------------
>
>          Key: HADOOP-166
>          URL: http://issues.apache.org/jira/browse/HADOOP-166
>      Project: Hadoop
>         Type: Improvement

>   Components: ipc
>     Reporter: Stefan Groschupf
>     Priority: Minor
>  Attachments: RPC_interface_supportV1.patch, RPC_interface_supportV2.patch
>
> Methods of the implementation class are searched via method name and call parameters that can be implementations of the interfaces defined in the method signature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HADOOP-166) IPC is unable to invoke methods that use interfaces as parameter

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-166?page=comments#action_12376385 ] 

Doug Cutting commented on HADOOP-166:
-------------------------------------

The problem isn't that the parameter is an interface, but rather that the declared class in the implementation is not exactly the same class as the instance passed.  One way to fix this would be to add the list of parameter types of the client method when writing the invocation, since those should match the server implementation, but that would make each RPC call bigger.  Alternately one could, as your patch suggests, search for an appropriate method.  However, your search code is not  quite correct.  The search should be ordered from the implementation class through its superclasses, to find the most specific implementing method.  And searching adds a cost to each RPC, so we'd probably want to cache the results of searches.

So I think I probably prefer adding the parameter types to the invocation.  This can be easily fixed in ObjectWritable by having it write two class names for Writable parameters: both the declared parameter type and the instance type.

> IPC is unable to invoke methods that use interfaces as parameter
> ----------------------------------------------------------------
>
>          Key: HADOOP-166
>          URL: http://issues.apache.org/jira/browse/HADOOP-166
>      Project: Hadoop
>         Type: Improvement

>   Components: ipc
>     Reporter: Stefan Groschupf
>     Priority: Minor
>  Attachments: RPC_interface_supportV1.patch
>
> Methods of the implementation class are searched via method name and call parameters that can be implementations of the interfaces defined in the method signature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-166) IPC is unable to invoke methods that use interfaces as parameter

Posted by "Stefan Groschupf (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-166?page=all ]

Stefan Groschupf updated HADOOP-166:
------------------------------------

    Attachment: RPC_interface_supportV1.patch

A test that shows the problem and a patch suggestion.

> IPC is unable to invoke methods that use interfaces as parameter
> ----------------------------------------------------------------
>
>          Key: HADOOP-166
>          URL: http://issues.apache.org/jira/browse/HADOOP-166
>      Project: Hadoop
>         Type: Improvement

>   Components: ipc
>     Reporter: Stefan Groschupf
>     Priority: Minor
>  Attachments: RPC_interface_supportV1.patch
>
> Methods of the implementation class are searched via method name and call parameters that can be implementations of the interfaces defined in the method signature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HADOOP-166) IPC is unable to invoke methods that use interfaces as parameter

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-166?page=all ]
     
Doug Cutting resolved HADOOP-166:
---------------------------------

    Fix Version: 0.2
     Resolution: Fixed
      Assign To: Doug Cutting

I just committed a fix for this.  Thanks for your help, Stefan!

> IPC is unable to invoke methods that use interfaces as parameter
> ----------------------------------------------------------------
>
>          Key: HADOOP-166
>          URL: http://issues.apache.org/jira/browse/HADOOP-166
>      Project: Hadoop
>         Type: Improvement

>   Components: ipc
>     Reporter: Stefan Groschupf
>     Assignee: Doug Cutting
>     Priority: Minor
>      Fix For: 0.2
>  Attachments: RPC_interface_supportV1.patch, RPC_interface_supportV2.patch
>
> Methods of the implementation class are searched via method name and call parameters that can be implementations of the interfaces defined in the method signature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira