morningman commented on a change in pull request #8273:
URL: https://github.com/apache/incubator-doris/pull/8273#discussion_r816850436



##########
File path: be/src/agent/pusher.cpp
##########
@@ -47,16 +47,15 @@ Pusher::Pusher(OLAPEngine* engine, const TPushReq& push_req)
 
 Pusher::~Pusher() {}
 
-AgentStatus Pusher::init() {
-    AgentStatus status = DORIS_SUCCESS;
+Status Pusher::init() {
+    Status status = Status::OK();

Review comment:
       Remove this line and define it at line 74

##########
File path: be/src/agent/pusher.cpp
##########
@@ -73,7 +72,7 @@ AgentStatus Pusher::init() {
     // Set download param
     string tmp_file_dir;
     status = _get_tmp_file_dir(olap_table->storage_root_path_name(), 
&tmp_file_dir);
-    if (status != DORIS_SUCCESS) {
+    if (status != Status::OK()) {
         LOG(WARNING) << "get local path failed. tmp file dir: " << 
tmp_file_dir;

Review comment:
       print `st.get_error_msg()`

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -1541,11 +1523,11 @@ void TaskWorkerPool::_move_dir_thread_callback() {
         TStatus task_status;
 
         // TODO: move dir
-        AgentStatus status =
+        Status status =
                 _move_dir(move_dir_req.tablet_id, move_dir_req.schema_hash, 
move_dir_req.src,
                           move_dir_req.job_id, true /* TODO */, &error_msgs);
 
-        if (status != DORIS_SUCCESS) {
+        if (status != Status::OK()) {

Review comment:
       use `status.ok()`.
   Better to modify all other places.

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -1581,7 +1563,7 @@ AgentStatus TaskWorkerPool::_move_dir(const TTabletId 
tablet_id, const TSchemaHa
         LOG(INFO) << "failed to get tablet. tablet_id:" << tablet_id
                   << ", schema hash:" << schema_hash;
         error_msgs->push_back("failed to get tablet");
-        return DORIS_TASK_REQUEST_ERROR;
+        return Status::InvalidArgument("Could not find tablet");

Review comment:
       If using Status, we don't need `error_msgs` anymore.




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