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

James Clampffer updated HDFS-10380:
-----------------------------------
    Attachment: HDFS-10380.HDFS-8707.000.patch

First quick pass:
-got rid of RpcConnection template parameter
-typedefed asio::ip::tcp::socket as rpc_socket_t, could just be socket_t.
-renamed RpcConnectionImpl::next_layer_ to RpcConnectionImpl::socket_ to make 
the code a bit more self explanatory.

todo:
-Was in a hurry to get this building so just declared all of the methods in 
rpc_connection.h as inline.  Will move to rpc_connection.cc.
-rpc_engine_test (the test the template was there for) needs a lot of work to 
be able to run with this change.  It's fairly dense and has nearly no comments 
so it might be easier to just rewrite it.

> libhdfs++:  Get rid of socket template parameter in RpcConnection
> -----------------------------------------------------------------
>
>                 Key: HDFS-10380
>                 URL: https://issues.apache.org/jira/browse/HDFS-10380
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>         Attachments: HDFS-10380.HDFS-8707.000.patch
>
>
> RpcConnection is always templated on asio::ip::tcp::socket except for in 
> rpc_engine_test.cc.  My understanding is the original reason for using this 
> as a template parameter was to be able to use trait injection in gmock tests.
> This is useful for testing but makes debugging a lot more tricky due to the 
> extra stuff that shows up on the stack.  Heavily templated code also tends to 
> produce very unhelpful compile errors e.g. when a missing semicolon in a 
> templated class turns into pages of errors coming out of stuff that depended 
> on the instantiation.
> This sort of work was already accomplished elsewhere by HDFS-9144, it looks 
> like RpcConnection was one of the few areas they were left in place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to