[ 
https://issues.apache.org/jira/browse/HDFS-2298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Doug Cutting updated HDFS-2298:
-------------------------------

    Attachment: HDFS-2298.patch

Even though Avro RPC is not currently used by Hadoop, checking that RPC methods 
are not overloaded is probably still useful as it will likely simplify wire 
compatibilty (HADOOP-7347), whether implemented with Avro or otherwise.

Here's a patch that fixes this test by eliminating overloaded methods in 
NamenodeProtocols.

There are several cases:
 - ClientProtocol#delete() had two signatures, one deprecated (HADOOP-4940).  
This is a private interface and only the non-deprecated version is called any 
longer, so the deprecated method may now be removed from the protocol.
 - ClientProtocol#rename() has two signatures, one deprecated (HDFS-654).  Both 
are still used, since they have different semantics.  Since the protocol 
methods are private, it is safe to rename one.  The user API can still be 
overloaded.  The new version is now called rename2.  The best practice for 
interoperability when changing semantics of RPC methods is to add a new method.
 - In two cases, different protocols contained methods with the same signature, 
with a single implementation in the namenode.  Perhaps Avro could be altered to 
detect when this is the case and not throw an exception, but this is also 
duplicate code that can be refactored to better reflect the reuse.  So this 
patch adds two new private interfaces BadBlockReportable, shared by 
ClientProtocol & DatanodeProtocol, and VersionRequestable, shared by 
DatanodeProtocol & NamenodeProtocol.
 - Finally, NamenodeProtocol#errorReport() and DatanodeProtocol#errorReport() 
have different parameters and, as RPC methods, should be named differently if 
they're to both be implemented by a single service.  They are thus renamed 
namenodeErrorReport() and datanodeErrorReport() respectively.

> TestDfsOverAvroRpc is failing on trunk
> --------------------------------------
>
>                 Key: HDFS-2298
>                 URL: https://issues.apache.org/jira/browse/HDFS-2298
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.24.0
>            Reporter: Aaron T. Myers
>         Attachments: HDFS-2298.patch
>
>
> The relevant bit of the error:
> {noformat}
> -------------------------------------------------------------------------------
> Test set: org.apache.hadoop.hdfs.TestDfsOverAvroRpc
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.486 sec <<< 
> FAILURE!
> testWorkingDirectory(org.apache.hadoop.hdfs.TestDfsOverAvroRpc)  Time 
> elapsed: 1.424 sec  <<< ERROR!
> org.apache.avro.AvroTypeException: Two methods with same name: delete
> {noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to