ivandika3 commented on code in PR #10202:
URL: https://github.com/apache/ozone/pull/10202#discussion_r3212633574


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/OzoneBucketStub.java:
##########
@@ -158,7 +160,6 @@ public void close() throws IOException {
                 UserGroupInformation.getCurrentUser().getShortUserName(),
                 tags
             ));
-            super.close();

Review Comment:
   Could you help briefly explain this?



##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -298,6 +297,8 @@ customMetadata, tags, multiDigestInputStream, getHeaders(),
           output.getMetadata().put(OzoneConsts.ETAG, md5Hash);
 
           List<CheckedRunnable<IOException>> preCommits = new ArrayList<>();
+          preCommits.add(validateContentLength(
+              length, putLength, keyPath));

Review Comment:
   Nit: Let's not wrap this in a new line. Also apply in the other similar 
places.



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1473,13 +1473,6 @@ private OmKeyArgs.Builder 
createWriteKeyArgsBuilder(String volumeName,
   private OzoneOutputStream openOutputStream(OmKeyArgs keyArgs, long size)
       throws IOException {
     OpenKeySession openKey = ozoneManagerClient.openKey(keyArgs);
-    // For bucket with layout OBJECT_STORE, when create an empty file (size=0),
-    // OM will set DataSize to OzoneConfigKeys#OZONE_SCM_BLOCK_SIZE,
-    // which will cause S3G's atomic write length check to fail,
-    // so reset size to 0 here.
-    if (isS3GRequest.get() && size == 0) {
-      openKey.getKeyInfo().setDataSize(0);
-    }

Review Comment:
   Is `isS3GRequest` attributes still used? If not, let's remove it.
   
   Removing the `setDataSize(0)` seems fine since we are not dependent on the 
DataSize returned by OpenKey. However, just to be sure, please help check 
whether the OBJECT_STORE empty file case is already test is covered.



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

Reply via email to