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


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestAbfsClient.java:
##########
@@ -876,6 +894,308 @@ public void testIsNonEmptyDirectory() throws IOException {
         false, 1, true);
   }
 
+  /**
+   * Test to verify that in case metric account is not set,
+   * metric collection is enabled with default metric format
+   * and account url.
+   *
+   * @throws Exception in case of any failure
+   */
+  @Test
+  public void testMetricAccountFallback() throws Exception {
+    Configuration configuration = getRawConfiguration();
+    configuration.setBoolean(
+        AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false);
+    configuration.setBoolean(FS_AZURE_ACCOUNT_IS_HNS_ENABLED, false);
+    configuration.unset(FS_AZURE_METRIC_ACCOUNT_NAME);
+    configuration.unset(FS_AZURE_METRIC_ACCOUNT_KEY);
+    configuration.unset(FS_AZURE_METRIC_FORMAT);
+    configuration.setBoolean(FS_AZURE_ALWAYS_USE_HTTPS, true);
+    final AzureBlobFileSystem fs = getFileSystem(configuration);
+    Assertions.assertThat(
+            fs.getAbfsStore().getAbfsConfiguration().getMetricFormat())
+        .describedAs(
+            "In case metric format is not set, metric format should "
+                + "be defaulted to internal metric format")
+        .isEqualTo(MetricFormat.INTERNAL_METRIC_FORMAT);
+
+    Assertions.assertThat(
+            fs.getAbfsStore().getClient().isMetricCollectionEnabled())
+        .describedAs(
+            "Metric collection should be enabled even if metric account is not 
set")
+        .isTrue();
+
+    Assertions.assertThat(

Review Comment:
   If its INTERNAL_METRIC_FORMAT it should have both backoff and footer metrics 
right ?



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