captainzmc commented on a change in pull request #1150:
URL: https://github.com/apache/hadoop-ozone/pull/1150#discussion_r457051453
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##########
@@ -750,6 +751,25 @@ public void renameKey(String volumeName, String bucketName,
ozoneManagerClient.renameKey(keyArgs, toKeyName);
}
+ @Override
+ public void renameKeys(String volumeName, String bucketName,
+ Map<String, String> keyMap) throws IOException {
+ verifyVolumeName(volumeName);
+ verifyBucketName(bucketName);
+ HddsClientUtils.checkNotNull(keyMap);
+ Map <OmKeyArgs, String> keyArgsMap = new HashMap<>();
+ for (Map.Entry< String, String > entry : keyMap.entrySet()) {
+ OmKeyArgs keyArgs = new OmKeyArgs.Builder()
+ .setVolumeName(volumeName)
+ .setBucketName(bucketName)
+ .setKeyName(entry.getKey())
+ .build();
+ keyArgsMap.put(keyArgs, entry.getValue());
+ }
Review comment:
Thanks for @adoroszlai 's reply. At present, our client calls
RpcClient#renameKeys through
[OzoneBucket#renameKeys](https://github.com/apache/hadoop-ozone/pull/1150/files#diff-a4a0be1d5df61f0de3bdce909bb3a4a3R1273)
to batch renameKeys. OzoneBucket is a bucket-level API, we can only rename
Keys in a single volume/bucket use it.
I will remove the volume/bucket existence check in OMKeysRenameRequest,
which is redundant. Any other suggestions for changes?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]