[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-06-08 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: In Progress  (was: Patch Available)

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch, HADOOP-12908-004.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-01-05 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: Patch Available  (was: In Progress)

[~djp] Please review patch 004 which is much simpler than 003.

Decided to use singleton because without DI framework, manual DI would pollute 
many places with unnecessary JvmPauseMonitor dependencies.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch, HADOOP-12908-004.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-01-05 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Attachment: HADOOP-12908-004.patch

Patch 004
* Make JvmPauseMonitor a singleton
* Add JvmMetrics#startPauseMonitor(conf) to start the JvmPauseMonitor singleton
* Since JvmPauseMonitor is a singleton, it will not be stopped.
* Split JvmPauseMonitor tests out of TestJvmMetrics into a new 
TestJvmPauseMonitor


> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch, HADOOP-12908-004.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-01-04 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: In Progress  (was: Patch Available)

Thanks [~djp].

I am glad you prefer the singleton approach among the following 3 choices:
* HADOOP-12908: Add option {{jvm.pause.monitor.enabled}} to turn on/off the 
monitor thread
* HADOOP-12946: Ensure at most one monitor thread when there are multiple 
JvmPauseMonitor instances
* HADOOP-12908: Make JvmPauseMonitor a singleton thus only one monitor thread 
is running. Multiple services can share the singleton in mini clusters. Add a 
reusable class {{AbstractSharedService}}.

Let me also explore Dependency Injection (DI) a bit because I'd prefer DI over 
Singleton. However, considering {{JvmMetrics}} is already a singleton, we might 
have to live with Singleton.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-01-04 Thread Junping Du (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Junping Du updated HADOOP-12908:

Target Version/s: 2.9.0  (was: 2.8.0)

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2017-01-04 Thread Junping Du (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Junping Du updated HADOOP-12908:

Fix Version/s: (was: 2.8.0)

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-19 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

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
{code}
pauseMonitor = new JvmPauseMonitor();
addService(pauseMonitor);
jm.setPauseMonitor(pauseMonitor);
{code}
can be replaced with
{code}
addService(JvmPauseMonitor.getInstance());
{code}

And this code segment
{code}
  pauseMonitor = new JvmPauseMonitor();
  pauseMonitor.init(config);
  pauseMonitor.start();
  metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
{code}
can be replaced with
{code}
  pauseMonitor = JvmPauseMonitor.getInstance();
  pauseMonitor.init(config);
  pauseMonitor.start();
{code}


  was:
Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
case to run multiple instances per JVM. No need for 
{{TestMetrics$setPauseMonitor}} any more. Initialization code can be simplified.

For example, this code segment
{noformat}
pauseMonitor = new JvmPauseMonitor();
addService(pauseMonitor);
jm.setPauseMonitor(pauseMonitor);
{noformat}
becomes
{noformat}
addService(JvmPauseMonitor.INSTANCE);
{noformat}

And this code segment
{noformat}
  pauseMonitor = new JvmPauseMonitor();
  pauseMonitor.init(config);
  pauseMonitor.start();
  metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
{noformat}
becomes
{noformat}
  pauseMonitor.INSTANCE.init(config);
  pauseMonitor.INSTANCE.start();
{noformat}



> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-19 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: Patch Available  (was: In Progress)

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-19 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Attachment: HADOOP-12908-003.patch

Patch 003:
* Rename AbstractSingletonService to AbstractSharedService
* Add more test cases and documentation

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch, 
> HADOOP-12908-003.patch
>
>
> 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
> {code}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
> addService(JvmPauseMonitor.getInstance());
> {code}
> And this code segment
> {code}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {code}
> can be replaced with
> {code}
>   pauseMonitor = JvmPauseMonitor.getInstance();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-18 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: In Progress  (was: Patch Available)

Add more test cases.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-10 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: Patch Available  (was: Open)

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-10 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Attachment: HADOOP-12908-002.patch

Patch 002:
* Fix checkstyle and findbugs issues

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch, HADOOP-12908-002.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-09 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Status: Open  (was: Patch Available)

Fixing test-patch failures.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-09 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Fix Version/s: 2.8.0
   Status: Patch Available  (was: Open)

This patch will work better when AbstractService is restartable, i.e., allowing 
state transition from STOPPED to STARTED.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Fix For: 2.8.0
>
> Attachments: HADOOP-12908-001.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-12908) Make JvmPauseMonitor a singleton

2016-03-09 Thread John Zhuge (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Zhuge updated HADOOP-12908:

Attachment: HADOOP-12908-001.patch

Patch 001:
* Make JvmPauseMonitor a singleton
* Inherit JvmPauseMonitor from a new class AbstractSingletonService which 
allows a service to shared by multiple owners and makes sure 
{{serviceInit/serviceStart/serviceStop}} is only called once.
* Move JvmPauseMonitor related test cases from TestJvmMetrics to a new 
TestJvmPauseMonitor

Passed test 
{{TestMiniDFSCluster,TestMiniYarnCluster,TestJvmMetrics,TestJvmPauseMonitor}}.

> Make JvmPauseMonitor a singleton
> 
>
> Key: HADOOP-12908
> URL: https://issues.apache.org/jira/browse/HADOOP-12908
> Project: Hadoop Common
>  Issue Type: Improvement
>Affects Versions: 2.7.2
>Reporter: John Zhuge
>Assignee: John Zhuge
>Priority: Minor
> Attachments: HADOOP-12908-001.patch
>
>
> Make JvmPauseMonitor a singleton just as JvmMetrics because there is no use 
> case to run multiple instances per JVM. No need for 
> {{TestMetrics$setPauseMonitor}} any more. Initialization code can be 
> simplified.
> For example, this code segment
> {noformat}
> pauseMonitor = new JvmPauseMonitor();
> addService(pauseMonitor);
> jm.setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
> addService(JvmPauseMonitor.INSTANCE);
> {noformat}
> And this code segment
> {noformat}
>   pauseMonitor = new JvmPauseMonitor();
>   pauseMonitor.init(config);
>   pauseMonitor.start();
>   metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
> {noformat}
> becomes
> {noformat}
>   pauseMonitor.INSTANCE.init(config);
>   pauseMonitor.INSTANCE.start();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)