platoneko commented on code in PR #35307:
URL: https://github.com/apache/doris/pull/35307#discussion_r1618560548
##########
be/src/io/fs/s3_file_system.cpp:
##########
@@ -345,18 +264,14 @@ Status S3FileSystem::exists_impl(const Path& path, bool*
res) const {
CHECK_S3_CLIENT(client);
auto key = DORIS_TRY(get_key(path));
- Aws::S3::Model::HeadObjectRequest request;
- request.WithBucket(_bucket).WithKey(key);
+ auto resp = client->head_object({.bucket = _bucket, .key = key});
- SCOPED_BVAR_LATENCY(s3_bvar::s3_head_latency);
- auto outcome = client->HeadObject(request);
- if (outcome.IsSuccess()) {
+ if (resp.status.ok()) {
*res = true;
- } else if (outcome.GetError().GetResponseCode() ==
Aws::Http::HttpResponseCode::NOT_FOUND) {
+ } else if (resp.status.is<ErrorCode::NOT_FOUND>()) {
*res = false;
} else {
- return s3fs_error(outcome.GetError(),
- fmt::format("failed to check exists {}",
full_s3_path(key)));
+ return resp.status.append(fmt::format("failed to check exists {}",
full_s3_path(key)));
Review Comment:
ditto
--
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]