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 40eea3457aa2192f82b76321439e6d64b2620d84
Author: yangzhg <yangz...@gmail.com>
AuthorDate: Tue Jun 7 13:01:15 2022 +0800

    remove libuuid use boost uuid
---
 CMake/FindLibUUID.cmake                | 23 -----------------------
 README.md                              |  1 -
 bootstrap                              |  1 -
 src/CMakeLists.txt                     |  6 ------
 src/proto/ClientDatanodeProtocol.proto |  2 ++
 src/proto/ClientNamenodeProtocol.proto |  2 ++
 src/proto/IpcConnectionContext.proto   |  2 ++
 src/proto/ProtobufRpcEngine.proto      |  3 +++
 src/proto/RpcHeader.proto              |  2 ++
 src/proto/Security.proto               |  2 ++
 src/proto/datatransfer.proto           |  2 ++
 src/proto/encryption.proto             |  2 ++
 src/proto/hdfs.proto                   |  1 +
 src/rpc/RpcClient.cpp                  |  9 ++++-----
 14 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/CMake/FindLibUUID.cmake b/CMake/FindLibUUID.cmake
deleted file mode 100644
index ac6e726..0000000
--- a/CMake/FindLibUUID.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-# - Find libuuid
-# Find the native LIBUUID includes and library
-#
-#  LIBUUID_INCLUDE_DIRS - where to find uuid/uuid.h, etc.
-#  LIBUUID_LIBRARIES    - List of libraries when using uuid.
-#  LIBUUID_FOUND        - True if uuid found.
-
-IF (LIBUUID_INCLUDE_DIRS)
-  # Already in cache, be silent
-  SET(LIBUUID_FIND_QUIETLY TRUE)
-ENDIF (LIBUUID_INCLUDE_DIRS)
-
-FIND_PATH(LIBUUID_INCLUDE_DIRS uuid/uuid.h)
-
-SET(LIBUUID_NAMES uuid)
-FIND_LIBRARY(LIBUUID_LIBRARIES NAMES ${LIBUUID_NAMES})
-
-# handle the QUIETLY and REQUIRED arguments and set LIBUUID_FOUND to TRUE if 
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUUID DEFAULT_MSG LIBUUID_LIBRARIES 
LIBUUID_INCLUDE_DIRS)
-
-MARK_AS_ADVANCED(LIBUUID_LIBRARIES LIBUUID_INCLUDE_DIRS)
diff --git a/README.md b/README.md
index 9e72801..5a7a3eb 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,6 @@ To build libhdfs3, the following libraries are needed.
     google protobuf                 http://code.google.com/p/protobuf/
     libxml2                         http://www.xmlsoft.org/
     kerberos                        http://web.mit.edu/kerberos/
-    libuuid                         http://sourceforge.net/projects/libuuid/
     libgsasl                        http://www.gnu.org/software/gsasl/
 
 To run tests, the following libraries are needed.
diff --git a/bootstrap b/bootstrap
index d660dfd..5020f55 100755
--- a/bootstrap
+++ b/bootstrap
@@ -63,7 +63,6 @@ Dependencies:
     kerberos        http://web.mit.edu/kerberos/
     libgsasl        http://www.gnu.org/software/gsasl/
     libxml2         http://xmlsoft.org/
-    libuuid         http://sourceforge.net/projects/libuuid/
     boost 1.53+     http://www.boost.org/
                     [boost is not required if c++ compiler is g++ 4.6.0+ or 
clang++ with stdc++]
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bc20d08..ca6b702 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -77,12 +77,6 @@ IF(NEED_GCCEH)
     TARGET_LINK_LIBRARIES(libhdfs3-shared gcc_eh)
 ENDIF(NEED_GCCEH)
 
