aswinshakil commented on code in PR #5126:
URL: https://github.com/apache/ozone/pull/5126#discussion_r1276632507


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -243,6 +243,7 @@ public ReplicationManager(final ConfigurationSource conf,
     this.ratisReplicationCheckHandler =
         new RatisReplicationCheckHandler(ratisContainerPlacement);
     this.nodeManager = nodeManager;
+    this.metrics = ReplicationManagerMetrics.create(this);

Review Comment:
   Starting of the subservices doesn't matter here. Because 
`ECUnderReplicationHandler` initialized before this. 
   
   ```
   public ReplicationManager(final ConfigurationSource conf,
                final ContainerManager containerManager, .... )
    .... 
   .....
   ......
       ecUnderReplicationHandler = new ECUnderReplicationHandler(
           ecContainerPlacement, conf, this); ---> ***Here metrics is still 
null.***
       ecOverReplicationHandler =
           new ECOverReplicationHandler(ecContainerPlacement, this);
       ecMisReplicationHandler = new 
ECMisReplicationHandler(ecContainerPlacement,
           conf, this);
       ratisUnderReplicationHandler = new RatisUnderReplicationHandler(
           ratisContainerPlacement, conf, this);
       ratisOverReplicationHandler =
           new RatisOverReplicationHandler(ratisContainerPlacement, this);
       ratisMisReplicationHandler = new RatisMisReplicationHandler(
           ratisContainerPlacement, conf, this);
       underReplicatedProcessor =
           new UnderReplicatedProcessor(this, 
rmConf::getUnderReplicatedInterval);
       overReplicatedProcessor =
           new OverReplicatedProcessor(this, rmConf::getOverReplicatedInterval);
   
       // Chain together the series of checks that are needed to validate the
       // containers when they are checked by RM.
       containerCheckChain = new OpenContainerHandler(this);
       containerCheckChain
           .addNext(new ClosingContainerHandler(this, clock))
           .addNext(new QuasiClosedContainerHandler(this))
           .addNext(new MismatchedReplicasHandler(this))
           .addNext(new EmptyContainerHandler(this))
           .addNext(new DeletingContainerHandler(this))
           .addNext(ecReplicationCheckHandler)
           .addNext(ratisReplicationCheckHandler)
           .addNext(new ClosedWithUnhealthyReplicasHandler(this))
           .addNext(new RatisUnhealthyReplicationCheckHandler());
       start(); ---> ***Thread is started here. Metrics still null***
     }
   
     /**
      * Starts Replication Monitor thread.
      */
     @Override
     public synchronized void start() {
       if (!isRunning()) {
         LOG.info("Starting Replication Monitor Thread.");
         running = true;
         metrics = ReplicationManagerMetrics.create(this); --> ***Initalized 
here so ECUnderReplicationHandler metric is always null.***
         if (rmConf.isLegacyEnabled()) {
           legacyReplicationManager.setMetrics(metrics);
         }
         containerReplicaPendingOps.setReplicationMetrics(metrics);
         startSubServices();
       } else {
         LOG.info("Replication Monitor Thread is already running.");
       }
     }
   ```



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