szetszwo commented on code in PR #10454:
URL: https://github.com/apache/ozone/pull/10454#discussion_r3437572146


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java:
##########
@@ -403,7 +403,7 @@ Pipeline getPipeline() {
     }
 
     NavigableSet<ContainerID> getContainers() {
-      return Collections.unmodifiableNavigableSet(containers);
+      return new TreeSet<>(containers);

Review Comment:
   Let's have two methods below.  Copy only when it is needed. 
   - NavigableSet<ContainerID> getContainers() //no copying
   - NavigableSet<ContainerID> copyContainers()
   
   



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