-IF(OS_LINUX)
-    TARGET_LINK_LIBRARIES(libhdfs3-static ${LIBUUID_LIBRARIES})
-    TARGET_LINK_LIBRARIES(libhdfs3-shared ${LIBUUID_LIBRARIES})
-    INCLUDE_DIRECTORIES(${LIBUUID_INCLUDE_DIRS})
-ENDIF(OS_LINUX)
-
 INCLUDE_DIRECTORIES(${libhdfs3_ROOT_SOURCES_DIR})
 INCLUDE_DIRECTORIES(${libhdfs3_COMMON_SOURCES_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/proto/ClientDatanodeProtocol.proto 
b/src/proto/ClientDatanodeProtocol.proto
index 14aba63..f5c0bd2 100644
--- a/src/proto/ClientDatanodeProtocol.proto
+++ b/src/proto/ClientDatanodeProtocol.proto
@@ -25,6 +25,8 @@
 // This file contains protocol buffers that are used throughout HDFS -- i.e.
 // by the client, server, and data transfer protocols.
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.hdfs.protocol.proto";
 option java_outer_classname = "ClientDatanodeProtocolProtos";
 option java_generic_services = true;
diff --git a/src/proto/ClientNamenodeProtocol.proto 
b/src/proto/ClientNamenodeProtocol.proto
index 1ab69cd..4f0182c 100644
--- a/src/proto/ClientNamenodeProtocol.proto
+++ b/src/proto/ClientNamenodeProtocol.proto
@@ -22,6 +22,8 @@
  * for what changes are allowed for a *stable* .proto interface.
  */
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.hdfs.protocol.proto";
 option java_outer_classname = "ClientNamenodeProtocolProtos";
 option java_generic_services = true;
diff --git a/src/proto/IpcConnectionContext.proto 
b/src/proto/IpcConnectionContext.proto
index 9f4a551..2f9b257 100644
--- a/src/proto/IpcConnectionContext.proto
+++ b/src/proto/IpcConnectionContext.proto
@@ -22,6 +22,8 @@
  * for what changes are allowed for a *stable* .proto interface.
  */
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.ipc.protobuf";
 option java_outer_classname = "IpcConnectionContextProtos";
 option java_generate_equals_and_hash = true;
diff --git a/src/proto/ProtobufRpcEngine.proto 
b/src/proto/ProtobufRpcEngine.proto
index aaaae9e..d21c616 100644
--- a/src/proto/ProtobufRpcEngine.proto
+++ b/src/proto/ProtobufRpcEngine.proto
@@ -28,6 +28,9 @@
  * The messages are sent in addition to the normal RPC header as 
  * defined in RpcHeader.proto
  */
+
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.ipc.protobuf";
 option java_outer_classname = "ProtobufRpcEngineProtos";
 option java_generate_equals_and_hash = true;
diff --git a/src/proto/RpcHeader.proto b/src/proto/RpcHeader.proto
index 9eeb95e..3d6acfd 100644
--- a/src/proto/RpcHeader.proto
+++ b/src/proto/RpcHeader.proto
@@ -22,6 +22,8 @@
  * for what changes are allowed for a *stable* .proto interface.
  */
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.ipc.protobuf";
 option java_outer_classname = "RpcHeaderProtos";
 option java_generate_equals_and_hash = true;
diff --git a/src/proto/Security.proto b/src/proto/Security.proto
index 939de1a..b514c0f 100644
--- a/src/proto/Security.proto
+++ b/src/proto/Security.proto
@@ -22,6 +22,8 @@
  * for what changes are allowed for a *stable* .proto interface.
  */
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.security.proto";
 option java_outer_classname = "SecurityProtos";
 option java_generic_services = true;
diff --git a/src/proto/datatransfer.proto b/src/proto/datatransfer.proto
index d787d8a..7eb6ba7 100644
--- a/src/proto/datatransfer.proto
+++ b/src/proto/datatransfer.proto
@@ -25,6 +25,8 @@
 // This file contains protocol buffers that are used to transfer data
 // to and from the datanode, as well as between datanodes.
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.hdfs.protocol.proto";
 option java_outer_classname = "DataTransferProtos";
 option java_generate_equals_and_hash = true;
diff --git a/src/proto/encryption.proto b/src/proto/encryption.proto
index 53206f8..b29fcde 100644
--- a/src/proto/encryption.proto
+++ b/src/proto/encryption.proto
@@ -26,6 +26,8 @@
  *  by the client, server, and data transfer protocols.
  */
 
+syntax = "proto2";
+
 option java_package = "org.apache.hadoop.hdfs.protocol.proto";
 option java_outer_classname = "EncryptionZonesProtos";
 option java_generate_equals_and_hash = true;
diff --git a/src/proto/hdfs.proto b/src/proto/hdfs.proto
index d85f217..9907fe9 100644
--- a/src/proto/hdfs.proto
+++ b/src/proto/hdfs.proto
@@ -25,6 +25,7 @@
 // This file contains protocol buffers that are used throughout HDFS -- i.e.
 // by the client, server, and data transfer protocols.
 
+syntax = "proto2";
 
 option java_package = "org.apache.hadoop.hdfs.protocol.proto";
 option java_outer_classname = "HdfsProtos";
diff --git a/src/rpc/RpcClient.cpp b/src/rpc/RpcClient.cpp
index fbc68fa..6f807ee 100644
--- a/src/rpc/RpcClient.cpp
+++ b/src/rpc/RpcClient.cpp
@@ -26,7 +26,7 @@
 #include "RpcClient.h"
 #include "Thread.h"
 
-#include <uuid/uuid.h>
+#include <boost/uuid/uuid_generators.hpp>
 
 namespace Hdfs {
 namespace Internal {
@@ -46,10 +46,9 @@ RpcClient & RpcClient::getClient() {
 
 RpcClientImpl::RpcClientImpl() :
     cleaning(false), running(true), count(0) {
-    uuid_t id;
-    uuid_generate(id);
-    clientId.resize(sizeof(uuid_t));
-    memcpy(&clientId[0], id, sizeof(uuid_t));
+    auto id = boost::uuids::random_generator()();
+    clientId.resize(boost::uuids::uuid::static_size());
+    memcpy(clientId.data(), id.begin(), boost::uuids::uuid::static_size());
 #ifdef MOCK
     stub = NULL;
 #endif


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to