This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new b932e1644f HDDS-10085. Improve method name in
ContainerBalancerSelectionCriteria (#5957)
b932e1644f is described below
commit b932e1644f90d4783088c8cb433e846d16ad7909
Author: Siddhant Sangwan <[email protected]>
AuthorDate: Sun Jan 14 19:18:32 2024 +0530
HDDS-10085. Improve method name in ContainerBalancerSelectionCriteria
(#5957)
---
.../balancer/ContainerBalancerSelectionCriteria.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java
index ec0e493c28..8171320a54 100644
---
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java
+++
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.hdds.scm.container.ContainerInfo;
import org.apache.hadoop.hdds.scm.container.ContainerManager;
import org.apache.hadoop.hdds.scm.container.ContainerNotFoundException;
import org.apache.hadoop.hdds.scm.container.ContainerReplica;
+import
org.apache.hadoop.hdds.scm.container.replication.LegacyReplicationManager;
import org.apache.hadoop.hdds.scm.container.replication.ReplicationManager;
import org.apache.hadoop.hdds.scm.node.NodeManager;
import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
@@ -85,11 +86,7 @@ public class ContainerBalancerSelectionCriteria {
* 3. Container size should be closer to 5GB.
* 4. Container must not be in the configured exclude containers list.
* 5. Container should be closed.
- * 6. Container should not be an EC container
- * //TODO Temporarily not considering EC containers as candidates
- * @see
- * <a href="https://issues.apache.org/jira/browse/HDDS-6940">HDDS-6940</a>
- *
+ * 6. If the {@link LegacyReplicationManager} is enabled, then the container
should not be an EC container.
* @param node DatanodeDetails for which to find candidate containers.
* @return NavigableSet of candidate containers that satisfy the criteria.
*/
@@ -158,12 +155,12 @@ public class ContainerBalancerSelectionCriteria {
/**
* Checks whether a Container has the ReplicationType
- * {@link HddsProtos.ReplicationType#EC}.
+ * {@link HddsProtos.ReplicationType#EC} and the Legacy Replication Manger
is enabled.
* @param container container to check
* @return true if the ReplicationType is EC and "hdds.scm.replication
* .enable.legacy" is true, else false
*/
- private boolean isECContainer(ContainerInfo container) {
+ private boolean isECContainerAndLegacyRMEnabled(ContainerInfo container) {
return container.getReplicationType().equals(HddsProtos.ReplicationType.EC)
&& replicationManager.getConfig().isLegacyEnabled();
}
@@ -178,7 +175,7 @@ public class ContainerBalancerSelectionCriteria {
"candidate container. Excluding it.", containerID);
return true;
}
- return !isContainerClosed(container, node) || isECContainer(container) ||
+ return !isContainerClosed(container, node) ||
isECContainerAndLegacyRMEnabled(container) ||
isContainerReplicatingOrDeleting(containerID) ||
!findSourceStrategy.canSizeLeaveSource(node, container.getUsedBytes())
|| breaksMaxSizeToMoveLimit(container.containerID(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]