[
https://issues.apache.org/jira/browse/HDFS-9117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14999662#comment-14999662
]
Haohui Mai commented on HDFS-9117:
----------------------------------
bq. This interface can't be supported while still not using exceptions (as you
indicated a preference for in an earlier review of this code). If an invalid or
too-large value is in the file, the underlying stdlib code will throw an
exception. Optional is not part of the c++11 standard, or I would absolutely
have used it here; it's a good match.
Unfortunately requiring c++ exceptions might not be an option for other users
as discussed in the libhdfs3 branch.
I'm okay to bring it in. Some example can be:
https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Support/ErrorOr.h
http://www.boost.org/doc/libs/1_59_0/boost/optional/optional.hpp
bq. Where would propose that layer should eventually be? I would propose a
stand-alone class in lib/common, myself, but would welcome alternatives for
inclusion in a later Jira.
I agree that {{lib/common}} is a good place if the class only focuses on
parsing the XML without reading files / reading environment variables. The
other parts can live along with the libhdfs compatibility layer for now. I'm
open to pull them to common when it's necessary.
I'll try to go through the patch tomorrow.
> Config file reader / options classes for libhdfs++
> --------------------------------------------------
>
> Key: HDFS-9117
> URL: https://issues.apache.org/jira/browse/HDFS-9117
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Affects Versions: HDFS-8707
> Reporter: Bob Hansen
> Assignee: Bob Hansen
> Attachments: HDFS-9117.HDFS-8707.001.patch,
> HDFS-9117.HDFS-8707.002.patch, HDFS-9117.HDFS-8707.003.patch,
> HDFS-9117.HDFS-8707.004.patch, HDFS-9117.HDFS-8707.005.patch,
> HDFS-9117.HDFS-8707.006.patch, HDFS-9117.HDFS-8707.008.patch,
> HDFS-9117.HDFS-8707.009.patch, HDFS-9117.HDFS-8707.010.patch,
> HDFS-9117.HDFS-8707.011.patch, HDFS-9117.HDFS-8707.012.patch,
> HDFS-9117.HDFS-8707.013.patch, HDFS-9117.HDFS-9288.007.patch
>
>
> For environmental compatability with HDFS installations, libhdfs++ should be
> able to read the configurations from Hadoop XML files and behave in line with
> the Java implementation.
> Most notably, machine names and ports should be readable from Hadoop XML
> configuration files.
> Similarly, an internal Options architecture for libhdfs++ should be developed
> to efficiently transport the configuration information within the system.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)