adoroszlai commented on code in PR #6823:
URL: https://github.com/apache/ozone/pull/6823#discussion_r1644067080


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java:
##########
@@ -1133,6 +1133,43 @@ void overwriteAfterRewrite(BucketLayout layout) throws 
IOException {
     assertEquals(overwriteDetails.getGeneration(), 
actualKeyDetails.getGeneration());
   }
 
+  @ParameterizedTest
+  @EnumSource
+  void rewriteAfterRename(BucketLayout layout) throws IOException {
+    OzoneBucket bucket = createBucket(layout);
+    OzoneKeyDetails keyDetails = createTestKey(bucket);
+    String newKeyName = "rewriteAfterRename-" + layout;
+
+    bucket.renameKey(keyDetails.getName(), newKeyName);
+    OzoneKeyDetails renamedKeyDetails = bucket.getKey(newKeyName);
+    OmKeyArgs keyArgs = toOmKeyArgs(renamedKeyDetails);
+    OmKeyInfo keyInfo = ozoneManager.lookupKey(keyArgs);
+
+    final byte[] rewriteContent = "rewrite".getBytes(UTF_8);
+    rewriteKey(bucket, renamedKeyDetails, rewriteContent);
+
+    OzoneKeyDetails actualKeyDetails = assertKeyContent(bucket, newKeyName, 
rewriteContent);
+    assertMetadataUnchanged(keyDetails, actualKeyDetails);
+    assertMetadataAfterRewrite(keyInfo, ozoneManager.lookupKey(keyArgs));

Review Comment:
   - There is no restriction for rewritten content, could be changed from 
original one.
   - Modification time is always updated, even for rename.



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