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

Make JvmPauseMonitor a singleton

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      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

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

                Dates

                • Created:
                  Updated: