You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/07/02 02:44:26 UTC

[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1150: HDDS-3903. OzoneRpcClient support batch rename keys.

captainzmc commented on a change in pull request #1150:
URL: https://github.com/apache/hadoop-ozone/pull/1150#discussion_r448717484



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocol/OzoneManagerProtocol.java
##########
@@ -216,6 +217,13 @@ OmKeyLocationInfo allocateBlock(OmKeyArgs args, long clientID,
    */
   void renameKey(OmKeyArgs args, String toKeyName) throws IOException;
 
+  /**
+   * Rename existing keys within a bucket.
+   * @param keyMap The key is new key name nad value is original key OmKeyArgs.
+   * @throws IOException
+   */
+  void renameKeys(Map<String, OmKeyArgs> keyMap) throws IOException;

Review comment:
       I'll make this to Map<OmKeyArgs, String> to consistent with the renameKey() API.
   
   In addition, the API was added to OzoneBucket and currently only supports renaming keys under the same bucket. 
   `OzoneBucket bucket = volume.getBucket(bucketName);`
   `Map<String, String> keyMap = new HashMap();`
   `keyMap.put(keyName1, newKeyName1);`
   `bucket.renameKeys(keyMap);`




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org