This is an automated email from the ASF dual-hosted git repository. yangzhg pushed a commit to branch libhdfs3 in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
commit 7f5daf2948e82ef5557dfe5ac7bf5fb26d820854 Author: yangzhg <yangz...@gmail.com> AuthorDate: Tue Jun 7 13:20:08 2022 +0800 fix uuid bug --- CMakeLists.txt | 4 ++-- src/rpc/RpcClient.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fdc3fb..c3b2729 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,9 @@ FIND_PACKAGE(KERBEROS REQUIRED) FIND_PACKAGE(GSasl REQUIRED) IF(BUILD_TEST) FIND_PACKAGE(GoogleTest REQUIRED) + INCLUDE_DIRECTORIES(${GoogleTest_INCLUDE_DIR}) + LINK_LIBRARIES(${GoogleTest_LIBRARIES}) ENDIF(BUILD_TEST) -INCLUDE_DIRECTORIES(${GoogleTest_INCLUDE_DIR}) -LINK_LIBRARIES(${GoogleTest_LIBRARIES}) ADD_SUBDIRECTORY(src) IF(BUILD_TEST) diff --git a/src/rpc/RpcClient.cpp b/src/rpc/RpcClient.cpp index 6f807ee..0eba233 100644 --- a/src/rpc/RpcClient.cpp +++ b/src/rpc/RpcClient.cpp @@ -26,6 +26,7 @@ #include "RpcClient.h" #include "Thread.h" +#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_generators.hpp> namespace Hdfs { @@ -46,9 +47,7 @@ RpcClient & RpcClient::getClient() { RpcClientImpl::RpcClientImpl() : cleaning(false), running(true), count(0) { - auto id = boost::uuids::random_generator()(); - clientId.resize(boost::uuids::uuid::static_size()); - memcpy(clientId.data(), id.begin(), boost::uuids::uuid::static_size()); + clientId = boost::uuids::to_string(boost::uuids::random_generator()()); #ifdef MOCK stub = NULL; #endif --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org