adoroszlai commented on code in PR #10056:
URL: https://github.com/apache/ozone/pull/10056#discussion_r3056110884


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java:
##########
@@ -285,6 +288,7 @@ public final class StorageContainerManager extends 
ServiceRuntimeInfoImpl
   private ContainerTokenSecretManager containerTokenMgr;
 
   private OzoneConfiguration configuration;
+  private final TracingConfig tracingConfig;

Review Comment:
   `tracingConfig` can be a local variable.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java:
##########
@@ -357,6 +361,8 @@ private StorageContainerManager(OzoneConfiguration conf,
 
     scmHANodeDetails = SCMHANodeDetails.loadSCMHAConfig(conf, 
scmStorageConfig);
     configuration = conf;
+    tracingConfig = conf.getObject(TracingConfig.class);
+    TracingUtil.initTracing("StorageContainerManager", tracingConfig);

Review Comment:
   Can call `TracingReconfigurationCallback.init` here and use callback below.
   
   Also, let's move tracing init a bit up, after `Objects.requireNonNull` 
checks, to cover more initial operations.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -510,6 +513,8 @@ private OzoneManager(OzoneConfiguration conf, StartupOption 
startupOption)
     super(OzoneVersionInfo.OZONE_VERSION_INFO);
     Objects.requireNonNull(conf, "conf == null");
     setConfiguration(conf);
+    TracingConfig tracingConfig = conf.getObject(TracingConfig.class);
+    TracingUtil.initTracing("OzoneManager", tracingConfig);

Review Comment:
   Can call `TracingReconfigurationCallback.init` here and use callback below.
   
   Then `TracingReconfigurationCallback.forReconfiguration` becomes unused, can 
be removed.



##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestTracingUtil.java:
##########
@@ -47,7 +47,7 @@ public void testDefaultMethod() {
 
   @Test
   public void testInitTracing() {
-    TracingUtil.initTracing("testInitTracing", tracingEnabled());
+    TracingUtil.initTracing("testInitTracing", tracingConfigEnabled());

Review Comment:
   Now with the overloaded method, we can keep 
   
   ```java
   TracingUtil.initTracing("testInitTracing", tracingEnabled());
   ```
   
   and `tracingConfigEnabled()` does not need to be added.



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