You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Edward Ribeiro <ed...@gmail.com> on 2013/01/20 14:42:46 UTC
Re: Review Request: QuorumPeer should unregister only its previsously
registered MBeans instead of use MBeanRegistry.unregisterAll() method.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2208/#review15527
-----------------------------------------------------------
/src/java/main/org/apache/zookeeper/jmx/MBeanRegistry.java
<https://reviews.apache.org/r/2208/#comment33512>
This method is leaking the keySet of a field to outside world. I suggest to change this to either:
1. return new HashSet<ZKMBeanInfo>(mapBean2Path.keySet()); // returns a static snapshot
or
2. return Collections.unmodifiableSet(mapBean2Path.keySet()); // returns a live view
I prefer the 1st one, but let you decide.
- Edward Ribeiro
On Jan. 13, 2012, 12:10 p.m., César Álvarez Núñez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/2208/
> -----------------------------------------------------------
>
> (Updated Jan. 13, 2012, 12:10 p.m.)
>
>
> Review request for zookeeper.
>
>
> Description
> -------
>
> See https://issues.apache.org/jira/browse/ZOOKEEPER-1214
>
>
> This addresses bug ZOOKEEPER-1214.
> https://issues.apache.org/jira/browse/ZOOKEEPER-1214
>
>
> Diffs
> -----
>
> /src/java/main/org/apache/zookeeper/jmx/MBeanRegistry.java 1226094
> /src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 1226094
> /src/java/test/org/apache/zookeeper/test/QuorumUtil.java 1226094
> /src/java/test/org/apache/zookeeper/test/QuorumUtilTest.java PRE-CREATION
>
> Diff: https://reviews.apache.org/r/2208/diff/
>
>
> Testing
> -------
>
> -
>
>
> Thanks,
>
> César Álvarez Núñez
>
>