You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/04/11 03:22:52 UTC

[doris] branch branch-1.2-lts updated: [Chore](phmap) upgrade phmap to 1.3.8 (pick from #14965) (#18533)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new bf8c8123b1 [Chore](phmap) upgrade phmap to 1.3.8 (pick from #14965) (#18533)
bf8c8123b1 is described below

commit bf8c8123b148ca7fae7671a5408fdd64797c4e78
Author: Jerry Hu <mr...@gmail.com>
AuthorDate: Tue Apr 11 11:22:45 2023 +0800

    [Chore](phmap) upgrade phmap to 1.3.8 (pick from #14965) (#18533)
    
    upgrade phmap to 1.3.8
    
    Co-authored-by: Pxl <px...@qq.com>
---
 be/src/util/brpc_client_cache.h | 22 ++++++++++++++++++++--
 dist/LICENSE-dist.txt           |  2 +-
 thirdparty/CHANGELOG.md         |  2 ++
 thirdparty/vars.sh              |  8 ++++----
 4 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/be/src/util/brpc_client_cache.h b/be/src/util/brpc_client_cache.h
index 81d7af7924..715b580309 100644
--- a/be/src/util/brpc_client_cache.h
+++ b/be/src/util/brpc_client_cache.h
@@ -21,6 +21,7 @@
 
 #include <memory>
 #include <mutex>
+#include <type_traits>
 
 #include "common/config.h"
 #include "gen_cpp/Types_types.h" // TNetworkAddress
@@ -65,7 +66,14 @@ public:
 
     std::shared_ptr<T> get_client(const std::string& host_port) {
         std::shared_ptr<T> stub_ptr;
-        auto get_value = [&stub_ptr](typename StubMap<T>::mapped_type& v) { stub_ptr = v; };
+        auto get_value = [&stub_ptr](const auto& v) {
+            // remove those compatibility codes when we finish upgrade phmap.
+            if constexpr (std::is_same_v<const typename StubMap<T>::mapped_type&, decltype(v)>) {
+                stub_ptr = v;
+            } else {
+                stub_ptr = v.second;
+            }
+        };
         if (LIKELY(_stub_map.if_contains(host_port, get_value))) {
             return stub_ptr;
         }
@@ -73,7 +81,17 @@ public:
         // new one stub and insert into map
         auto stub = get_new_client_no_cache(host_port);
         _stub_map.try_emplace_l(
-                host_port, [&stub](typename StubMap<T>::mapped_type& v) { stub = v; }, stub);
+                host_port,
+                [&stub](const auto& v) {
+                    // remove those compatibility codes when we finish upgrade phmap.
+                    if constexpr (std::is_same_v<const typename StubMap<T>::mapped_type&,
+                                                 decltype(v)>) {
+                        stub = v;
+                    } else {
+                        stub = v.second;
+                    }
+                },
+                stub);
         return stub;
     }
 
diff --git a/dist/LICENSE-dist.txt b/dist/LICENSE-dist.txt
index 3c45a7f391..bbca5718c0 100644
--- a/dist/LICENSE-dist.txt
+++ b/dist/LICENSE-dist.txt
@@ -1523,7 +1523,7 @@ The Apache Software License, Version 2.0
     * arrow: 7.0.0
     * S2: 0.9.0
     * croaringbitmap: 0.4.0
-    * parallel-hashmap: 1.33
+    * parallel-hashmap: 1.3.8
     * orc: 1.7.2
     * cctz: 2.3
     * aws sdk: 1.9.211
diff --git a/thirdparty/CHANGELOG.md b/thirdparty/CHANGELOG.md
index c963ce5269..e92bd2ade5 100644
--- a/thirdparty/CHANGELOG.md
+++ b/thirdparty/CHANGELOG.md
@@ -31,6 +31,8 @@ This file contains version of the third-party dependency libraries in the build-
 
 ## v20221228
 - Modified: simdjson 1.0.2 -> 3.0.1
+## v20221209
+- Modified: update parallel-hashmap from 1.33 to 1.3.8
 
 ## v20221015
 
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index 2535b8eea6..fcf39912c3 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -270,10 +270,10 @@ FMT_SOURCE="fmt-7.1.3"
 FMT_MD5SUM="2522ec65070c0bda0ca288677ded2831"
 
 # parallel-hashmap
-PARALLEL_HASHMAP_DOWNLOAD="https://github.com/greg7mdp/parallel-hashmap/archive/1.33.tar.gz"
-PARALLEL_HASHMAP_NAME="parallel-hashmap-1.33.tar.gz"
-PARALLEL_HASHMAP_SOURCE="parallel-hashmap-1.33"
-PARALLEL_HASHMAP_MD5SUM="7626b5215f745c4ce59b5a4e41d16235"
+PARALLEL_HASHMAP_DOWNLOAD="https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.8.tar.gz"
+PARALLEL_HASHMAP_NAME="parallel-hashmap-1.3.8.tar.gz"
+PARALLEL_HASHMAP_SOURCE="parallel-hashmap-1.3.8"
+PARALLEL_HASHMAP_MD5SUM="1b8130d0b4f656257ef654699bfbf941"
 
 # orc
 ORC_DOWNLOAD="https://archive.apache.org/dist/orc/orc-1.7.2/orc-1.7.2.tar.gz"


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