adoroszlai commented on code in PR #6765:
URL: https://github.com/apache/ozone/pull/6765#discussion_r1630650214


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java:
##########
@@ -87,8 +78,7 @@ void addPipeline(Pipeline pipeline) throws IOException {
     }
     pipeline2container.put(pipeline.getId(), new TreeSet<>());
     if (pipeline.getPipelineState() == PipelineState.OPEN) {
-      query2OpenPipelines.computeIfAbsent(pipeline.getReplicationConfig(),
-          any -> new CopyOnWriteArrayList<>()).add(pipeline);
+      query2OpenPipelines.computeIfAbsent(pipeline.getReplicationConfig(), any 
-> new ArrayList<>()).add(pipeline);

Review Comment:
   nit: I think this layout is more readable:
   
   ```suggestion
         query2OpenPipelines.computeIfAbsent(pipeline.getReplicationConfig(), 
any -> new ArrayList<>())
             .add(pipeline);
   ```



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java:
##########
@@ -36,34 +36,25 @@
 import java.util.NavigableSet;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
 
 import static java.lang.String.format;
 
 /**
- * Holds the data structures which maintain the information about pipeline and
- * its state.
- * Invariant: If a pipeline exists in PipelineStateMap, both pipelineMap and
- * pipeline2container would have a non-null mapping for it.
+ * Holds the data structures which maintain the information about pipeline and 
its state.
+ * Invariant: If a pipeline exists in PipelineStateMap, both pipelineMap and 
pipeline2container would have
+ *            a non-null mapping for it.

Review Comment:
   Please avoid reformatting unnecessarily.



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