shuan1026 opened a new pull request, #11090:
URL: https://github.com/apache/ozone/pull/11090

   ## What changes were proposed in this pull request?
   
   `ReconContainerMetadataManagerImpl#getPipelines(ContainerKeyPrefix)` builds 
a nested `Stream` pipeline to collect the `Pipeline`s for a key's block 
locations, but both `.stream().map(...)` calls are intermediate operations with 
no terminal operation attached. Because Java streams are lazily evaluated, the 
`pipelines.add(...)` is never actually executed, so the method unconditionally 
returns the empty `ArrayList` created at the top of the method.
   
   This method is the only implementation backing 
`ContainerMetadataIterator#next()`, which is used by 
`ReconContainerMetadataManager#getContainersIterator()`. That iterator feeds 
two REST endpoints in `ContainerEndpoint`: `GET /containers/mismatch` and `GET 
/containers/mismatch/deleted`. Both currently return `"pipelines": []` for 
every container, even when the container's key actually has valid pipeline data 
in OM.
   
   This PR replaces the two dangling `.stream().map(...)` chains with 
`.forEach(...)`
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16253
   
   ## How was this patch tested?
   
   - Ran the existing `TestReconContainerMetadataManagerImpl`: 15/15 tests pass.


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