sarvekshayr commented on code in PR #10849:
URL: https://github.com/apache/ozone/pull/10849#discussion_r3643609528
##########
hadoop-ozone/cli-debug/src/main/java/org/apache/hadoop/ozone/debug/om/ContainerToKeyMapping.java:
##########
@@ -332,8 +344,43 @@ private void processMultipartUpload(Set<Long>
containerIds, Map<Long, List<Strin
}
private Set<Long> getKeyContainers(OmKeyInfo keyInfo, Set<Long>
targetContainerIds) {
+ return getContainers(keyInfo.getKeyLocationVersions(), targetContainerIds);
+ }
+
+ /**
+ * Scans the split multipartPartsTable for all parts belonging to the given
+ * multipart upload (its uploadId is the last path component of the
+ * multipartInfoTable db key) and returns the target containers referenced by
+ * those parts' block locations.
+ */
+ private Set<Long> getSplitPartContainers(String multipartInfoDbKey,
Set<Long> targetContainerIds) {
+ Set<Long> matchedContainers = new HashSet<>();
+ String uploadId = multipartInfoDbKey.substring(
+ multipartInfoDbKey.lastIndexOf(OM_KEY_PREFIX) +
OM_KEY_PREFIX.length());
Review Comment:
Use the below approach instead of manual substring parsing -
```suggestion
String uploadId;
try {
uploadId = OmMultipartUpload.from(multipartInfoDbKey).getUploadId();
} catch (IllegalArgumentException e) {
err().println("Invalid multipartInfoTable key " + multipartInfoDbKey +
", " + e);
return matchedContainers;
}
```
--
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]