Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -85,11 +86,7 @@ private boolean isContainerReplicatingOrDeleting(ContainerID containerID) {
* 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.
*/
Expand Down Expand Up @@ -158,12 +155,12 @@ private Comparator<ContainerID> orderContainersByUsedBytes() {

/**
* 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's just me, but this suggests to me as if Enabled applies to both legacy RM and EC container.

How about isUnsupportedType (or similar), to hide internal details?

return container.getReplicationType().equals(HddsProtos.ReplicationType.EC)
&& replicationManager.getConfig().isLegacyEnabled();
}
Expand All @@ -178,7 +175,7 @@ private boolean shouldBeExcluded(ContainerID containerID,
"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(),
Expand Down