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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java:
##########
@@ -158,10 +162,14 @@ private Comparator<ContainerID> 
orderContainersByUsedBytes() {
    * Checks whether a Container has the ReplicationType
    * {@link HddsProtos.ReplicationType#EC}.
    * @param container container to check
-   * @return true if the ReplicationType is EC, else false
+   * @return true if the ReplicationType is EC and "hdds.scm.replication
+   * .enable.legacy" is true, else false
    */
   private boolean isECContainer(ContainerInfo container) {
-    return 
container.getReplicationType().equals(HddsProtos.ReplicationType.EC);
+    boolean legacyEnabled = ozoneConfiguration.
+        getBoolean("hdds.scm.replication.enable.legacy", true);

Review Comment:
   The same config can be looked up by 
`replicationManager.getConfig().isLegacyEnabled()`.  That way we could avoid 
the need to pass `OzoneConfiguration` to the constructor, as well as the 
duplication of config key name.
   
   Nit: I think we can also skip storing this in a local variable.



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