pengxiangyu commented on code in PR #15238:
URL: https://github.com/apache/doris/pull/15238#discussion_r1054072370


##########
be/src/olap/rowset/beta_rowset.cpp:
##########
@@ -58,6 +58,15 @@ std::string BetaRowset::segment_cache_path(int segment_id) {
     return fmt::format("{}/{}_{}", _tablet_path, rowset_id().to_string(), 
segment_id);
 }
 
+// just check that the format is xxx_segmentid and segmentid is numeric
+bool BetaRowset::is_segment_cache_dir(const std::string& cache_dir) {
+    auto segment_id_pos = cache_dir.find_last_of('_') + 1;
+    if (segment_id_pos >= cache_dir.size() || segment_id_pos == 0) {

Review Comment:
   add comment: cache_dir.find_last_of('_') == -1 or segment_id_pos >= 
cache_dir.size()



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to