jojochuang commented on code in PR #10185:
URL: https://github.com/apache/ozone/pull/10185#discussion_r3573469408


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis_snapshot/OmRatisSnapshotProvider.java:
##########
@@ -96,38 +204,64 @@ public OmRatisSnapshotProvider(File snapshotDir,
     this.spnegoEnabled = spnegoEnabled;
     this.connectionFactory = connectionFactory;
     this.useV2CheckpointApi = OZONE_OM_DB_CHECKPOINT_USE_INODE_BASED_DEFAULT;
+    this.bootstrapMinSpaceBytes = 0L;
+    this.bootstrapCheckpointHeadroomRatio = 
OZONE_OM_BOOTSTRAP_CHECKPOINT_HEADROOM_RATIO_DEFAULT;
   }
 
   public OmRatisSnapshotProvider(MutableConfigurationSource conf,
       File omRatisSnapshotDir, Map<String, OMNodeDetails> peerNodeDetails) {
+    this(conf, omRatisSnapshotDir, peerNodeDetails, null);
+  }
+
+  /**
+   * Same as {@link #OmRatisSnapshotProvider(MutableConfigurationSource, File, 
Map)} but allows
+   * tests to inject a {@link URLConnectionFactory} (for example a factory 
that returns a mock
+   * {@link HttpURLConnection}).
+   */
+  @VisibleForTesting
+  public OmRatisSnapshotProvider(MutableConfigurationSource conf,
+      File omRatisSnapshotDir,
+      Map<String, OMNodeDetails> peerNodeDetails,
+      URLConnectionFactory connectionFactoryOverride) {
     super(omRatisSnapshotDir, OM_DB_NAME);
     LOG.info("Initializing OM Snapshot Provider");
     this.peerNodesMap = new ConcurrentHashMap<>();
     peerNodesMap.putAll(peerNodeDetails);
     this.useV2CheckpointApi = 
conf.getBoolean(OZONE_OM_DB_CHECKPOINT_USE_INODE_BASED_KEY,
         OZONE_OM_DB_CHECKPOINT_USE_INODE_BASED_DEFAULT);
+    this.bootstrapMinSpaceBytes = (long) conf.getStorageSize(
+        OZONE_OM_BOOTSTRAP_MIN_SPACE_KEY,
+        OZONE_OM_BOOTSTRAP_MIN_SPACE_DEFAULT,
+        StorageUnit.BYTES);
+    this.bootstrapCheckpointHeadroomRatio = conf.getDouble(
+        OZONE_OM_BOOTSTRAP_CHECKPOINT_HEADROOM_RATIO_KEY,
+        OZONE_OM_BOOTSTRAP_CHECKPOINT_HEADROOM_RATIO_DEFAULT);

Review Comment:
   nice to have, but it's unrelated.



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