sodonnel commented on code in PR #4155:
URL: https://github.com/apache/ozone/pull/4155#discussion_r1064524535


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/ECReconstructionCoordinatorTask.java:
##########
@@ -88,40 +84,26 @@ public void run() {
       final long taskTerm = reconstructionCommandInfo.getTerm();
       if (currentTerm.isPresent() && taskTerm < currentTerm.getAsLong()) {
         LOG.info("Ignoring {} since SCM leader has new term ({} < {})",
-            this, taskTerm, currentTerm.getAsLong());
+            reconstructionCommandInfo, taskTerm, currentTerm.getAsLong());
         return;
       }
 
-      SortedMap<Integer, DatanodeDetails> sourceNodeMap =
-          reconstructionCommandInfo.getSources().stream().collect(Collectors
-              .toMap(DatanodeDetailsAndReplicaIndex::getReplicaIndex,
-                  DatanodeDetailsAndReplicaIndex::getDnDetails, (v1, v2) -> v1,
-                  TreeMap::new));
-      SortedMap<Integer, DatanodeDetails> targetNodeMap = IntStream
-          .range(0, reconstructionCommandInfo.getTargetDatanodes().size())
-          .boxed().collect(Collectors.toMap(i -> (int) 
reconstructionCommandInfo
-                  .getMissingContainerIndexes()[i],
-              i -> reconstructionCommandInfo.getTargetDatanodes().get(i),
-              (v1, v2) -> v1, TreeMap::new));
-
       reconstructionCoordinator.reconstructECContainerGroup(
           reconstructionCommandInfo.getContainerID(),
-          reconstructionCommandInfo.getEcReplicationConfig(), sourceNodeMap,
-          targetNodeMap);
-      LOG.info("Completed the EC reconstruction of the container {}",
-          reconstructionCommandInfo.getContainerID());
+          reconstructionCommandInfo.getEcReplicationConfig(),
+          reconstructionCommandInfo.getSourceNodeMap(),
+          reconstructionCommandInfo.getTargetNodeMap());
+      long elapsed = Time.monotonicNow() - start;
+      LOG.info("Completed {} in {} ms", reconstructionCommandInfo, elapsed);
     } catch (IOException e) {
-      LOG.warn(
-          "Failed to complete the reconstruction task for the container: "
-              + reconstructionCommandInfo.getContainerID(), e);
+      LOG.warn("Failed {}", reconstructionCommandInfo, e);

Review Comment:
   Might be worth adding the elapsed time to the fail message too, incase it is 
failing after some long delay or timeout?



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