arp7 commented on a change in pull request #662: HDDS-1207. Refactor Container 
Report Processing logic and plugin new Replication Manager.
URL: https://github.com/apache/hadoop/pull/662#discussion_r271487930
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
 ##########
 @@ -160,15 +161,43 @@ public ReplicationManager(final Configuration conf,
    * Starts Replication Monitor thread.
    */
   public synchronized void start() {
+    start(0);
+  }
+
+  /**
+   * Starts Replication Monitor thread after the given initial delay.
+   *
+   * @param delay initial delay in milliseconds
+   */
+  public void start(final long delay) {
     if (!running) {
-      LOG.info("Starting Replication Monitor Thread.");
       running = true;
-      replicationMonitor.start();
+      CompletableFuture.runAsync(() -> {
+        try {
+          LOG.info("Replication Monitor Thread will be started" +
+              " in {} milliseconds.", delay);
+          Thread.sleep(delay);
+        } catch (InterruptedException ignored) {
+          // InterruptedException is ignored.
 
 Review comment:
   Set interrupted flag 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to