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

Make JvmPauseMonitor a singleton

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 2.7.2
    • None
    • None
    • None

    Description

      Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use case to run multiple instances per JVM. TestMetrics$setPauseMonitor becomes obsolete. Initialization code for various components can be simplified.

      For example, this code segment

          pauseMonitor = new JvmPauseMonitor();
          addService(pauseMonitor);
          jm.setPauseMonitor(pauseMonitor);
      

      can be replaced with

          addService(JvmPauseMonitor.getInstance());
      

      And this code segment

            pauseMonitor = new JvmPauseMonitor();
            pauseMonitor.init(config);
            pauseMonitor.start();
            metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
      

      can be replaced with

            pauseMonitor = JvmPauseMonitor.getInstance();
            pauseMonitor.init(config);
            pauseMonitor.start();
      

      Attachments

        1. HADOOP-12908-001.patch
          28 kB
          John Zhuge
        2. HADOOP-12908-002.patch
          29 kB
          John Zhuge
        3. HADOOP-12908-003.patch
          35 kB
          John Zhuge
        4. HADOOP-12908-004.patch
          26 kB
          John Zhuge

        Issue Links

          Activity

            People

              jzhuge John Zhuge
              jzhuge John Zhuge
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: