sravani-revuri commented on code in PR #11100:
URL: https://github.com/apache/ozone/pull/11100#discussion_r3853992846
##########
hadoop-ozone/cli-debug/src/main/java/org/apache/hadoop/ozone/fsck/ContainerMapper.java:
##########
Review Comment:
nit: return type here says BlockDetails but the actual type is
BlockIdDetails.
##########
hadoop-ozone/cli-debug/src/main/java/org/apache/hadoop/ozone/fsck/ContainerMapper.java:
##########
@@ -93,27 +93,28 @@ public static void main(String[] args) throws IOException {
OzoneManagerProtocolProtos.KeyInfo.parseFrom(value));
for (OmKeyLocationInfoGroup keyLocationInfoGroup : keyInfo
.getKeyLocationVersions()) {
- List<OmKeyLocationInfo> keyLocationInfo = keyLocationInfoGroup
- .createLocationList();
- for (OmKeyLocationInfo keyLocation : keyLocationInfo) {
- BlockIdDetails blockIdDetails = new BlockIdDetails();
- Map<Long, BlockIdDetails> innerMap = new HashMap<>();
-
- long containerID = keyLocation.getBlockID().getContainerID();
- long blockID = keyLocation.getBlockID().getLocalID();
- blockIdDetails.setBucketName(keyInfo.getBucketName());
- blockIdDetails.setBlockVol(keyInfo.getVolumeName());
- blockIdDetails.setKeyName(keyInfo.getKeyName());
-
- List<Map<Long, BlockIdDetails>> innerList = new ArrayList<>();
- innerMap.put(blockID, blockIdDetails);
-
- if (dataMap.containsKey(containerID)) {
- innerList = dataMap.get(containerID);
+ for (List<OmKeyLocationInfo> keyLocationInfo :
keyLocationInfoGroup
+ .getLocationLists()) {
+ for (OmKeyLocationInfo keyLocation : keyLocationInfo) {
Review Comment:
nit: this method now has 4 levels of looping which can be hard to read and
understand. would it be better to put the logic below into a separate function?
--
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]