diff --git a/dev-support/docker/Dockerfile b/dev-support/docker/Dockerfile index c93c78efd51..56db12a2774 100644 --- a/dev-support/docker/Dockerfile +++ b/dev-support/docker/Dockerfile @@ -38,10 +38,12 @@ ENV DEBCONF_TERSE true # WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default # Ubuntu Java. See Java section below! ###### +<<<<<<< 5f556eacf0fedbaec3cdb819847c7c6c3bacc048 RUN apt-get -q update && apt-get -q install -y \ apt-utils \ build-essential \ bzip2 \ + clang \ curl \ doxygen \ fuse \ diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml index 39372e62ed5..f596eac47e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml @@ -247,5 +247,77 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + test-patch + + false + + + true + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + make_altern + compile + run + + + + + + + + + + + + + + + + + + + + + + native_tests_altern + test + run + + ${skipTests} + + + + + + + + + + + + + + + clean_altern + test + run + + + + + + + + + + + diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt index dc7cd308095..812af4beca9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt @@ -42,6 +42,47 @@ find_package(CyrusSASL) find_package(GSasl) find_package(Threads) +include(CheckCXXSourceCompiles) + +# Check if thread_local is supported +unset (THREAD_LOCAL_SUPPORTED CACHE) +set (CMAKE_REQUIRED_DEFINITIONS "-std=c++11") +set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) +check_cxx_source_compiles( + "#include + int main(void) { + thread_local int s; + return 0; + }" + THREAD_LOCAL_SUPPORTED) +if (NOT THREAD_LOCAL_SUPPORTED) + message(FATAL_ERROR + "FATAL ERROR: The required feature thread_local storage is not supported by your compiler. \ + Known compilers that support this feature: GCC, Visual Studio, Clang (community version), \ + Clang (version for iOS 9 and later).") +endif (NOT THREAD_LOCAL_SUPPORTED) + +# Check if PROTOC library was compiled with the compatible compiler by trying +# to compile some dummy code +unset (PROTOC_IS_COMPATIBLE CACHE) +set (CMAKE_REQUIRED_LIBRARIES ${PROTOBUF_LIBRARY} ${PROTOBUF_PROTOC_LIBRARY}) +check_cxx_source_compiles( + "#include + #include + int main(void) { + ::google::protobuf::io::ZeroCopyOutputStream *out = NULL; + ::google::protobuf::io::Printer printer(out, '$'); + printer.PrintRaw(std::string(\"test\")); + return 0; + }" + PROTOC_IS_COMPATIBLE) +if (NOT PROTOC_IS_COMPATIBLE) + message(FATAL_ERROR + "FATAL ERROR: the Protocol Buffers Library and the Libhdfs++ Library must both be compiled \ + with the same (or compatible) compiler. Normally only the same major versions of the same \ + compiler are compatible with each other.") +endif (NOT PROTOC_IS_COMPATIBLE) + find_program(MEMORYCHECK_COMMAND valgrind HINTS ${VALGRIND_DIR} ) set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --error-exitcode=1") message(STATUS "valgrind location: ${MEMORYCHECK_COMMAND}") @@ -104,6 +145,11 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11 -g - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fPIC -fno-strict-aliasing") endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + add_definitions(-DASIO_HAS_STD_ADDRESSOF -DASIO_HAS_STD_ARRAY -DASIO_HAS_STD_ATOMIC -DASIO_HAS_CSTDINT -DASIO_HAS_STD_SHARED_PTR -DASIO_HAS_STD_TYPE_TRAITS -DASIO_HAS_VARIADIC_TEMPLATES -DASIO_HAS_STD_FUNCTION -DASIO_HAS_STD_CHRONO -DASIO_HAS_STD_SYSTEM_ERROR) +endif () + # Mac OS 10.7 and later deprecates most of the methods in OpenSSL. # Add -Wno-deprecated-declarations to avoid the warnings. if(APPLE) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/block_location.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/block_location.h index 5a03f41d9e7..4d824d65297 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/block_location.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/block_location.h @@ -23,152 +23,152 @@ namespace hdfs { class DNInfo { public: - DNInfo() : xfer_port(-1), info_port(-1), IPC_port(-1), info_secure_port(-1) {} + DNInfo() : xfer_port_(-1), info_port_(-1), IPC_port_(-1), info_secure_port_(-1) {} std::string getHostname() const { - return hostname; + return hostname_; } void setHostname(const std::string & hostname) { - this->hostname = hostname; + this->hostname_ = hostname; } std::string getIPAddr() const { - return ip_addr; + return ip_addr_; } void setIPAddr(const std::string & ip_addr) { - this->ip_addr = ip_addr; + this->ip_addr_ = ip_addr; } std::string getNetworkLocation() const { - return network_location; + return network_location_; } void setNetworkLocation(const std::string & location) { - this->network_location = location; + this->network_location_ = location; } int getXferPort() const { - return xfer_port; + return xfer_port_; } void setXferPort(int xfer_port) { - this->xfer_port = xfer_port; + this->xfer_port_ = xfer_port; } int getInfoPort() const { - return info_port; + return info_port_; } void setInfoPort(int info_port) { - this->info_port = info_port; + this->info_port_ = info_port; } int getIPCPort() const { - return IPC_port; + return IPC_port_; } void setIPCPort(int IPC_port) { - this->IPC_port = IPC_port; + this->IPC_port_ = IPC_port; } int getInfoSecurePort() const { - return info_secure_port; + return info_secure_port_; } void setInfoSecurePort(int info_secure_port) { - this->info_secure_port = info_secure_port; + this->info_secure_port_ = info_secure_port; } private: - std::string hostname; - std::string ip_addr; - std::string network_location; - int xfer_port; - int info_port; - int IPC_port; - int info_secure_port; + std::string hostname_; + std::string ip_addr_; + std::string network_location_; + int xfer_port_; + int info_port_; + int IPC_port_; + int info_secure_port_; }; class BlockLocation { public: bool isCorrupt() const { - return corrupt; + return corrupt_; } void setCorrupt(bool corrupt) { - this->corrupt = corrupt; + this->corrupt_ = corrupt; } int64_t getLength() const { - return length; + return length_; } void setLength(int64_t length) { - this->length = length; + this->length_ = length; } int64_t getOffset() const { - return offset; + return offset_; } void setOffset(int64_t offset) { - this->offset = offset; + this->offset_ = offset; } const std::vector & getDataNodes() const { - return dn_info; + return dn_info_; } void setDataNodes(const std::vector & dn_info) { - this->dn_info = dn_info; + this->dn_info_ = dn_info; } private: - bool corrupt; - int64_t length; - int64_t offset; // Offset of the block in the file - std::vector dn_info; // Info about who stores each block + bool corrupt_; + int64_t length_; + int64_t offset_; // Offset of the block in the file + std::vector dn_info_; // Info about who stores each block }; class FileBlockLocation { public: uint64_t getFileLength() { - return fileLength; + return fileLength_; } void setFileLength(uint64_t fileLength) { - this->fileLength = fileLength; + this->fileLength_ = fileLength; } bool isLastBlockComplete() const { - return this->lastBlockComplete; + return this->lastBlockComplete_; } void setLastBlockComplete(bool lastBlockComplete) { - this->lastBlockComplete = lastBlockComplete; + this->lastBlockComplete_ = lastBlockComplete; } bool isUnderConstruction() const { - return underConstruction; + return underConstruction_; } void setUnderConstruction(bool underConstruction) { - this->underConstruction = underConstruction; + this->underConstruction_ = underConstruction; } const std::vector & getBlockLocations() const { - return blockLocations; + return blockLocations_; } void setBlockLocations(const std::vector & blockLocations) { - this->blockLocations = blockLocations; + this->blockLocations_ = blockLocations; } private: - uint64_t fileLength; - bool lastBlockComplete; - bool underConstruction; - std::vector blockLocations; + uint64_t fileLength_; + bool lastBlockComplete_; + bool underConstruction_; + std::vector blockLocations_; }; } // namespace hdfs diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/hdfspp.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/hdfspp.h index 40ceef529df..673455e0763 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/hdfspp.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/hdfspp.h @@ -93,7 +93,7 @@ class IoService : public std::enable_shared_from_this **/ class NodeExclusionRule { public: - virtual ~NodeExclusionRule(){}; + virtual ~NodeExclusionRule(); virtual bool IsBadNode(const std::string &node_uuid) = 0; }; @@ -258,7 +258,7 @@ class FileSystem { * this method call. The blocks will be populated or removed in the * background as the result of the routine block maintenance procedures. * - * @param src file name + * @param path file name * @param replication new replication */ virtual void SetReplication(const std::string & path, int16_t replication, std::function handler) = 0; @@ -266,7 +266,7 @@ class FileSystem { /** * Sets the modification and access time of the file to the specified time. - * @param src The string representation of the path + * @param path The string representation of the path * @param mtime The number of milliseconds since Jan 1, 1970. * Setting mtime to -1 means that modification time should not * be set by this call. @@ -297,7 +297,7 @@ class FileSystem { * Retrieves the file system information as a whole, such as the total raw size of all files in the filesystem * and the raw capacity of the filesystem * - * @param FsInfo struct to be populated by GetFsStats + * FsInfo struct is populated by GetFsStats **/ virtual void GetFsStats( const std::function &handler) = 0; @@ -357,7 +357,6 @@ class FileSystem { * Rename - Rename file. * @param oldPath The path of the source file. (must be non-empty) * @param newPath The path of the destination file. (must be non-empty) - * @return Returns 0 on success, -1 on error. */ virtual void Rename(const std::string &oldPath, const std::string &newPath, const std::function &handler) = 0; @@ -379,7 +378,6 @@ class FileSystem { * @param path file path * @param username If it is empty, the original username remains unchanged. * @param groupname If it is empty, the original groupname remains unchanged. - * @param recursive If true, the change will be propagated recursively. */ virtual void SetOwner(const std::string & path, const std::string & username, const std::string & groupname, const std::function &handler) = 0; @@ -469,7 +467,7 @@ class FileSystem { * Note that it is an error to destroy the filesystem from within a filesystem * callback. It will lead to a deadlock and the termination of the process. */ - virtual ~FileSystem() {}; + virtual ~FileSystem(); /** diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h index 0a42314e544..8d29a402bca 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h @@ -28,9 +28,9 @@ namespace hdfs { struct NamenodeInfo { - NamenodeInfo(const std::string &nameservice, const std::string &nodename, const URI &uri) : - nameservice(nameservice), name(nodename), uri(uri) {} - NamenodeInfo(){}; + NamenodeInfo(const std::string &nameservice_, const std::string &nodename_, const URI &uri_) : + nameservice(nameservice_), name(nodename_), uri(uri_) {} + NamenodeInfo(){} //nameservice this belongs to std::string nameservice; //node name diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/status.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/status.h index 6fc00b13eb6..d0922aec063 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/status.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/status.h @@ -26,7 +26,7 @@ namespace hdfs { class Status { public: // Create a success status. - Status() : code_(0) {}; + Status() : code_(0) {} // Note: Avoid calling the Status constructors directly, call the factory methods instead diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/auth_info.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/auth_info.h index 3f2f1afafd5..2b3f36d5263 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/auth_info.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/auth_info.h @@ -19,7 +19,7 @@ #ifndef LIB_FS_AUTHINFO_H #define LIB_FS_AUTHINFO_H -#include +#include "common/optional_wrapper.h" namespace hdfs { diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h index 1e7ee5b0702..734f036271b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include "common/optional_wrapper.h" namespace hdfs { @@ -76,8 +76,8 @@ protected: struct ConfigData { std::string value; bool final; - ConfigData() : final(false){}; - ConfigData(const std::string &value) : value(value), final(false) {} + ConfigData() : final(false){} + ConfigData(const std::string &value_) : value(value_), final(false) {} void operator=(const std::string &new_value) { value = new_value; final = false; @@ -85,9 +85,9 @@ protected: }; typedef std::map ConfigMap; - Configuration() {}; - Configuration(ConfigMap &src_map) : raw_values_(src_map){}; - Configuration(const ConfigMap &src_map) : raw_values_(src_map){}; + Configuration() {} + Configuration(ConfigMap &src_map) : raw_values_(src_map){} + Configuration(const ConfigMap &src_map) : raw_values_(src_map){} static std::vector GetDefaultFilenames(); @@ -98,7 +98,7 @@ protected: static std::string fixCase(const std::string &in) { std::string result(in); - for (auto & c: result) c = (char) toupper(c); + for (auto & c: result) c = static_cast(toupper(c)); return result; } }; diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/libhdfs_events_impl.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/libhdfs_events_impl.h index 73b20fb2a7e..e43266a82b1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/libhdfs_events_impl.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/libhdfs_events_impl.h @@ -20,9 +20,8 @@ #define LIBHDFSPP_COMMON_LIBHDFSEVENTS_IMPL #include "hdfspp/events.h" +#include "common/optional_wrapper.h" - -#include #include namespace hdfs { diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/optional_wrapper.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/optional_wrapper.h new file mode 100644 index 00000000000..2d15dc38d0b --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/optional_wrapper.h @@ -0,0 +1,43 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMMON_OPTIONAL_WRAPPER_H_ +#define COMMON_OPTIONAL_WRAPPER_H_ + +#ifdef __clang__ + #pragma clang diagnostic push + #if __has_warning("-Wweak-vtables") + #pragma clang diagnostic ignored "-Wweak-vtables" + #endif + #if __has_warning("-Wreserved-id-macro") + #pragma clang diagnostic ignored "-Wreserved-id-macro" + #endif + #if __has_warning("-Wextra-semi") + #pragma clang diagnostic ignored "-Wextra-semi" + #endif + #define TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS //For Clang < 3_4_2 +#endif + +#include + +#ifdef __clang__ + #undef TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS //For Clang < 3_4_2 + #pragma clang diagnostic pop +#endif + +#endif //COMMON_OPTIONAL_WRAPPER_H_ diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/util.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/util.h index 09d8188c58b..be902bd138b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/util.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/util.h @@ -160,7 +160,7 @@ class SwappableCallbackHolder { } else if (callback_accessed_) { // Common case where callback has been invoked but caller may not know LOG_DEBUG(kAsyncRuntime, << "AtomicSwapCallback called after callback has been accessed"); - return false; + return callback_; } CallbackType old = callback_; diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/bad_datanode_tracker.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/bad_datanode_tracker.cc index 55d14cd4e66..be9020f80b8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/bad_datanode_tracker.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/bad_datanode_tracker.cc @@ -20,6 +20,8 @@ namespace hdfs { +NodeExclusionRule::~NodeExclusionRule() {} + BadDataNodeTracker::BadDataNodeTracker(const Options& options) : timeout_duration_(options.host_exclusion_duration), test_clock_shift_(0) {} diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.h index 14f7ea83046..4135156d2af 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.h @@ -36,7 +36,7 @@ namespace hdfs { class BlockReader; -class BlockReaderOptions; +struct BlockReaderOptions; class DataNodeConnection; /* diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc index c3407961c47..56d02d8d5bd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc @@ -70,6 +70,8 @@ Status FileSystem::CheckValidReplication(uint16_t replication) { return Status::OK(); } +FileSystem::~FileSystem() {} + /***************************************************************************** * FILESYSTEM BASE CLASS ****************************************************************************/ diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc index ba5556531fa..04ed7eb010f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc @@ -20,7 +20,7 @@ #include "common/util.h" #include "common/logging.h" #include "common/namenode_info.h" -#include "optional.hpp" +#include "common/optional_wrapper.h" #include diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_engine.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_engine.h index 53ec75b1192..6c82ccd163d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_engine.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_engine.h @@ -20,7 +20,7 @@ #define LIB_RPC_SASLENGINE_H #include "hdfspp/status.h" -#include "optional.hpp" +#include "common/optional_wrapper.h" #include diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc index 3d40c0fd6ad..ad8191b5676 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc @@ -19,6 +19,7 @@ #include "rpc_engine.h" #include "rpc_connection.h" #include "common/logging.h" +#include "common/optional_wrapper.h" #include "sasl_engine.h" #include "sasl_protocol.h" @@ -33,8 +34,6 @@ #endif #endif -#include - namespace hdfs { using namespace hadoop::common; diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_ioservice_test.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_ioservice_test.cc index a03f275b7c1..5ee97895cfd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_ioservice_test.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_ioservice_test.cc @@ -99,5 +99,7 @@ int main(int argc, char *argv[]) { // The following line must be executed to initialize Google Mock // (and Google Test) before running the tests. ::testing::InitGoogleMock(&argc, argv); - return RUN_ALL_TESTS(); + int exit_code = RUN_ALL_TESTS(); + google::protobuf::ShutdownProtobufLibrary(); + return exit_code; } diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/node_exclusion_test.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/node_exclusion_test.cc index 35ddc2cba13..d1212b9751f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/node_exclusion_test.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/node_exclusion_test.cc @@ -80,5 +80,7 @@ int main(int argc, char *argv[]) { // The following line must be executed to initialize Google Mock // (and Google Test) before running the tests. ::testing::InitGoogleMock(&argc, argv); - return RUN_ALL_TESTS(); + int exit_code = RUN_ALL_TESTS(); + google::protobuf::ShutdownProtobufLibrary(); + return exit_code; }