akshat0395 commented on code in PR #4630:
URL: https://github.com/apache/hive/pull/4630#discussion_r1307718786


##########
standalone-metastore/metastore-common/src/test/java/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleReportersConf.java:
##########
@@ -149,4 +148,30 @@ public void testNoFallbackOnIncorrectConf() throws 
Exception {
 
     Assert.assertFalse(jsonReportFile.exists());
   }
+
+  /**
+   * Tests if MetricsFactory is initialised properly, if in case 
Metrics2Reporter is tried to add more than once.
+   *
+   * **/
+  @Test
+  public void testMetricsFactoryInitMetrics2ReporterAddedTwice() throws 
Exception {
+    if(MetricsFactory.getInstance() != null) {
+      MetricsFactory.close();
+    }
+    Configuration conf = new Configuration();
+
+    jsonReportFile = File.createTempFile("TestCodahaleMetrics", ".json");
+    System.out.println("Json metrics saved in " + 
jsonReportFile.getAbsolutePath());

Review Comment:
   Can we use logger here rather than system out



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