[ https://issues.apache.org/jira/browse/HDFS-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806012#action_12806012 ]
Zlatin Balevsky commented on HDFS-928: -------------------------------------- >From a puristic QE point of view, right now you cannot do any unit tests on >the Datanode component because you inevitably end up testing the RPC code and >the Namenode code. What you have now are integration tests; you absolutely >need to have those but they are not as helpful as unit tests to pinpoint >problems. For example right now a bug in the RPC code will cause the Datanode >tests to fail. If all you know is that a bunch of tests failed, it will take >you less time to find the bug if there are fewer places to start look at. Going back to the reason for this wish, I don't want to reinvent dependency injection but the easier it is to swap things in and out, the easier it is to write tests and to develop. More importantly, it makes it easier for third parties (i.e. myself) to modify the source code for their specific needs and the project as a whole only benefits from this. > Ability to provide custom DatanodeProtocol implementation > --------------------------------------------------------- > > Key: HDFS-928 > URL: https://issues.apache.org/jira/browse/HDFS-928 > Project: Hadoop HDFS > Issue Type: Wish > Components: data-node > Reporter: Zlatin Balevsky > Priority: Trivial > > This should make testing easier as well as allow users to provide their own > RPC/namenode implementations. It's pretty straightforward: > 1. add > interface DatanodeProtocolProvider { > DatanodeProtocol getNameNode(Configuration conf); > } > 2. add a config setting like "dfs.datanode.protocol.impl" > 3. create a default implementation and copy/paste the RPC initialization code > there -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.