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

   ## What changes were proposed in this pull request?
   
   **HDDS-15440. Combine pipeline metadata and container mappings into a single 
map**
   
   This patch refactors `PipelineStateMap` by combining the existing 
`pipelineMap` and `pipeline2container` data structures into a single map that 
stores both the `Pipeline` object and its associated container information.
   
   Previously, `PipelineStateMap` maintained two separate maps keyed by 
`PipelineID`:
   
   ```java
   Map<PipelineID, Pipeline> pipelineMap
   Map<PipelineID, NavigableSet<ContainerID>> pipeline2container
   ```
   
   Maintaining related information in separate maps increased code complexity 
and introduced the possibility of the two maps becoming inconsistent. This 
patch introduces a unified data structure that encapsulates both the pipeline 
metadata and its container set, ensuring that all pipeline-related state is 
managed together.
   
   The change simplifies state management, improves maintainability, and 
reduces the risk of synchronization issues between multiple maps while 
preserving the existing behavior of `PipelineStateMap`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15440
   
   ## How was this patch tested?
   
   The patch was tested by:
   
   * Running the existing `PipelineStateMap` unit tests.
   * Verifying that pipelines can be added, retrieved, and removed successfully 
after the refactoring.
   * Verifying that container mappings associated with a pipeline are correctly 
maintained through add/remove operations.
   * Building and running the SCM module tests to ensure there are no 
regressions caused by the internal data structure change.
   
   No functional behavior changes were introduced; the patch is a refactoring 
focused on improving the internal implementation of `PipelineStateMap`.
   


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