platoneko commented on code in PR #35307:
URL: https://github.com/apache/doris/pull/35307#discussion_r1618552595
##########
be/src/io/fs/s3_file_system.cpp:
##########
@@ -138,35 +112,34 @@ Status S3ClientHolder::reset(const S3ClientConf& conf) {
{
std::lock_guard lock(_mtx);
- _client = std::move(client);
+ _client = std::make_shared<S3ObjStorageClient>(std::move(client));
_conf = std::move(reset_conf);
}
return Status::OK();
}
-Result<int64_t> S3ClientHolder::object_file_size(const std::string& bucket,
- const std::string& key) const
{
+Result<int64_t> ObjClientHolder::object_file_size(const std::string& bucket,
+ const std::string& key)
const {
auto client = get();
if (!client) {
return ResultError(Status::InternalError("init s3 client error"));
}
- 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()) {
- return ResultError(s3fs_error(outcome.GetError(), fmt::format("failed
to head s3 file {}",
-
full_s3_path(bucket, key))));
+ if (!resp.status.ok()) {
+ return ResultError(resp.status.append(
Review Comment:
```suggestion
return ResultError(std::move(resp.status.append(
```
--
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]