adoroszlai commented on code in PR #11372:
URL: https://github.com/apache/ozone/pull/11372#discussion_r4156252062
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3RequestContext.java:
##########
@@ -54,6 +58,16 @@ OzoneVolume getVolume() throws IOException {
return volume;
}
+ OzoneBucket getBucket(String name) throws IOException {
+ if (bucket == null) {
+ bucket = getVolume().getBucket(name);
+ bucketName = name;
+ } else {
+ Preconditions.assertTrue(bucketName.equals(name), "Multiple buckets in
one request are not supported");
Review Comment:
minor optimization: `bucketName` is not needed, since `bucket` knows its name
```suggestion
} else {
Preconditions.assertEquals(bucket.getName(), name, "Multiple buckets
in one request are not supported");
```
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3RequestContext.java:
##########
@@ -21,15 +21,19 @@
import java.io.IOException;
import org.apache.hadoop.ozone.audit.AuditLogger.PerformanceStringBuilder;
import org.apache.hadoop.ozone.audit.S3GAction;
+import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneVolume;
import org.apache.hadoop.util.Time;
+import org.apache.ratis.util.Preconditions;
class S3RequestContext {
private final long startNanos;
private final PerformanceStringBuilder perf;
private final EndpointBase endpoint;
private S3GAction action;
private OzoneVolume volume;
+ private String bucketName;
Review Comment:
```suggestion
```
--
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]