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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -328,28 +329,46 @@ public class OmMetadataManagerImpl implements 
OMMetadataManager,
    */
   public OmMetadataManagerImpl(OzoneConfiguration conf,
       OzoneManager ozoneManager) throws IOException {
-    this.ozoneManager = ozoneManager;
+    init(conf, ozoneManager);
+    this.lock = new OzoneManagerLock(conf);
+    this.omEpoch = OmUtils.getOMEpoch(isRatisEnabled);
+    this.perfMetrics = null;
+    start(conf);
+  }
+
+  public OmMetadataManagerImpl(OzoneConfiguration conf,
+                               OzoneManager ozoneManager,
+                               OMPerformanceMetrics perfMetrics)
+      throws IOException {
+    init(conf, ozoneManager);
     this.lock = new OzoneManagerLock(conf);
-    // TODO: This is a temporary check. Once fully implemented, all OM state
-    //  change should go through Ratis - be it standalone (for non-HA) or
-    //  replicated (for HA).
-    isRatisEnabled = conf.getBoolean(
-        OMConfigKeys.OZONE_OM_RATIS_ENABLE_KEY,
-        OMConfigKeys.OZONE_OM_RATIS_ENABLE_DEFAULT);
     this.omEpoch = OmUtils.getOMEpoch(isRatisEnabled);
+    this.perfMetrics = perfMetrics;
     // For test purpose only
     ignorePipelineinKey = conf.getBoolean(
-        "ozone.om.ignore.pipeline", Boolean.TRUE);
+  "ozone.om.ignore.pipeline", Boolean.TRUE);
     start(conf);
   }
-
+  private void init(OzoneConfiguration conf, OzoneManager manager) {
+    this.ozoneManager = manager;
+    // TODO: This is a temporary check. Once fully implemented, all OM state
+  //  change should go through Ratis - be it standalone (for non-HA) or
+  //  replicated (for HA).

Review Comment:
   `init()` will be hopefully removed and original code restored.



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