anmolanmol1234 commented on code in PR #6314:
URL: https://github.com/apache/hadoop/pull/6314#discussion_r1521449729


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -1411,6 +1448,97 @@ protected AccessTokenProvider getTokenProvider() {
     return tokenProvider;
   }
 
+  public AzureBlobFileSystem getMetricFilesystem() throws IOException {
+    if (metricFs == null) {
+      try {
+        Configuration metricConfig = abfsConfiguration.getRawConfiguration();
+        String metricAccountKey = 
metricConfig.get(FS_AZURE_METRIC_ACCOUNT_KEY);
+        final String abfsMetricUrl = metricConfig.get(FS_AZURE_METRIC_URI);
+        if (abfsMetricUrl == null) {
+          return null;
+        }
+        metricConfig.set(FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME, metricAccountKey);
+        metricConfig.set(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, 
"false");
+        URI metricUri;
+        metricUri = new URI(FileSystemUriSchemes.ABFS_SCHEME, abfsMetricUrl, 
null, null, null);
+        metricFs = (AzureBlobFileSystem) FileSystem.newInstance(metricUri, 
metricConfig);

Review Comment:
   The primary intention behind having a distinct configuration for the metric 
file system is to offer users the flexibility to choose where the additional 
metric calls are directed. Users can configure the system to send metrics 
either to the existing file system or to a separate file system based on their 
preferences. If a separate account is utilized for the metric URI, 
authentication may fail because we are currently employing the existing 
AbfsClient instance. 



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to