rich7420 commented on code in PR #11056:
URL: https://github.com/apache/ozone/pull/11056#discussion_r3821446215


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconContainerMetadataManagerImpl.java:
##########
@@ -514,11 +514,14 @@ private List<Pipeline> getPipelines(ContainerKeyPrefix 
containerKeyPrefix)
     }
     List<Pipeline> pipelines = new ArrayList<>();
     if (null != omKeyInfo) {
-      omKeyInfo.getKeyLocationVersions().stream().map(
-          omKeyLocationInfoGroup ->
-              omKeyLocationInfoGroup.getLocationList()
-                  .stream().map(omKeyLocationInfo -> pipelines.add(
-                      omKeyLocationInfo.getPipeline())));
+      omKeyInfo.getKeyLocationVersions().forEach(omKeyLocationInfoGroup ->

Review Comment:
   Not a test-lint fix — `getPipelines()` returned empty before (the old 
`stream().map(...add...)` was never consumed), so this actually changes what 
Recon reports. Please add a test for a non-empty pipeline list and call the 
behavior fix out in the description instead of under "Fix tests".



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java:
##########
@@ -779,7 +779,7 @@ public OpenKeySession openKey(OmKeyArgs args) throws 
IOException {
   private OMResponse handleError(OMResponse resp) throws OMException {
     if (resp.getStatus() != OK) {
       throw new OMException(resp.getMessage(),
-          ResultCodes.values()[resp.getStatus().ordinal()]);
+          ResultCodes.valueOf(resp.getStatus().name()));

Review Comment:
   `valueOf(name())` is the right pattern, but this changes error-code 
translation for any status where the `Status` and `ResultCodes` ordinals 
differ. Is this an intended behavior fix? If so, a small test (a status past 
the first divergence) + a note in the description would help.



-- 
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]

Reply via email to