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


##########
be/src/io/fs/fs_utils.h:
##########
@@ -17,15 +17,103 @@
 
 #pragma once
 
-#include <string>
-#include <system_error>
+#include "common/status.h"
+#include "io/fs/file_system.h"
 
 namespace doris {
 namespace io {
 
-std::string errno_to_str();
-std::string errcode_to_str(const std::error_code& ec);
-std::string hdfs_error();
+struct FilePathDesc {
+    FilePathDesc(const std::string& path) { filepath = path; }
+    FilePathDesc() {}

Review Comment:
   warning: use '= default' to define a trivial default constructor 
[modernize-use-equals-default]
   
   ```suggestion
       FilePathDesc() = default;
   ```
   



##########
be/src/tools/meta_tool.cpp:
##########
@@ -301,14 +294,14 @@
 }
 
 void show_segment_footer(const std::string& file_name) {
-    std::unique_ptr<RandomAccessFile> input_file;
-    Status status = doris::Env::Default()->new_random_access_file(file_name, 
&input_file);
+    doris::io::FileReaderSPtr file_reader;
+    Status st = doris::io::global_local_filesystem()->open_file(file_name, 
&file_reader);
     if (!status.ok()) {
-        std::cout << "open file failed: " << status.to_string() << std::endl;
+        std::cout << "open file failed: " << status << std::endl;

Review Comment:
   warning: use of undeclared identifier 'status' [clang-diagnostic-error]
   ```cpp
           std::cout << "open file failed: " << status << std::endl;
                                                ^
   ```
   



##########
be/src/tools/meta_tool.cpp:
##########
@@ -301,14 +294,14 @@ Status get_segment_footer(RandomAccessFile* input_file, 
SegmentFooterPB* footer)
 }
 
 void show_segment_footer(const std::string& file_name) {
-    std::unique_ptr<RandomAccessFile> input_file;
-    Status status = doris::Env::Default()->new_random_access_file(file_name, 
&input_file);
+    doris::io::FileReaderSPtr file_reader;
+    Status st = doris::io::global_local_filesystem()->open_file(file_name, 
&file_reader);
     if (!status.ok()) {

Review Comment:
   warning: use of undeclared identifier 'status' [clang-diagnostic-error]
   ```cpp
       if (!status.ok()) {
            ^
   ```
   



##########
be/src/tools/meta_tool.cpp:
##########
@@ -301,14 +294,14 @@
 }
 
 void show_segment_footer(const std::string& file_name) {
-    std::unique_ptr<RandomAccessFile> input_file;
-    Status status = doris::Env::Default()->new_random_access_file(file_name, 
&input_file);
+    doris::io::FileReaderSPtr file_reader;
+    Status st = doris::io::global_local_filesystem()->open_file(file_name, 
&file_reader);
     if (!status.ok()) {
-        std::cout << "open file failed: " << status.to_string() << std::endl;
+        std::cout << "open file failed: " << status << std::endl;
         return;
     }
     SegmentFooterPB footer;
-    status = get_segment_footer(input_file.get(), &footer);
+    status = get_segment_footer(file_reader.get(), &footer);
     if (!status.ok()) {

Review Comment:
   warning: use of undeclared identifier 'status' [clang-diagnostic-error]
   ```cpp
       if (!status.ok()) {
            ^
   ```
   



##########
be/src/tools/meta_tool.cpp:
##########
@@ -301,14 +294,14 @@
 }
 
 void show_segment_footer(const std::string& file_name) {
-    std::unique_ptr<RandomAccessFile> input_file;
-    Status status = doris::Env::Default()->new_random_access_file(file_name, 
&input_file);
+    doris::io::FileReaderSPtr file_reader;
+    Status st = doris::io::global_local_filesystem()->open_file(file_name, 
&file_reader);
     if (!status.ok()) {
-        std::cout << "open file failed: " << status.to_string() << std::endl;
+        std::cout << "open file failed: " << status << std::endl;
         return;
     }
     SegmentFooterPB footer;
-    status = get_segment_footer(input_file.get(), &footer);
+    status = get_segment_footer(file_reader.get(), &footer);
     if (!status.ok()) {
         std::cout << "get footer failed: " << status.to_string() << std::endl;

Review Comment:
   warning: use of undeclared identifier 'status' [clang-diagnostic-error]
   ```cpp
           std::cout << "get footer failed: " << status.to_string() << 
std::endl;
                                                 ^
   ```
   



##########
be/src/tools/meta_tool.cpp:
##########
@@ -301,14 +294,14 @@
 }
 
 void show_segment_footer(const std::string& file_name) {
-    std::unique_ptr<RandomAccessFile> input_file;
-    Status status = doris::Env::Default()->new_random_access_file(file_name, 
&input_file);
+    doris::io::FileReaderSPtr file_reader;
+    Status st = doris::io::global_local_filesystem()->open_file(file_name, 
&file_reader);
     if (!status.ok()) {
-        std::cout << "open file failed: " << status.to_string() << std::endl;
+        std::cout << "open file failed: " << status << std::endl;
         return;
     }
     SegmentFooterPB footer;
-    status = get_segment_footer(input_file.get(), &footer);
+    status = get_segment_footer(file_reader.get(), &footer);

Review Comment:
   warning: use of undeclared identifier 'status' [clang-diagnostic-error]
   ```cpp
       status = get_segment_footer(file_reader.get(), &footer);
       ^
   ```
   



##########
be/test/olap/segcompaction_test.cpp:
##########
@@ -26,6 +26,7 @@
 #include "env/env_posix.h"

Review Comment:
   warning: 'env/env_posix.h' file not found [clang-diagnostic-error]
   ```cpp
   #include "env/env_posix.h"
            ^
   ```
   



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