orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xndai <...@git.apache.org>
Subject [GitHub] orc pull request #134: Orc 17
Date Wed, 05 Jul 2017 18:54:04 GMT
Github user xndai commented on a diff in the pull request:

    https://github.com/apache/orc/pull/134#discussion_r125728350
  
    --- Diff: c++/src/OrcHdfsFile.cc ---
    @@ -66,22 +64,22 @@ namespace orc {
             options = config->GetOptions();
           }
           hdfs::IoService * io_service = hdfs::IoService::New();
    -      //Wrapping fs into a shared pointer to guarantee deletion
    -      std::shared_ptr<hdfs::FileSystem> fs(hdfs::FileSystem::New(io_service, "",
options));
    -      if (!fs) {
    +      //Wrapping file_system into a unique pointer to guarantee deletion
    +      file_system = std::unique_ptr<hdfs::FileSystem>(hdfs::FileSystem::New(io_service,
"", options));
    +      if (!file_system) {
    --- End diff --
    
    Unfortunately unique_ptr can be redefined as auto_ptr if platform doesn't support unique_ptr
(see orc_config.hh). We talked about removing this redefine, but it hasn't been done yet.
So I'd suggest we stick to file_system.get() != nullptr for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message