From 97749ed85b620696ba6e032bc3449b6a428ff054 Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Tue, 21 Dec 2021 11:06:12 +0800 Subject: [PATCH] [community][chore] Modify .asf.yaml and fix BE build warning (#7439) --- .asf.yaml | 6 ++++++ be/src/util/tuple_row_zorder_compare.cpp | 7 ++++--- .../apache/doris/clone/ClusterLoadStatistic.java | 14 ++++++++------ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 46b0d89c91..e928b39002 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -21,6 +21,10 @@ github: labels: - data-warehousing - mpp + - olap + - dbms + - apache + - doris enabled_merge_buttons: squash: true merge: false @@ -30,3 +34,5 @@ github: required_pull_request_reviews: dismiss_stale_reviews: true required_approving_review_count: 1 + notifications: + pullrequests_status: dev@doris.apache.org diff --git a/be/src/util/tuple_row_zorder_compare.cpp b/be/src/util/tuple_row_zorder_compare.cpp index 58318e67f4..6697b3c25b 100644 --- a/be/src/util/tuple_row_zorder_compare.cpp +++ b/be/src/util/tuple_row_zorder_compare.cpp @@ -163,13 +163,14 @@ namespace doris { T floating_value = *reinterpret_cast(val); memcpy(&tmp, &floating_value, sizeof(T)); if (UNLIKELY(std::isnan(floating_value))) return 0; + // "int" is enough because U and T are only primitive type + int s = (int)((sizeof(U) - sizeof(T)) * 8); if (floating_value < 0.0) { // Flipping all bits for negative values. - return static_cast(~tmp) << std::max((sizeof(U) - sizeof(T)) * 8, (uint64_t) 0); + return static_cast(~tmp) << std::max(s, 0); } else { // Flipping only first bit. - return (static_cast(tmp) << std::max((sizeof(U) - sizeof(T)) * 8, (uint64_t) 0)) ^ - mask; + return (static_cast(tmp) << std::max(s, 0)) ^ mask; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/clone/ClusterLoadStatistic.java b/fe/fe-core/src/main/java/org/apache/doris/clone/ClusterLoadStatistic.java index 14d7230ace..4626274e64 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/clone/ClusterLoadStatistic.java +++ b/fe/fe-core/src/main/java/org/apache/doris/clone/ClusterLoadStatistic.java @@ -137,12 +137,14 @@ public class ClusterLoadStatistic { beByTotalReplicaCountMaps.put(medium, beByTotalReplicaCount); } - // Actually the partition is [partition_id, index_id], aka pid. - // Multimap PartitionBalanceInfo> - // PartitionBalanceInfo: > - // Only count available bes here, aligned with the beByTotalReplicaCountMaps. - skewMaps = invertedIndex.buildPartitionInfoBySkew(beLoadStatistics.stream().filter(BackendLoadStatistic::isAvailable). - map(BackendLoadStatistic::getBeId).collect(Collectors.toList())); + if (Config.tablet_rebalancer_type.equalsIgnoreCase("Partition")) { + // Actually the partition is [partition_id, index_id], aka pid. + // Multimap PartitionBalanceInfo> + // PartitionBalanceInfo: > + // Only count available bes here, aligned with the beByTotalReplicaCountMaps. + skewMaps = invertedIndex.buildPartitionInfoBySkew(beLoadStatistics.stream().filter(BackendLoadStatistic::isAvailable). + map(BackendLoadStatistic::getBeId).collect(Collectors.toList())); + } } /*