aswinshakil commented on a change in pull request #2942:
URL: https://github.com/apache/ozone/pull/2942#discussion_r778370393



##########
File path: 
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/StorageContainerServiceProviderImpl.java
##########
@@ -38,12 +61,53 @@
 public class StorageContainerServiceProviderImpl
     implements StorageContainerServiceProvider {
 
+  private static final Logger LOG =
+      LoggerFactory.getLogger(StorageContainerServiceProviderImpl.class);
   private StorageContainerLocationProtocol scmClient;
+  private final OzoneConfiguration configuration;
+  private String scmDBSnapshotUrl;
+  private File scmSnapshotDBParentDir;
+  private URLConnectionFactory connectionFactory;
+  private ReconUtils reconUtils;
 
   @Inject
   public StorageContainerServiceProviderImpl(
-      StorageContainerLocationProtocol scmClient) {
+      StorageContainerLocationProtocol scmClient,
+      ReconUtils reconUtils,
+      OzoneConfiguration configuration) {
+
+    int connectionTimeout = (int) configuration.getTimeDuration(
+        OZONE_RECON_SCM_CONNECTION_TIMEOUT,
+        OZONE_RECON_SCM_CONNECTION_TIMEOUT_DEFAULT, TimeUnit.MILLISECONDS);
+    int connectionRequestTimeout = (int) configuration.getTimeDuration(
+        OZONE_RECON_SCM_CONNECTION_REQUEST_TIMEOUT,
+        OZONE_RECON_SCM_CONNECTION_REQUEST_TIMEOUT_DEFAULT,
+        TimeUnit.MILLISECONDS);
+    connectionFactory =
+        URLConnectionFactory.newDefaultURLConnectionFactory(connectionTimeout,
+                connectionRequestTimeout, configuration);
+
+    String scmHttpAddress = configuration.get(ScmConfigKeys
+        .OZONE_SCM_HTTP_ADDRESS_KEY);
+
+    String scmHttpsAddress = configuration.get(ScmConfigKeys
+        .OZONE_SCM_HTTPS_ADDRESS_KEY);
+
+    HttpConfig.Policy policy = HttpConfig.getHttpPolicy(configuration);
+
+    scmSnapshotDBParentDir = ReconUtils.getReconScmDbDir(configuration);
+
+    scmDBSnapshotUrl = "http://"; + scmHttpAddress +
+            OZONE_OM_DB_CHECKPOINT_HTTP_ENDPOINT;
+
+    if (policy.isHttpsEnabled()) {
+      scmDBSnapshotUrl = "https://"; + scmHttpsAddress +
+              OZONE_OM_DB_CHECKPOINT_HTTP_ENDPOINT;

Review comment:
       Will change it.




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