platoneko commented on code in PR #35307:
URL: https://github.com/apache/doris/pull/35307#discussion_r1618554692


##########
be/src/io/fs/s3_file_system.cpp:
##########
@@ -230,71 +203,32 @@ Status S3FileSystem::delete_file_impl(const Path& file) {
     auto client = _client->get();
     CHECK_S3_CLIENT(client);
 
-    Aws::S3::Model::DeleteObjectRequest request;
     auto key = DORIS_TRY(get_key(file));
-    request.WithBucket(_bucket).WithKey(key);
 
-    SCOPED_BVAR_LATENCY(s3_bvar::s3_delete_latency);
-    auto outcome = client->DeleteObject(request);
-    if (outcome.IsSuccess() ||
-        outcome.GetError().GetResponseCode() == 
Aws::Http::HttpResponseCode::NOT_FOUND) {
+    auto resp = client->delete_object({.bucket = _bucket, .key = key});
+
+    if (resp.status.ok() || resp.status.is<ErrorCode::NOT_FOUND>()) {
         return Status::OK();
     }
-    return s3fs_error(outcome.GetError(),
-                      fmt::format("failed to delete file {}", 
full_s3_path(key)));
+    return resp.status.append(fmt::format("failed to delete file {}", 
full_s3_path(key)));

Review Comment:
   
   ```suggestion
       return std::move(resp.status.append(fmt::format("failed to delete file 
{}", full_s3_path(key))));
   ```



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