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


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/Pipeline.java:
##########
@@ -245,7 +247,13 @@ public int getReplicaIndex(DatanodeDetails dn) {
    * Get the replicaIndex Map.
    */
   public Map<DatanodeDetails, Integer> getReplicaIndexes() {
-    return 
this.getNodes().stream().collect(Collectors.toMap(Function.identity(), 
this::getReplicaIndex));
+    Map<DatanodeDetails, Integer> view = replicaIndexesView;
+    if (view == null) {
+      view = Collections.unmodifiableMap(getNodes().stream()
+          .collect(Collectors.toMap(Function.identity(), 
this::getReplicaIndex)));

Review Comment:
   Goood catch!



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