Skip to content

Commit

Permalink
aws_s3.cc: minor improve
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Oct 6, 2024
1 parent bfd97aa commit 493723c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cloud/aws/aws_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,12 @@ class S3ReadableFile : public CloudStorageReadableFileImpl {
fname_.c_str(), offset, rangeLen);
return IOStatus::IOError("S3ReadableFile vsnprintf ", fname_.c_str());
}
Aws::String range(buffer);

// set up S3 request to read this range
Aws::S3::Model::GetObjectRequest request;
request.SetBucket(ToAwsString(bucket_));
request.SetKey(ToAwsString(fname_));
request.SetRange(range);
request.SetRange(Aws::String(buffer, ret));

Aws::S3::Model::GetObjectOutcome outcome =
s3client_->GetCloudObject(request);
Expand All @@ -332,7 +331,6 @@ class S3ReadableFile : public CloudStorageReadableFileImpl {
fname_.c_str(), offset, buffer, error.GetMessage().c_str());
return IOStatus::IOError(fname_, errmsg.c_str());
}
std::stringstream ss;
// const Aws::S3::Model::GetObjectResult& res = outcome.GetResult();

// extract data payload
Expand Down Expand Up @@ -688,7 +686,7 @@ IOStatus S3StorageProvider::ExistsCloudObject(const std::string& bucket_name,
IOStatus S3StorageProvider::GetCloudObjectSize(const std::string& bucket_name,
const std::string& object_path,
uint64_t* filesize) {
HeadObjectResult result;
HeadObjectResult result;
result.size = filesize;
return HeadObject(bucket_name, object_path, &result);
}
Expand Down

0 comments on commit 493723c

Please sign in to comment.