mladjan-gadzic commented on code in PR #4186:
URL: https://github.com/apache/ozone/pull/4186#discussion_r1097305645
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java:
##########
@@ -122,6 +122,9 @@ private S3ErrorTable() {
"NotImplemented", "This part of feature is not implemented yet.",
HTTP_NOT_IMPLEMENTED);
+ public static final OS3Exception NO_OVERWRITE = new OS3Exception(
+ "Conflict", "Cannot overwrite file with directory", HTTP_CONFLICT);
Review Comment:
I've tested it manually already. This is no-op. Here are the results:
```
bash-4.2$ ozone sh bucket create /s3v/fso-bucket -l FILE_SYSTEM_OPTIMIZED
ozone git:(HDDS-7594) ✗ aws s3api put-object --endpoint
http://localhost:9878 --bucket fso-bucket --key dir1
bash-4.2$ ozone sh key list /s3v/fso-bucket
[ {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/",
"dataSize" : 0,
"creationTime" : "2023-02-06T12:01:51.883Z",
"modificationTime" : "2023-02-06T12:01:51.883Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
} ]
ozone git:(HDDS-7594) ✗ aws s3api put-object --endpoint
http://localhost:9878 --bucket fso-bucket --key dir1
bash-4.2$ ozone sh key list /s3v/fso-bucket
[ {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/",
"dataSize" : 0,
"creationTime" : "2023-02-06T12:01:51.883Z",
"modificationTime" : "2023-02-06T12:01:51.883Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
} ]
ozone git:(HDDS-7594) ✗ aws s3api put-object --endpoint
http://localhost:9878 --bucket fso-bucket --key dir1/key1 --body README.md
bash-4.2$ ozone sh key list /s3v/fso-bucket
[ {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/",
"dataSize" : 0,
"creationTime" : "2023-02-06T12:01:51.883Z",
"modificationTime" : "2023-02-06T12:01:51.883Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
}, {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/key1",
"dataSize" : 4263,
"creationTime" : "2023-02-06T12:03:08.380Z",
"modificationTime" : "2023-02-06T12:03:09.141Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
} ]
ozone git:(HDDS-7594) ✗ aws s3api put-object --endpoint
http://localhost:9878 --bucket fso-bucket --key dir1
bash-4.2$ ozone sh key list /s3v/fso-bucket
[ {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/",
"dataSize" : 0,
"creationTime" : "2023-02-06T12:01:51.883Z",
"modificationTime" : "2023-02-06T12:01:51.883Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
}, {
"volumeName" : "s3v",
"bucketName" : "fso-bucket",
"name" : "dir1/key1",
"dataSize" : 4263,
"creationTime" : "2023-02-06T12:03:08.380Z",
"modificationTime" : "2023-02-06T12:03:09.141Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { }
} ]
ozone git:(HDDS-7594) ✗ aws s3api put-object --endpoint
http://localhost:9878 --bucket fso-bucket --key dir1/key1
An error occurred (Conflict) when calling the PutObject operation: Cannot
overwrite file with directory
```
According to those above, everything is working as intended.
--
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]