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

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ee330c27cfe [chore](compile) fix some implicit conversions (#55505)
ee330c27cfe is described below

commit ee330c27cfe2609a1a6e8c21b0e562ca95852da9
Author: Gavin Chou <ga...@selectdb.com>
AuthorDate: Wed Sep 3 15:51:02 2025 +0800

    [chore](compile) fix some implicit conversions (#55505)
---
 be/src/cloud/cloud_snapshot_loader.h   |  2 ++
 be/src/cloud/cloud_snapshot_mgr.cpp    | 10 +++++++---
 be/src/cloud/cloud_warm_up_manager.cpp | 29 ++++++++++++++++++-----------
 be/src/exec/tablet_info.h              | 11 +++++++----
 4 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/be/src/cloud/cloud_snapshot_loader.h 
b/be/src/cloud/cloud_snapshot_loader.h
index 13f353eb4a1..c6e690d3e69 100644
--- a/be/src/cloud/cloud_snapshot_loader.h
+++ b/be/src/cloud/cloud_snapshot_loader.h
@@ -23,6 +23,7 @@
 #include "runtime/snapshot_loader.h"
 
 namespace doris {
+#include "common/compile_check_begin.h"
 
 class CloudStorageEngine;
 
@@ -51,4 +52,5 @@ private:
     CloudStorageEngine& _engine;
 };
 
+#include "common/compile_check_end.h"
 } // end namespace doris
diff --git a/be/src/cloud/cloud_snapshot_mgr.cpp 
b/be/src/cloud/cloud_snapshot_mgr.cpp
index 7832969e231..5ceac0700a9 100644
--- a/be/src/cloud/cloud_snapshot_mgr.cpp
+++ b/be/src/cloud/cloud_snapshot_mgr.cpp
@@ -26,6 +26,7 @@
 #include "cloud/cloud_meta_mgr.h"
 #include "cloud/cloud_storage_engine.h"
 #include "cloud/cloud_tablet_mgr.h"
+#include "common/cast_set.h"
 #include "common/config.h"
 #include "common/logging.h"
 #include "common/status.h"
@@ -50,6 +51,7 @@
 #include "util/uid_util.h"
 
 namespace doris {
+#include "common/compile_check_begin.h"
 using namespace ErrorCode;
 
 CloudSnapshotMgr::CloudSnapshotMgr(CloudStorageEngine& engine) : 
_engine(engine) {
@@ -79,7 +81,8 @@ Status CloudSnapshotMgr::make_snapshot(int64_t 
target_tablet_id, StorageResource
 
         tablet_meta_pb.clear_rs_metas(); // copy the rs meta
         if (tablet_meta.all_rs_metas().size() > 0) {
-            
tablet_meta_pb.mutable_inc_rs_metas()->Reserve(tablet_meta.all_rs_metas().size());
+            tablet_meta_pb.mutable_inc_rs_metas()->Reserve(
+                    cast_set<int>(tablet_meta.all_rs_metas().size()));
             for (auto& rs : tablet_meta.all_rs_metas()) {
                 rs->to_rowset_pb(tablet_meta_pb.add_rs_metas());
             }
@@ -166,13 +169,13 @@ Status CloudSnapshotMgr::convert_rowsets(
         LOG(INFO) << "convert delete bitmap rowset_ids. [rowset_ids_size=" << 
rst_ids_size << "]";
         for (size_t i = 0; i < rst_ids_size; ++i) {
             RowsetId rst_id;
-            rst_id.init(old_del_bitmap_pb.rowset_ids(i));
+            rst_id.init(old_del_bitmap_pb.rowset_ids(cast_set<int>(i)));
             auto it = rowset_id_mapping.find(rst_id);
             // It should not happen, if we can't convert some rowid in delete 
bitmap, the
             // data might be inconsist.
             CHECK(it != rowset_id_mapping.end())
                     << "can't find rowset_id " << rst_id.to_string() << " in 
convert_rowset_ids";
-            new_del_bitmap_pb->set_rowset_ids(i, it->second.to_string());
+            new_del_bitmap_pb->set_rowset_ids(cast_set<int>(i), 
it->second.to_string());
         }
     }
     return Status::OK();
@@ -268,4 +271,5 @@ Status CloudSnapshotMgr::_create_rowset_meta(
     return Status::OK();
 }
 
+#include "common/compile_check_end.h"
 } // namespace doris
diff --git a/be/src/cloud/cloud_warm_up_manager.cpp 
b/be/src/cloud/cloud_warm_up_manager.cpp
index 8013a41d271..8310d493009 100644
--- a/be/src/cloud/cloud_warm_up_manager.cpp
+++ b/be/src/cloud/cloud_warm_up_manager.cpp
@@ -27,6 +27,7 @@
 #include "bvar/bvar.h"
 #include "cloud/cloud_tablet_mgr.h"
 #include "cloud/config.h"
+#include "common/cast_set.h"
 #include "common/logging.h"
 #include "io/cache/block_file_cache_downloader.h"
 #include "olap/rowset/beta_rowset.h"
@@ -39,6 +40,7 @@
 #include "util/time.h"
 
 namespace doris {
+#include "common/compile_check_begin.h"
 
 bvar::Adder<uint64_t> g_file_cache_event_driven_warm_up_requested_segment_size(
         "file_cache_event_driven_warm_up_requested_segment_size");
@@ -235,8 +237,9 @@ void CloudWarmUpManager::handle_jobs() {
                     // 1st. download segment files
                     submit_download_tasks(
                             storage_resource.value()->remote_segment_path(*rs, 
seg_id),
-                            rs->segment_file_size(seg_id), 
storage_resource.value()->fs,
-                            expiration_time, wait, false, [tablet, rs, 
seg_id](Status st) {
+                            rs->segment_file_size(cast_set<int>(seg_id)),
+                            storage_resource.value()->fs, expiration_time, 
wait, false,
+                            [tablet, rs, seg_id](Status st) {
                                 VLOG_DEBUG << "warmup rowset " << 
rs->version() << " segment "
                                            << seg_id << " completed";
                                 if 
(tablet->complete_rowset_segment_warmup(rs->rowset_id(), st) ==
@@ -249,9 +252,10 @@ void CloudWarmUpManager::handle_jobs() {
                     int64_t file_size = -1;
                     auto schema_ptr = rs->tablet_schema();
                     auto idx_version = 
schema_ptr->get_inverted_index_storage_format();
-                    const auto& idx_file_info = 
rs->inverted_index_file_info(seg_id);
+                    const auto& idx_file_info = 
rs->inverted_index_file_info(cast_set<int>(seg_id));
                     if (idx_version == InvertedIndexStorageFormatPB::V1) {
-                        auto&& inverted_index_info = 
rs->inverted_index_file_info(seg_id);
+                        auto&& inverted_index_info =
+                                
rs->inverted_index_file_info(cast_set<int>(seg_id));
                         std::unordered_map<int64_t, int64_t> index_size_map;
                         for (const auto& info : 
inverted_index_info.index_info()) {
                             if (info.index_file_size() != -1) {
@@ -502,13 +506,13 @@ std::vector<TReplicaInfo> 
CloudWarmUpManager::get_replica_info(int64_t tablet_id
                    << " tablets, tablet id=" << tablet_id << ", job_id=" << 
job_id;
 
         for (const auto& it : result.tablet_replica_infos) {
-            auto tablet_id = it.first;
+            auto tid = it.first;
             VLOG_DEBUG << "get_replica_info: got " << it.second.size()
-                       << " replica_infos, tablet id=" << tablet_id << ", 
job_id=" << job_id;
+                       << " replica_infos, tablet id=" << tid << ", job_id=" 
<< job_id;
             for (const auto& replica : it.second) {
-                cache[tablet_id] = 
std::make_pair(std::chrono::steady_clock::now(), replica);
+                cache[tid] = std::make_pair(std::chrono::steady_clock::now(), 
replica);
                 replicas.push_back(replica);
-                LOG(INFO) << "get_replica_info: cache add, tablet_id=" << 
tablet_id
+                LOG(INFO) << "get_replica_info: cache add, tablet_id=" << tid
                           << ", job_id=" << job_id;
             }
         }
@@ -587,11 +591,12 @@ Status CloudWarmUpManager::_do_warm_up_rowset(RowsetMeta& 
rs_meta,
         for (int64_t segment_id = 0; segment_id < rs_meta.num_segments(); 
segment_id++) {
             g_file_cache_event_driven_warm_up_requested_segment_num << 1;
             g_file_cache_event_driven_warm_up_requested_segment_size
-                    << rs_meta.segment_file_size(segment_id);
+                    << rs_meta.segment_file_size(cast_set<int>(segment_id));
 
             if (schema_ptr->has_inverted_index() || 
schema_ptr->has_ann_index()) {
                 if (idx_version == InvertedIndexStorageFormatPB::V1) {
-                    auto&& inverted_index_info = 
rs_meta.inverted_index_file_info(segment_id);
+                    auto&& inverted_index_info =
+                            
rs_meta.inverted_index_file_info(cast_set<int>(segment_id));
                     if (inverted_index_info.index_info().empty()) {
                         VLOG_DEBUG << "No index info available for segment " 
<< segment_id;
                         continue;
@@ -607,7 +612,8 @@ Status CloudWarmUpManager::_do_warm_up_rowset(RowsetMeta& 
rs_meta,
                         }
                     }
                 } else { // InvertedIndexStorageFormatPB::V2
-                    auto&& inverted_index_info = 
rs_meta.inverted_index_file_info(segment_id);
+                    auto&& inverted_index_info =
+                            
rs_meta.inverted_index_file_info(cast_set<int>(segment_id));
                     g_file_cache_event_driven_warm_up_requested_index_num << 1;
                     if (inverted_index_info.has_index_size()) {
                         g_file_cache_event_driven_warm_up_requested_index_size
@@ -704,4 +710,5 @@ void CloudWarmUpManager::recycle_cache(int64_t tablet_id,
     }
 }
 
+#include "common/compile_check_end.h"
 } // namespace doris
diff --git a/be/src/exec/tablet_info.h b/be/src/exec/tablet_info.h
index 1dceb102c78..1d13abec44a 100644
--- a/be/src/exec/tablet_info.h
+++ b/be/src/exec/tablet_info.h
@@ -33,6 +33,7 @@
 #include <utility>
 #include <vector>
 
+#include "common/cast_set.h"
 #include "common/logging.h"
 #include "common/object_pool.h"
 #include "common/status.h"
@@ -45,6 +46,7 @@
 #include "vec/exprs/vexpr_fwd.h"
 
 namespace doris {
+#include "common/compile_check_begin.h"
 class MemTracker;
 class SlotDescriptor;
 class TExprNode;
@@ -247,16 +249,16 @@ public:
                         hash_val = HashUtil::zlib_crc_hash_null(hash_val);
                     }
                 }
-                return hash_val % partition.num_buckets;
+                return cast_set<uint32_t>(hash_val % partition.num_buckets);
             };
         } else { // random distribution
             compute_function = [](vectorized::Block* block, uint32_t row,
                                   const VOlapTablePartition& partition) -> 
uint32_t {
                 if (partition.load_tablet_idx == -1) {
                     // for compatible with old version, just do random
-                    return butil::fast_rand() % partition.num_buckets;
+                    return cast_set<uint32_t>(butil::fast_rand() % 
partition.num_buckets);
                 }
-                return partition.load_tablet_idx % partition.num_buckets;
+                return cast_set<uint32_t>(partition.load_tablet_idx % 
partition.num_buckets);
             };
         }
 
@@ -269,7 +271,7 @@ public:
                 auto* partition = partitions[index];
                 if (auto it = partition_tablets_buffer->find(partition);
                     it != partition_tablets_buffer->end()) {
-                    tablet_indexes[index] = it->second; // tablet
+                    tablet_indexes[index] = cast_set<uint32_t>(it->second); // 
tablet
                 } else {
                     // compute and save in buffer
                     (*partition_tablets_buffer)[partition] = 
tablet_indexes[index] =
@@ -439,4 +441,5 @@ private:
     std::unordered_map<int64_t, NodeInfo> _nodes;
 };
 
+#include "common/compile_check_end.h"
 } // namespace doris


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

Reply via email to