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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org