[ 
https://issues.apache.org/jira/browse/HDFS-7011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14153114#comment-14153114
 ] 

Zhanwei Wang commented on HDFS-7011:
------------------------------------

Blocking SIGPIPE in backend worker thread is not important since it does 
nothing, I agree to discuss it later.

But I have to say use "std::tr1" namespace directly is not inappropriate for 
the following reasons.

1) The basic rule is that we should only use features in C++ standard directly. 
Wrap the nonstandard things if we have to use.

At this time, shared_ptr is already in C++ standard and "std::tr1" namespace is 
NOT in C++ standard. I understand that using "std::tr1::shared_ptr" can make 
old compiler work. But I cannot agree to use nonstandard things everywhere in 
the project.

I'm ok to use "std::tr1::shared_ptr", but introduce it into hdfs::internal 
namespace and do not use nonstandard namespace "std::tr1" directly. Or use 
"std::shared_ptr" directly.

2) Another reason is that I know in some companies, a very old version GCC is 
still used and it does not support C++ 11 features, they use boost to get new 
features of C++ . I do not mean to introduce the debate if we introduce boost 
into the project.  My suggestion is that if we can introduce all C++ 11 
features into namespace "hdfs::internal", it give people opportunity to change 
only few places to switch the implementation of C++ 11 features from compiler 
provided runtime library to boost instead of changing the code everywhere in 
the project. This provide the opportunity that people can create a private 
branch and switch the implementation of C++ 11 features and continually merge 
code from official branch. That is the reason I introduce many C++ 11 features 
such as unordered_map, thread, shared_ptr into namespace "hdfs::internal".

You also agree that we should benefit as many people as possible, right? Do 
such wrap work will not introduce the confusion since the name "unordered_map" 
or "shared_ptr" is known by every c++ programmer and people does not pay much 
attention on which implementation is used. Even if people is curious about the 
implementation, it is easy to find out.


  






> Implement basic utilities for libhdfs3
> --------------------------------------
>
>                 Key: HDFS-7011
>                 URL: https://issues.apache.org/jira/browse/HDFS-7011
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Zhanwei Wang
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-7011-pnative.001.patch, 
> HDFS-7011-pnative.002.patch, HDFS-7011.patch
>
>
> Implement basic utilities such as hash, exception handling, logger, configure 
> parser, checksum calculate and so on.



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

Reply via email to