github-actions[bot] commented on code in PR #38626:
URL: https://github.com/apache/doris/pull/38626#discussion_r1698569028


##########
be/src/http/action/calc_file_crc_action.cpp:
##########
@@ -58,16 +59,28 @@ Status CalcFileCrcAction::_handle_calc_crc(HttpRequest* 
req, uint32_t* crc_value
         return Status::InternalError("convert tablet id or failed, {}", 
e.what());
     }
 
-    TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id);
+    BaseTabletSPtr tablet = nullptr;
+
+    if (auto cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {

Review Comment:
   warning: 'auto cloudEngine' can be declared as 'auto *cloudEngine' 
[readability-qualified-auto]
   
   ```suggestion
       if (auto *cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {
   ```
   



##########
be/src/olap/base_tablet.h:
##########
@@ -256,6 +256,21 @@ class BaseTablet {
     // Return the merged schema of all rowsets
     virtual TabletSchemaSPtr merged_tablet_schema() const { return 
_max_version_schema; }
 
+    void traverse_rowsets(std::function<void(const RowsetSharedPtr&)> visitor,
+                          bool include_stale = false) {
+        std::shared_lock rlock(_meta_lock);
+        for (auto& [v, rs] : _rs_version_map) {
+            visitor(rs);
+        }
+        if (!include_stale) return;

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
           if (!include_stale) { return;
   }
   ```
   



##########
be/src/http/action/calc_file_crc_action.cpp:
##########
@@ -58,16 +59,28 @@
         return Status::InternalError("convert tablet id or failed, {}", 
e.what());
     }
 
-    TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id);
+    BaseTabletSPtr tablet = nullptr;
+
+    if (auto cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {
+        tablet = DORIS_TRY(cloudEngine->get_tablet(tablet_id));
+        // sync all rowsets
+        
RETURN_IF_ERROR(std::dynamic_pointer_cast<CloudTablet>(tablet)->sync_rowsets(-1));
+    } else if (auto storageEngine = dynamic_cast<StorageEngine*>(&_engine)) {

Review Comment:
   warning: 'auto storageEngine' can be declared as 'auto *storageEngine' 
[readability-qualified-auto]
   
   ```suggestion
       } else if (auto *storageEngine = dynamic_cast<StorageEngine*>(&_engine)) 
{
   ```
   



-- 
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