You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/06/27 14:40:09 UTC

[GitHub] [ozone] umamaheswararao commented on a diff in pull request #3550: HDDS-6945. EC: EC Reconstruction Command count queues should be included in DN heartbeat

umamaheswararao commented on code in PR #3550:
URL: https://github.com/apache/ozone/pull/3550#discussion_r907467318


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/ec/reconstruction/TestECReconstructionSupervisor.java:
##########
@@ -17,37 +17,57 @@
  */
 package org.apache.hadoop.ozone.container.ec.reconstruction;
 
+import com.google.common.collect.ImmutableList;
+import org.apache.hadoop.hdds.client.ECReplicationConfig;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.ozone.test.GenericTestUtils;
+import org.junit.Assert;
 import org.junit.Test;
 
+import java.io.IOException;
+import java.util.SortedMap;
 import java.util.concurrent.TimeoutException;
 
 /**
  * Tests the ECReconstructionSupervisor.
  */
 public class TestECReconstructionSupervisor {
 
-  private final ECReconstructionSupervisor supervisor =
-      new ECReconstructionSupervisor(null, null, 5, null);
-
   @Test
   public void testAddTaskShouldExecuteTheGivenTask()
-      throws InterruptedException, TimeoutException {
-    FakeTask task = new FakeTask(null);
-    supervisor.addTask(task);
-    GenericTestUtils.waitFor(() -> task.isExecuted, 100, 15000);
-  }
-
-  static class FakeTask extends ECReconstructionCoordinatorTask {
-    private boolean isExecuted = false;
-
-    FakeTask(ECReconstructionCommandInfo reconstructionCommandInfo) {
-      super(null, reconstructionCommandInfo);
-    }
-
-    @Override
-    public void run() {
-      isExecuted = true;
-    }
+      throws InterruptedException, TimeoutException, IOException {
+    final boolean[] reconstructInvoked = {false};

Review Comment:
   Ah it was just intelliJ sggestion :-)
   Thanks for suggesting CountDownLatch, it's a good fit 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