gavinchou commented on code in PR #53587:
URL: https://github.com/apache/doris/pull/53587#discussion_r2217383722


##########
be/src/olap/tablet.cpp:
##########
@@ -1455,18 +1459,21 @@ void Tablet::get_compaction_status(std::string* 
json_result) {
         // remote peer
         rapidjson::Value peer_addr;
         std::string addr = replica_info.host + ":" + 
std::to_string(replica_info.brpc_port);
-        peer_addr.SetString(addr.c_str(), addr.length(), 
status.GetAllocator());
+        peer_addr.SetString(addr.c_str(), static_cast<uint32_t>(addr.length()),
+                            status.GetAllocator());
         status.AddMember("remote peer", peer_addr, status.GetAllocator());
         // last failure status
         rapidjson::Value compaction_status;
-        
compaction_status.SetString(_last_single_compaction_failure_status.c_str(),
-                                    
_last_single_compaction_failure_status.length(),
-                                    status.GetAllocator());
+        compaction_status.SetString(
+                _last_single_compaction_failure_status.c_str(),
+                
static_cast<uint32_t>(_last_single_compaction_failure_status.length()),
+                status.GetAllocator());
         status.AddMember("last failure status", compaction_status, 
status.GetAllocator());
         // last fetched rowset
         rapidjson::Value version;
         std::string fetched_version = _last_fetched_version.to_string();
-        version.SetString(fetched_version.c_str(), fetched_version.length(), 
status.GetAllocator());
+        version.SetString(fetched_version.c_str(), 
static_cast<uint32_t>(fetched_version.length()),

Review Comment:
   cast_set



##########
be/src/olap/rowset/segment_v2/plain_page.h:
##########
@@ -60,7 +61,7 @@ class PlainPageBuilder : public 
PageBuilderHelper<PlainPageBuilder<Type> > {
     }
 
     Status finish(OwnedSlice* slice) override {
-        encode_fixed32_le((uint8_t*)&_buffer[0], _count);
+        encode_fixed32_le((uint8_t*)&_buffer[0], 
static_cast<uint32_t>(_count));

Review Comment:
   ditto



##########
be/src/olap/tablet.cpp:
##########
@@ -2176,7 +2187,7 @@ Status Tablet::_read_cooldown_meta(const StorageResource& 
storage_resource,
     auto buf = std::unique_ptr<uint8_t[]>(new uint8_t[file_size]);
     RETURN_IF_ERROR(tablet_meta_reader->read_at(0, {buf.get(), file_size}, 
&bytes_read));
     RETURN_IF_ERROR(tablet_meta_reader->close());
-    if (!tablet_meta_pb->ParseFromArray(buf.get(), file_size)) {
+    if (!tablet_meta_pb->ParseFromArray(buf.get(), 
static_cast<int>(file_size))) {

Review Comment:
   cast_set



##########
be/src/olap/short_key_index.cpp:
##########
@@ -26,11 +26,12 @@
 #include "util/coding.h"
 
 namespace doris {
+#include "common/compile_check_begin.h"
 
 static bvar::Adder<size_t> 
g_short_key_index_memory_bytes("doris_short_key_index_memory_bytes");
 
 Status ShortKeyIndexBuilder::add_item(const Slice& key) {
-    put_varint32(&_offset_buf, _key_buf.size());
+    put_varint32(&_offset_buf, static_cast<uint32_t>(_key_buf.size()));

Review Comment:
   cast_set<>



##########
be/src/olap/short_key_index.cpp:
##########
@@ -39,12 +40,12 @@ Status ShortKeyIndexBuilder::add_item(const Slice& key) {
 Status ShortKeyIndexBuilder::finalize(uint32_t num_segment_rows, 
std::vector<Slice>* body,
                                       segment_v2::PageFooterPB* page_footer) {
     page_footer->set_type(segment_v2::SHORT_KEY_PAGE);
-    page_footer->set_uncompressed_size(_key_buf.size() + _offset_buf.size());
+    page_footer->set_uncompressed_size(static_cast<uint32_t>(_key_buf.size() + 
_offset_buf.size()));

Review Comment:
   cast_set<> 



##########
be/src/olap/rowset/segment_v2/rle_page.h:
##########
@@ -100,7 +101,7 @@ class RlePageBuilder : public 
PageBuilderHelper<RlePageBuilder<Type> > {
         // here should Flush first and then encode the count header
         // or it will lead to a bug if the header is less than 8 byte and the 
data is small
         _rle_encoder->Flush();
-        encode_fixed32_le(&_buf[0], _count);
+        encode_fixed32_le(&_buf[0], static_cast<uint32_t>(_count));

Review Comment:
   cast_set



##########
be/src/olap/rowset/segment_v2/plain_page.h:
##########
@@ -154,7 +155,7 @@ class PlainPageDecoder : public PageDecoder {
 
         DCHECK_LE(pos, _num_elems);
 
-        _cur_idx = pos;
+        _cur_idx = static_cast<uint32_t>(pos);

Review Comment:
   cast_set<>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to