You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sodonnel (via GitHub)" <gi...@apache.org> on 2023/03/14 11:47:56 UTC
[GitHub] [ozone] sodonnel commented on a diff in pull request #4391: HDDS-8153. Integrate ContainerBalancer with MoveManager
sodonnel commented on code in PR #4391:
URL: https://github.com/apache/ozone/pull/4391#discussion_r1135420226
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerTask.java:
##########
@@ -757,48 +785,66 @@ private boolean moveContainer(DatanodeDetails source,
CompletableFuture<MoveManager.MoveResult> future;
try {
ContainerInfo containerInfo = containerManager.getContainer(containerID);
- future = replicationManager
- .move(containerID, source, moveSelection.getTargetNode())
- .whenComplete((result, ex) -> {
-
- metrics.incrementCurrentIterationContainerMoveMetric(result, 1);
- if (ex != null) {
- LOG.info("Container move for container {} from source {} to " +
- "target {} failed with exceptions {}",
- containerID.toString(),
+
+ ReplicationManager.ReplicationManagerConfiguration rmConf =
+ ozoneConfiguration.getObject(
+ ReplicationManager.ReplicationManagerConfiguration.class);
+ /*
+ If LegacyReplicationManager is enabled, ReplicationManager will
+ redirect to it. Otherwise, use MoveManager.
+ */
+ if (rmConf.isLegacyEnabled()) {
+ future = replicationManager
+ .move(containerID, source, moveSelection.getTargetNode());
+ } else {
+ future = moveManager.move(containerID, source,
+ moveSelection.getTargetNode());
+ }
+
+ future = future.whenComplete((result, ex) -> {
+ metrics.incrementCurrentIterationContainerMoveMetric(result, 1);
+ if (ex != null) {
+ LOG.info("Container move for container {} from source {} to " +
+ "target {} failed with exceptions.",
+ containerID.toString(),
+ source.getUuidString(),
+ moveSelection.getTargetNode().getUuidString(), ex);
+ metrics.incrementNumContainerMovesFailedInLatestIteration(1);
+ } else {
+ if (result == MoveManager.MoveResult.COMPLETED) {
+ sizeActuallyMovedInLatestIteration +=
+ containerInfo.getUsedBytes();
+ if (LOG.isDebugEnabled()) {
Review Comment:
NIT: We usually don't need to wrap debug calls in `if (LOG.isDebugEnabled`) if the parameters to the log are simple getters, which I think they are here.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org