sumitagrawl commented on code in PR #9147:
URL: https://github.com/apache/ozone/pull/9147#discussion_r2438365793


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -75,6 +78,14 @@ public class ContainerSet implements Iterable<Container<?>> {
   private final WitnessedContainerMetadataStore containerMetadataStore;
   // Handler that will be invoked when a scan of a container in this set is 
requested.
   private OnDemandContainerScanner containerScanner;
+  
+  // Maps volume storage ID to a set of container IDs
+  private final ConcurrentHashMap<String, ConcurrentSkipListSet<Long>> 
volumeToContainersMap =

Review Comment:
   Instead of adding mapping in ContainerSet, a collection can be created in 
HddsVolume itself having just containerId,
   1. addContainer --> 
container.getContainerData().getVolume().addContainer(containerId);
   2. removeContainer --> 
container.getContainerData().getVolume().removeContainer(containerId);
   
   And if any details for container is required for the volume,
   - iterate over containers from volume,
      - get container Id, and get containerSet.get(containerId)
      - process details
   



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