Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14953

MetricsSystemImpl should consistently check minicluster mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: test
    • Labels:
      None
    • Target Version/s:

      Description

      Found this when writing some tests related to JvmMetrics.
      It appears JvmMetrics.initSingleton twice in minicluster works, but JvmMetrics.create twice doesn't.

      This jira suggests to investigate whether this is intentional, and likely make the check of DefaultMetricsSystem.inMiniClusterMode() consistent in MetricsSystemImpl to ease testing.

      org.apache.hadoop.metrics2.MetricsException: Metrics source JvmMetrics already exists!
              at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.newSourceName(DefaultMetricsSystem.java:152)
              at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.sourceName(DefaultMetricsSystem.java:125)
              at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.register(MetricsSystemImpl.java:229)
              at org.apache.hadoop.metrics2.source.JvmMetrics.create(JvmMetrics.java:95)
      

        Attachments

          Activity

            People

            • Assignee:
              bharat Bharat Viswanadham
              Reporter:
              xiaochen Xiao Chen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: